Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i pass my values in e-mail activation link?
    primarykey
    data
    text
    <p>I wrote some codes in deneme.aspx it works but it does not pass the variables(Id(levent) and userName(levent)) to activateUser.aspx. how can i do it?</p> <pre><code> SmtpClient SmtpServer = new SmtpClient("smtp.live.com"); var mail = new MailMessage(); mail.From = new MailAddress("bilkentliaslan@windowslive.com"); mail.To.Add("levent_kalay@hotmail.com"); mail.Subject = "Test Mail - 1"; mail.IsBodyHtml = true; string htmlBody; htmlBody = string.Format("&lt;a href='http://localhost:15534/ActivateUser.aspx?userName{0}&amp;Id={1}'&gt;Activate {0} &lt;/a&gt;", "levent", "levent"); mail.Body = htmlBody; SmtpServer.Port = 587; SmtpServer.UseDefaultCredentials = false; SmtpServer.Credentials = new System.Net.NetworkCredential("bilkentliaslan@windowslive.com", "mypassword"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); </code></pre> <p>Then, After clicking the confirmation link, It goes to ActivateUser.aspx in there</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.Params["Id"])) { // We do not have the userId. Redirect some where Response.Redirect("login.aspx"); } else { // We have a userId. try { DBConnection db = new DBConnection(); string username= Request.Params["userName"]; bool res = db.CheckLogin(Request.Params["userName"],Request.Params["Id"]); if (res) { Session["LetLogin"] = "ok"; Session["User_Name"] = Request.Params["userName"]; Response.Redirect("WebForm4.aspx",true); } } catch { // Error. Redirect some where Response.Redirect("login.aspx"); } } // We should never reach here. Just in case redirect some where Response.Redirect("login.aspx", true); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload