AutoPostback

G

Guest

Hi,

If a control has autopostback set to true does that mean when the control
losses focus then the page will postback again? A submit button will do the
same thing as a control, lets say for interest sake a datalist control with
autopostback set to true, both of these controls are causing a page postback
correct?

Thanks,

JJ
 
K

Kumar Reddi

It depends on the control type. Lets say for a dropdown list, it postbacks
on "onChange" clientside event, for a radiobutton, it postbacks on "onClick"
client side events. So, basically you need to check the event on which they
have the following client script added. These control which have this
autopostback property set to true, execute the following javascript code to
do postback.

"__doPostBack('ctrlID','')"

lets say for a texhbox, it looks as follows

<input name="TextBox1" type="text" onchange="__doPostBack('TextBox1','')"
language="javascript" id="TextBox1" />

So, for a textbox , onchange event causes postback

HTH
 
G

Guest

Hi Kumar,

In my web page would it be better to do a postback when a particular
section in my form is done or should I do just one postback after the whole
form is done that includes a datagrid? Or should I have the datagrid do an
autopostback after something has been changed for the Datagrid? I am trying
to get a feel for when postbacks should be done so as to minimize postbacks
for performance reasons.

Thanks,

JJ
 
K

Kumar Reddi

Hmm it depends on your needs. Would it make sense to cause one big postback,
that might be slower than 10 small postbacks, which might be irritating. So
its your preference. but the normal usage is to do one single postback
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top