how to code for this scenario

Posted by Parthibansk under ASP.NET on 11/8/2013 | Points: 10 | Views : 690 | Status : [Member] | Replies : 2
i have registration form..
once user reg ll be redirected to referal page with refname,email,phoneno with user's name,email captured from the 1st page..

captured users details from 1st page using querystring and now i have to fill referal fields max 5[not mandatory].. how to validate referal values[totally 15 fields] and insert into database...




Responses

Posted by: vishalneeraj-24503 on: 11/8/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi, you can do the following things in btn_login event

In the 1st page
protected void btn_login()
{
string username = txt_user_name.text.trim();
string useremail = txt_user_email.text.trim();

if(username !=string.empty && useremail !=string.empty)
{
response.redirect("abc.aspx?name='"& username &"',email='"& useremail &"'");
}
}

In the 2nd page
on page load check
if (request.queryString["name"] != null) && request.QueryString["email"] != null)
{
string username = convert.tostring(request.queryString["name"]);
string useremail = convert.tostring(request.queryString["email"]);

//then here you can fire sql query to get all information of user as
select * from tbl_name where name = '"& username &"' and status = "AA";
with the help of datareader fetch all values and assign them into your controls
}
else
{
//show message box that says username or email is null
exit
}

Hope this helps.

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 11/8/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Which control are you using for referal fields?

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response