Hello Sir,
I want to send an email with the confirmation code when the user first registers to the site. How to attach random number with email? How to compare it when user enters sent code???plz reply....i m new to asp.net.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 17, 2012, 10:12 PM EDT
For starting user session, you can do something like below -
On Login Page
if(loginSuccess)
{
Session["Admin"] = true;
}
else
{
Session["Admin"] = false;
}
On Logout Page
if(logOut)
{
Session["Admin"] = false;
}
ON all pages check below -
if(Session["Admin"] = true)
{
//Show Page Content
}
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 12, 2012, 12:55 AM EDT
Punita73 reputationPosted Oct 12, 2012, 5:36 PM EDT
Thanks for ur reply, but i m not getting the things properly plz explain me in detail....
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 12, 2012, 11:02 PM EDT
Punita73 reputationPosted Oct 12, 2012, 11:55 PM EDT
I am trying to solve this thing in way like this, I am sending the user random number by mail and user have to type that code in the form. I want the user to get registered(entry in database) when the code entered by him get matched else not. For that I have to check the code in the same page...but i want to check it in the next page. How to handle the data entry? I am developing it in 3 tier approach.
public partial class NewUser : System.Web.UI.Page
By ur way i m not getting the thing how to manage the query string and all.....:)
Suggest me the right way...
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 13, 2012, 12:19 AM EDT
1. I do not see any place where you're saving the user Info to database.
2. I understand that you are having the Confirm and Continue buttons on the same page where user registers.
3. I am commenting few sections in code below. Please read for better implementation.
//In the above line, you are sending just the GUID to the user as confirmation code. No problems. But you are storing this GUID as a global variable that may be either static or shared by every object in your ASP.Net page. Thus, if 2 users are registering on your page, you're not sure which confirmation code belongs to which user. Therefore, as I mentioned earlier, please store the user info in database as well as this Confirmation code with the userID generated by database. Instead of sending the ConfirmationCode, send the below line :
string Body = "Welcome to our site! " + txt_UserName.Text + " ,click on the below link ot confirm
mail.Body = Body;
Put the below code in Page_load on a different page (Confirm.aspx) as present in link. The page name you are sending in link and this page name should match.
var code=Request.QueryString["code"];
//Validate from DB here with these details.
Punita73 reputationPosted Oct 13, 2012, 3:03 AM EDT
For this I have to host my site na?? I have not hosted my site, then??
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 13, 2012, 4:17 AM EDT
Punita73 reputationPosted Oct 13, 2012, 8:49 AM EDT
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 13, 2012, 11:34 PM EDT
Punita73 reputationPosted Oct 17, 2012, 8:30 PM EDT
How to start the session when the user logs in? How to end it??
How to get the active user detail??
plz reply me.....
Punita73 reputationPosted Oct 17, 2012, 8:41 PM EDT
How to use ASP.NET Configuration for admin section....plz give me detail info how to use it.,
Nitiesh Bargav5 reputationPosted Aug 28, 2015, 6:49 AM EDT