Greg,
Apparently you are setting up the controls in Page_Load event. You need
someone to tell you that the button was clicked. One of the ways is to
introduce a hidden input element and set it on client side when the button
is clicked. You can access the hidden field in the Page_Load.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Greg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a button on my form that I am using to allow the user to
> validate the contents of a certain textbox.
> Depending on the results of the validation, I need to change the
> backcolour of the text box and make a call to the database, and
> populate several controls with the result from this call to the
> database.
> However, since the click event is fired too late in the page cycle, it
> is too late for the changes made to the controls to actually appear on
> the form - these changes will only appear the next time a postback
> occurs.
>
> What is the best solution to this? Force another postback once I have
> received data from the database, or to do some Javascript work to
> change the values from the client side ( I assume this is possible,
> but correct me if I'm wrong!).
>
> Regards,
>
> Greg.
>