One Clarification

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ss

    #1

    One Clarification

    I have a doubt.
    I have 2 webform W1, W2 with a Button control B1, B2
    respectively.
    In From W1 on click of button B1, i redirect response to
    WebForm W2 along with a querystring value. [w2.aspx?test=c]

    Now, on W2, i get this value using Response.Queyst ring...
    no issues. The issue comes, when i post W2 by clicking on
    Button B2. And the issues is that i can still get the
    querystring value c even though i used "Post" method.

    To this day i used to think that querystring should be
    cleared if the form is posted using "Post". Am i wrong?
    Is it a dot net implementation only? To preserver Query
    String?
  • S. Justin Gengo

    #2
    Re: One Clarification

    ss,

    Yes, this is a new feature of .net

    It used to take a lot of extra coding to keep persisting querystring values
    so microsoft built it in for us.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "ss" <sundeeps@niit. com> wrote in message
    news:0ba301c366 4f$19110060$a60 1280a@phx.gbl.. .[color=blue]
    > I have a doubt.
    > I have 2 webform W1, W2 with a Button control B1, B2
    > respectively.
    > In From W1 on click of button B1, i redirect response to
    > WebForm W2 along with a querystring value. [w2.aspx?test=c]
    >
    > Now, on W2, i get this value using Response.Queyst ring...
    > no issues. The issue comes, when i post W2 by clicking on
    > Button B2. And the issues is that i can still get the
    > querystring value c even though i used "Post" method.
    >
    > To this day i used to think that querystring should be
    > cleared if the form is posted using "Post". Am i wrong?
    > Is it a dot net implementation only? To preserver Query
    > String?[/color]


    Comment

    • Kevin Spencer

      #3
      Re: One Clarification

      ASP.Net uses WebForms, which are a special type of form that has server-side
      event handlers. The event handlers are triggered by a PostBack, which means
      that the form submits back to itself. In order to preserve the state of the
      WebForm between PostBacks, the QueryString (as well as all other elements of
      the WebForm) must also be retained as it was originally. This is done on the
      server.

      --
      HTH,

      Kevin Spencer
      Microsoft MVP
      ..Net Developer
      All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

      Neither a follower nor a lender be.

      "ss" <sundeeps@niit. com> wrote in message
      news:0ba301c366 4f$19110060$a60 1280a@phx.gbl.. .[color=blue]
      > I have a doubt.
      > I have 2 webform W1, W2 with a Button control B1, B2
      > respectively.
      > In From W1 on click of button B1, i redirect response to
      > WebForm W2 along with a querystring value. [w2.aspx?test=c]
      >
      > Now, on W2, i get this value using Response.Queyst ring...
      > no issues. The issue comes, when i post W2 by clicking on
      > Button B2. And the issues is that i can still get the
      > querystring value c even though i used "Post" method.
      >
      > To this day i used to think that querystring should be
      > cleared if the form is posted using "Post". Am i wrong?
      > Is it a dot net implementation only? To preserver Query
      > String?[/color]


      Comment

      Working...