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:
HTML
cmd = new SqlCommand("select User_ID from login where User_ID='" + txt_userid.Text + "'", con);



in this textbox id is txt_userid have on design page but probelm is txt_userid does not exist in the current context

please help me,

i want correct solution.
Posted
Comments
Thanks7872 26-Sep-13 4:02am    
Post the code where txt_userid is placed.is it inside any control?
Er Daljeet Singh 26-Sep-13 4:22am    
Provide the whole code file where you are getting error both file Code/Design.Other wise just restart your Visual Studio and try again.
Dholakiya Ankit 26-Sep-13 6:11am    
Put your design content
Harshil_Raval 26-Sep-13 7:13am    
Hi, i think you are trying to use this textbox in some static function. That's why you are not able to access textbox.

If you are not using the textbox from codebehind,
it will not allow you to access it form other classes cause its default modifier is private.
so if you are using textbox not form codebehind try...

Change TextBox Modifier from Private to Public
 
Share this answer
 
did you use this textbox direct from ASP.Net codebehind or any other class. Actually the scenario is not clear to me. Please describe it with your code.
 
Share this answer
 

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