i added some controls in designer file but cs file not accepting those controls, it says textbox1 does not exist in current context. i have tried these solutions: 1) convert to web application 2) recreated both files .aspx and .aspx.cs but it didn't solve my problem ? Any help will be appreciated.
很难分析这种情况....可能是因为容器(如面板)这样尝试
TextBox tb=(TextBox)<"container name">.FindControl("textbox1");
when u are creating a new aspx page make sure u select place code in separate file.if it's ok, then after creating the aspxx file drag and drop a textbox from toolbox's standard option. then check the id of the textbox from property window. use the id like this textbox1.Text
. if you are using html text box then make it runat="server"
and use the id of the textbox.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.