I am trying to access the textbox inside button_click method of the user
control. Also when I am setting the textbox value in the Page_load method of
the page, I have tried setting it both inside
if not page.ispostback
end if
and also outside of it. None of them works.
Thanks,
Sridhar.
"Lav KG" wrote:
>
> Sridhar wrote:
> > Hi,
> >
> > I have a user control which has a textbox control and a button. I have
> > created a property to get and set the text box value. In the Page_Load method
> > of the Page that contains the user control, I am setting the textbox value
> > that is inside the user control. When I click the button that is inside the
> > user control and try to access the textbox value it is getting empty string
> > instead of the value set in the Page_Load. I have tried setting
> > EnableViewState explicity but still it is not holding the value. I am not
> > loading the user control dynamically. Please let me know if you have any
> > ideas.
> >
> > Thanks,
> > Sridhar.
>
> Try surrounding your code by following block
>
> if (! IsPostBack)
> {
> // your code.
> }
>
> let's hope it works...
>
>