__dopostback issue?

Discussion in 'ASP .Net Web Controls' started by James Radke, Nov 10, 2003.

  1. James Radke

    James Radke Guest

    Hello,

    I was doing some testing on an application we are building, and noticed that
    if you do not have an item like a textbox, which has it's autopostback set
    to true,on a webform page, the javascript code __dopostback will never be
    included in the page. Even if you have multiple active buttons on the web
    page?

    And, if we coded the function ourselves it would not work.

    This threw us off, because we were attempting to include client-side
    validation/javascript to increase performance (i.e. call webservices and
    refresh only items that need to be changed versus refreshing the entire
    page), and then manually call the __dopostback at the times that full page
    refreshes were required (i.e. that meant that autopostback, was never set to
    true).

    Can someone tell me why this is? And if there is some setting we can make
    to make the __dopostback function even if we don't have any controls with
    the autopostback set to true?

    Thanks!

    Jim
     
    James Radke, Nov 10, 2003
    #1
    1. Advertising

  2. James Radke

    Teemu Keiski Guest

    Hi,

    postback script is generated automatically when page has controls that are
    not able to post their values to the form post collection without calling
    that javascript. You can generate postback call by using one of the follwing
    methods:

    Page.GetPostBackEventReference
    Page.GetPostBackClientHyperLink
    Page.GetPostBackClientEvent

    First two are used normally (consult docs for further details). They take
    reference to a control and optional event argument as parameter and return a
    js call to __doPostBack that you can place on the page. Calling these
    methods also ensures Page outputs the JavaScript declaration for
    __doPostBack script.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "James Radke" <> wrote in message
    news:%...
    > Hello,
    >
    > I was doing some testing on an application we are building, and noticed

    that
    > if you do not have an item like a textbox, which has it's autopostback set
    > to true,on a webform page, the javascript code __dopostback will never be
    > included in the page. Even if you have multiple active buttons on the web
    > page?
    >
    > And, if we coded the function ourselves it would not work.
    >
    > This threw us off, because we were attempting to include client-side
    > validation/javascript to increase performance (i.e. call webservices and
    > refresh only items that need to be changed versus refreshing the entire
    > page), and then manually call the __dopostback at the times that full page
    > refreshes were required (i.e. that meant that autopostback, was never set

    to
    > true).
    >
    > Can someone tell me why this is? And if there is some setting we can make
    > to make the __dopostback function even if we don't have any controls with
    > the autopostback set to true?
    >
    > Thanks!
    >
    > Jim
    >
    >
     
    Teemu Keiski, Nov 10, 2003
    #2
    1. Advertising

  3. James Radke

    Teemu Keiski Guest

    Obvious was missing that:
    "postback script is generated automatically when page has controls that are
    not able to post their values
    "

    that these controls do utilize the very same methods and these are controls
    that need to participate postback processing.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Teemu Keiski" <> wrote in message
    news:...
    > Hi,
    >
    > postback script is generated automatically when page has controls that are
    > not able to post their values to the form post collection without calling
    > that javascript. You can generate postback call by using one of the

    follwing
    > methods:
    >
    > Page.GetPostBackEventReference
    > Page.GetPostBackClientHyperLink
    > Page.GetPostBackClientEvent
    >
    > First two are used normally (consult docs for further details). They take
    > reference to a control and optional event argument as parameter and return

    a
    > js call to __doPostBack that you can place on the page. Calling these
    > methods also ensures Page outputs the JavaScript declaration for
    > __doPostBack script.
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    >
    > "James Radke" <> wrote in message
    > news:%...
    > > Hello,
    > >
    > > I was doing some testing on an application we are building, and noticed

    > that
    > > if you do not have an item like a textbox, which has it's autopostback

    set
    > > to true,on a webform page, the javascript code __dopostback will never

    be
    > > included in the page. Even if you have multiple active buttons on the

    web
    > > page?
    > >
    > > And, if we coded the function ourselves it would not work.
    > >
    > > This threw us off, because we were attempting to include client-side
    > > validation/javascript to increase performance (i.e. call webservices and
    > > refresh only items that need to be changed versus refreshing the entire
    > > page), and then manually call the __dopostback at the times that full

    page
    > > refreshes were required (i.e. that meant that autopostback, was never

    set
    > to
    > > true).
    > >
    > > Can someone tell me why this is? And if there is some setting we can

    make
    > > to make the __dopostback function even if we don't have any controls

    with
    > > the autopostback set to true?
    > >
    > > Thanks!
    > >
    > > Jim
    > >
    > >

    >
    >
     
    Teemu Keiski, Nov 10, 2003
    #3
    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. paul reed

    Wierd Behavior of __doPostBack

    paul reed, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    561
    Bassel Tabbara [MSFT]
    Jul 8, 2003
  2. Mike Dunn

    Overriding __doPostBack

    Mike Dunn, Jul 9, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    903
    vMike
    Jul 9, 2003
  3. Hayato Iriumi

    __doPostBack EventArgument

    Hayato Iriumi, Jul 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    729
    Hayato Iriumi
    Jul 22, 2003
  4. E
    Replies:
    3
    Views:
    4,227
    John Saunders
    Jul 31, 2003
  5. Steven Livingstone

    __doPostback method with colons problem

    Steven Livingstone, Aug 4, 2003, in forum: ASP .Net
    Replies:
    15
    Views:
    741
    John Saunders
    Aug 28, 2003
Loading...

Share This Page