how to use _doPostback

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sudhaMurugesan
    New Member
    • May 2007
    • 94

    how to use _doPostback

    Hi,
    I need to call some serverside events or page load event by _doPostBack in javascript. How to use it to call page load event can anyone tell me please...
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by sudhaMurugesan
    Hi,
    I need to call some serverside events or page load event by _doPostBack in javascript. How to use it to call page load event can anyone tell me please...
    Server Side event and Page load event is two different things.
    Page load event executes at Client Side and Server Side Events execute obviously at Server Side.
    Here the picture is not clear.
    What did you mean send a sample code and problems.

    Debasis Jana

    Comment

    • sudhaMurugesan
      New Member
      • May 2007
      • 94

      #3
      Originally posted by dmjpro
      Server Side event and Page load event is two different things.
      Page load event executes at Client Side and Server Side Events execute obviously at Server Side.
      Here the picture is not clear.
      What did you mean send a sample code and problems.

      Debasis Jana
      Hi jana,
      Thank u for ur reply.when i click save button, it must show a confirm box. if returned value is true my page must do postBack. sample code
      [CODE=javascript]//js
      function confirm()
      {
      var result = confirm('Sure') ;
      if(result)
      {
      __doPostBack('b tnSave','OnClic k');
      }
      }
      //sample.aspx.cs
      protected void Page_Load(objec t sender, EventArgs e)
      {
      .
      .
      }

      protected void btnSave_Click(o bject sender, EventArgs e)
      {

      }[/CODE]

      the _doPostBack must call either this btnSave_click event or Page_Load event.
      Sorry for late reply...
      Last edited by acoder; Jan 11 '08, 11:47 AM. Reason: Added code tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        As a full member now, you should know that we expect your code to be posted in [CODE] tags (See How to Ask a Question).

        This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

        Please use the tags in future.

        MODERATOR.

        I'm moving this to the .NET forum as this is obviously a .NET problem.

        Comment

        Working...