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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitesh KejriwalPosted Oct 18, 2012, 2:12 AM
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
}
Nitiesh BargavPosted Aug 28, 2015, 10:49 AM
PunitaPosted Oct 18, 2012, 12:41 AM
How to use ASP.NET Configuration for admin section....plz give me detail info how to use it.,
PunitaPosted Oct 18, 2012, 12:30 AM
How to start the session when the user logs in? How to end it??
How to get the active user detail??
plz reply me.....
Nitesh KejriwalPosted Oct 14, 2012, 3:34 AM
PunitaPosted Oct 13, 2012, 12:49 PM
Nitesh KejriwalPosted Oct 13, 2012, 8:17 AM
PunitaPosted Oct 13, 2012, 7:03 AM
For this I have to host my site na?? I have not hosted my site, then??
Nitesh KejriwalPosted Oct 13, 2012, 4:19 AM
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.
PunitaPosted Oct 13, 2012, 3:55 AM
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 KejriwalPosted Oct 13, 2012, 3:02 AM
PunitaPosted Oct 12, 2012, 9:36 PM
Thanks for ur reply, but i m not getting the things properly plz explain me in detail....
Nitesh KejriwalPosted Oct 12, 2012, 4:55 AM