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()
精彩评论