Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am building a web app but results this error when i run it.
i wrote to the page .apsx.designer.cs
protected global::System.Web.UI.HtmlControls.HtmlInputText txt_name;
BUT still give me this error
WHAT TO DO??





Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'txt_name' does not exist in the current context

Source Error:


Line 68: if (!Page.IsPostBack)
Line 69: {
Line 70: txt_name.Disabled = true;
Line 71: txt_surname.Disabled = true;
Line 72: txt_sity.Disabled = true;
Posted

1 solution

Hey Put asp.net Controls of textbox in the aspx page and write runat="Server" property in every textbox
 
Share this answer
 
Comments
lovitaxxxx 7-Dec-12 7:45am    
still gives me the error :/
lovitaxxxx 7-Dec-12 7:46am    
& its very strange cuz in another page aspx.cs, i did the same thing and doesnt give any error
Devang Vaja 7-Dec-12 7:48am    
close visual studio and reopen and make one another page copy same code there
lovitaxxxx 7-Dec-12 7:55am    
still gives the same error :(
Devang Vaja 7-Dec-12 8:01am    
use this protected global::System.Web.UI.WebControls.TextBox txt_name;

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