Site Meter Asp.Net-Csharp,Asp,Ado.Net,Ado,Micosoft,Visualstudio,Visual webgui: August 2009

Monday, August 24, 2009

Cookies-State,Session-State,Application-State,QueryString

QueryString:

It's one of way to tranfer datas or values from one aspx page to another.Before knowing query string u should know GET method and POST method.
In Get method u can transfer a values but its limited about 256 characters and u can view it in the address bar example: www.abc.com/a.aspx?s=1
In post method its unlimited values transering so better choose POST method in a form tag.
From the address bar url we get values to the another page.

Application State:

It's one of way to tranfer datas or values from one aspx page to another.But the state or values in the memory were stayed till open -(to) close the application.Application in the sense for eg; Browsers.

Cookies:

It's one of way to tranfer datas or values from one aspx page to another.cookies means a small data ie key value pairs were stored in our local systems and it has been accessed by all other aspx pages.But its not good practice because some of systems ie browsers has not support the function of cookies.Because it were disabled.

Session State:

It's one of way to tranfer datas or values from one aspx page to another.When we talk about session there are many types.But basically means maintaning the state of the user. Example:when user logged into certain site for shopping till he log out the id for him is provided automatically intially..By that id we can track the user and maintain his state till logout.

Mail Settings to send a mail in ASP.NET

using System.Net;
using System.Net.Mail;

SmtpClient smtp = new SmtpClient();
MailMessage mail = new MailMessage();
mail.From = new MailAddress("XXX@gmail.com"); // this is your from mail id
smtp.Credentials = new NetworkCredential("URMAILID", "URPWD");
mail.To.Add("XXXr@gmail.com");
mail.Subject = "YourSubject";
mail.Body = "Mail Body";
mail.ReplyTo = mail.From;
mail.Sender = mail.From;
mail.IsBodyHtml = true;
smtp.Port = 587;
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
try
{
smtp.Send(mail);
Response.Write("sucess");
}
catch (Exception ex)
{
//lblerror.Text = ex.Message;
}

What made me to create this blog!!!!!

Hello Friends,

Why iam created this blog mean i struggled a lot in the beginning of my career in the field of web development without knowing some basics things basically iam from ECE department.So i decided to give some of the basics needs to the freshers in web development in Dotnet Domain.