Re: How to clear parameter out of url

From: John Saunders (johnwsaundersiii_at_notcoldmail.com)
Date: 06/28/04


Date: Sun, 27 Jun 2004 21:24:27 -0400


"moondaddy" <moondaddy@nospam.com> wrote in message
news:%23gq%23M7aWEHA.4092@TK2MSFTNGP11.phx.gbl...
> I'm passing a parameter in the url when I open up a particular page. When
> the page loads and finds this parameter, I know that I need to clear a
> variable out of the session cache and reset it with a new value. On the
> following postbacks I want this variable to remain constant which means I
> need to clear the parameter out of the URL before any of the postbacks
> occur. Otherwise if this parameter is still in the URL when the page
loads
> from a postback, it will clear out the variable again.
>
> is there a way to alter the pages current URL?

If you only need that query parameter the first time you open the page, then
you should only check it on the first request. Use:

If Not Page.IsPostBack Then
    If Request.QueryString("onceonly") = "doThisOnce" Then
        ...
    End If
End If

-- 
John Saunders
johnwsaundersiii at hotmail


Relevant Pages

  • How to clear parameter out of url
    ... I'm passing a parameter in the url when I open up a particular page. ... following postbacks I want this variable to remain constant which means I ... Otherwise if this parameter is still in the URL when the page loads ... is there a way to alter the pages current URL? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Red Continental Attack Platform.
    ... I have to admit that I had a Jock Kerr system on (if I remember ... It made loads of noise but ... The second thing it did was dig a big hole the first time I went round ... the old down tubes were put back on with Dunstall Decibel silencers ...
    (uk.rec.motorcycles)
  • Re: AGB
    ... I'm adding a database (MySQL or MS SQL 2005 Server) which will allow me to put some of the data there and page it out when it's needed. ... As for the home page loading, I need to look at why that is happening other than a possible bottleneck with the net in your area as it loads fairly fast in other locations as it isn't data or image intensive. ... CW, for what it's worth I just tried visiting the site for the first time - it took a _long_ time to load the home page, and did it in several sections. ...
    (alt.guitar.bass)
  • Re: Slow page performance
    ... The first time the page loads the page is compiled so there's lots of stuff ... > This happens every 5th or 6th request for that page. ... the just-in-time compiling, but it doesn't make sense since the code does ...
    (microsoft.public.dotnet.framework.aspnet)
  • problem with multiple forms
    ... events to occur the very first time the Dialog Loads (not sure that's a good ... private void mainForm_OnLoad ... MyDialog dlg = new MyDialog; ... It works fine the first time, however, the second time it stops at the ...
    (microsoft.public.dotnet.framework.compactframework)