AutoPostback

Discussion in 'ASP .Net' started by =?Utf-8?B?Sko=?=, Dec 9, 2004.

  1. 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
    =?Utf-8?B?Sko=?=, Dec 9, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?Sko=?=

    Kumar Reddi Guest

    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

    --
    Kumar Reddi
    http://kumarreddi.blogspot.com

    "JJ" <> wrote in message
    news:...
    > 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
    Kumar Reddi, Dec 9, 2004
    #2
    1. Advertising

  3. 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

    "Kumar Reddi" wrote:

    > 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
    >
    > --
    > Kumar Reddi
    > http://kumarreddi.blogspot.com
    >
    > "JJ" <> wrote in message
    > news:...
    > > 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

    >
    >
    >
    =?Utf-8?B?Sko=?=, Dec 9, 2004
    #3
  4. =?Utf-8?B?Sko=?=

    Kumar Reddi Guest

    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
    --
    Kumar Reddi
    http://kumarreddi.blogspot.com

    "JJ" <> wrote in message
    news:...
    > 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
    >
    > "Kumar Reddi" wrote:
    >
    > > 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
    > >
    > > --
    > > Kumar Reddi
    > > http://kumarreddi.blogspot.com
    > >
    > > "JJ" <> wrote in message
    > > news:...
    > > > 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

    > >
    > >
    > >
    Kumar Reddi, Dec 9, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi

    Can NOt AutoPostBack for two DDL

    huobazi, Jul 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    493
    huobazi
    Jul 2, 2003
  2. huobazi
    Replies:
    1
    Views:
    666
    David Waz...
    Jul 3, 2003
  3. Mira Vizjak

    AutoPostBack

    Mira Vizjak, Jul 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    478
    Mira Vizjak
    Jul 14, 2003
  4. Jesse

    Problem with Autopostback

    Jesse, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    454
    Jesse
    Jul 17, 2003
  5. Domien Holthof

    AutoPostBack question.

    Domien Holthof, Jul 17, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    430
    Marina
    Jul 17, 2003
Loading...

Share This Page