Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,


Can anyone know?

how to pass querystring for bind one textbox name from another one page by taking its id only not full username but id is an Identity?

i have login page in that i have textbox called txtusername.....but i have to bind this textbox name to another one page...clear
Posted
Updated 16-Feb-12 19:18pm
v3
Comments
Herman<T>.Instance 13-Feb-12 5:53am    
of course anyone can know. What is your exact problem?
Sudip Saha 13-Feb-12 5:53am    
Your requirement is not clear
sathiyak 13-Feb-12 7:04am    
i have login page in that i have textbox called txtusername.....but i have to bind this textbox name to another one page...clear
CRDave1988 13-Feb-12 7:12am    
u want text which r entered in txtusername(page1) in the textbox(page2) which is in other page?

when second page will be called? immediately after login?
sathiyak 13-Feb-12 7:17am    
no,the textbox name should bind in the next page label....after login immediately...

1 solution

Why you require it in query string??
Simply after login put it in session
like
C#
Session["username"]=txtusername.Text;


and in any page where you want to retrieve use
C#
string username=Session["username"].ToString();



or if you still want to pass as query string
then after login redirect like

C#
Response.Redirect("Page.aspx?uname="+txtusername.Text);


and on Page load of Page.aspx.cs
user

C#
string username=Request.QueryString["uname"].ToString();
 
Share this answer
 
Comments
sathiyak 13-Feb-12 7:16am    
if (Request.QueryString["username"] != null)....after this line the cursor does not go inside ...why...
Syed Salman Raza Zaidi 13-Feb-12 7:46am    
check the name of parameter after .aspx, there you also have to use username

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900