Click here to Skip to main content
13,091,300 members (51,408 online)
Rate this:
Please Sign up or sign in to vote.
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

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 7-Dec-12 1:35am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hey Put Controls of textbox in the aspx page and write runat="Server" property in every textbox
Annnaa 7-Dec-12 7:45am
still gives me the error :/
Annnaa 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
Annnaa 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;
Annnaa 7-Dec-12 8:12am
It worked, thnx :)
Devang Vaja 7-Dec-12 8:14am
welcome HappY CoDiNg:)

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100