ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

SENDING HTML MAIL IN ASP USING "CDONTS.NewMail"


<% dim html html = "Test Mail in ASP"
html = html & "Your HTML Body.."

Set Mail=Server.CreateObject("CDONTS.NewMail")
Mail.To="test@asp.com" 'Mail address to send.
Mail.From="test@asp.com" 'From Mail address.
Mail.Subject="Mail Test in ASP"
Mail.BodyFormat = 0
Mail.MailFormat = 0
Mail.Body=html
Mail.Send
Set Mail=nothing
%>


NOTE:Above is the code to send HTML mail in ASP. Variable html contains your html code which you need to send. Here in html variable you can write any html code, which you need to send in mail.

Sending mail in ASP using "CDO.Message"


<% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="someone@somedomain.com" myMail.TextBody="This is a message." myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 'Name or IP of remote SMTP server myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.server.com" 'Server port myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 myMail.Configuration.Fields.Update myMail.Send set myMail=nothing %>

Gridview Paging


1) include this on your HTML page in Gridview Property:

<asp:GridView ID="gridView" AllowPaging="true" OnPageIndexChanging="gridView_PageIndexChanging" >

2) On .aspx.cs file include this method:

protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gridView.PageIndex = e.NewPageIndex;
gridView.DataBind();
}


NOTE: Page size & Page mode can be set from Gridview Property Window.