on_click of Button

S

Stephen Noronha

Hi,

I have a textbox and couple of validators and a button. I have to click 2
times in order to do something.
first time it just flashes and the next time it acually works.
I have observed this recently.

Please advice,
Stephen
 
S

Stephen Noronha

Yes Darren,

sorry about that, it does post back but does nothing and if i click again it
works? I have a number of validation controls...
does it have to do anything with that?

Thanks,
Stephen
 
D

Darren Kopp

It depends on where the validation is happening. If it is happening on
the clientside, then the page shouldn't post back if it is not valid.
What are you trying to do with in your On_Click handler? (ie add items
to viewstate/session).

I had a problem once where I had something happening similar where I
was putting items into the Session and then I had a function that would
load all the items from session each time the page loaded.

What I did once I realized that it would try to bind to late, was I had
to do all my binding to the grid in the On_Click as opposed to the
Page_Load because the controls would get their data from the view state
and such before the Page_Load would happen.

I don't know if this might be a problem that you are having, but you
might want to look at the page life cycle.
http://msdn.microsoft.com/library/d...guide/html/cpconcontrolexecutionlifecycle.asp

-Darren Kopp
http://blog.secudocs.com/
 
S

Stephen Noronha

Thanks Darren for your feedback.

I am trying server side validation as there are a couple of scenarios and I
am enabling them according to situation, I think there is a empty post back
and then the next time its posting

Will look into the article,
Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top