开发者

TextBox or Upload File losing value on post back

开发者 https://www.devze.com 2023-03-25 16:25 出处:网络
I have a user control that will render a textbox or file upload. I have a web page in which im rendering this user control + a button that 开发者_运维技巧will submit the form.

I have a user control that will render a textbox or file upload. I have a web page in which im rendering this user control + a button that 开发者_运维技巧will submit the form. on code behind.whem im trying to get the value of my textbox im getting "Object reference not set to an instance of an object", this is because im losing my user control on post back, any idea how can i solve this ? thanks alot

EDIT: <asp:UpdatePanel ID="ResourceEditorUpdatePanel" runat="server" /> and at run time am creating my user control and adding to the updatepanel/panel controls


use updatepanel of AJAX, i hope i will reduce most of problem.


All i have to do was to set

EnableViewState

Value =true while creating the user control, and in my user control i forgot to put the

ensureChildcontrols() method on OnLoad()

0

精彩评论

暂无评论...
验证码 换一张
取 消