Connecting Tech Pros Worldwide Forums | Help | Site Map

Change url of supplied page without doing a redirect?

Martin
Guest
 
Posts: n/a
#1: Nov 18 '05
I know this might seem like an odd question.

I've got a page that has a few url parameters. There's a couple of modes
the page can be entered in, with correspondingly different urls params.

Once on the page, typically the user causes a post back to occur. I then
want the url to reflect the new mode of the page. Right now I am doing that
with a redirect to the same page, but with different url parameters, however
this is inefficient in terms of request processing.

Really I want to serve up the page in response to the postback event, but to
change the url associated with that page. If this is possible, I guess it's
an http protocol issue.

Anyone?
Thanks
Martin



Martin
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Change url of supplied page without doing a redirect?


Ah - HTTP Header Content-Location looks promising.

"Martin" <x@y.z> wrote in message
news:eCntIXVVEHA.2988@TK2MSFTNGP10.phx.gbl...[color=blue]
> I know this might seem like an odd question.
>
> I've got a page that has a few url parameters. There's a couple of modes
> the page can be entered in, with correspondingly different urls params.
>
> Once on the page, typically the user causes a post back to occur. I then
> want the url to reflect the new mode of the page. Right now I am doing[/color]
that[color=blue]
> with a redirect to the same page, but with different url parameters,[/color]
however[color=blue]
> this is inefficient in terms of request processing.
>
> Really I want to serve up the page in response to the postback event, but[/color]
to[color=blue]
> change the url associated with that page. If this is possible, I guess[/color]
it's[color=blue]
> an http protocol issue.
>
> Anyone?
> Thanks
> Martin
>
>[/color]


Martin
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Change url of supplied page without doing a redirect?


Hmm, that didn't have the desired effect. The browser (IE6) still displays
the requested url string.

rfc2616 says:
"The Content-Location value is not a replacement for the original
requested URI; it is only a statement of the location of the resource
corresponding to this particular entity at the time of the request.
Future requests MAY specify the Content-Location URI as the request-
URI if the desire is to identify the source of that particular
entity."

Looks like I'm out of luck unless someone says otherwise......

Martin


moondaddy
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Change url of supplied page without doing a redirect?


Here's the content of a response I got from making a similar post.





Hi Moondaddy,

From your description, one of your ASP.NET web page will checking a certain
querystring parameter in the requested url and do some session operations
depending on the parameter value. And currently you want to remove the
certain parameter from the request url if it exist in the first request, so
that the following postback request won't do the duplicated operations on
the session ,yes?

As far as I know, the QueryString collection of the Request object are not
modifiable by user, and I think you can consider the following means:
1.Still let the querystring param remain in the url and use the
Page.IsPostBack property to check whether its the first time loaded or post
back request so as to determine whether to do the session modification or
not.

2. User Server.Transfer or response.Redirect to reload the current page
with the non-querystring url. But this will reduce the performance.

Please have a consider on the above things. If you have any other different
ideas, please also feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx







--
moondaddy@nospam.com
"Martin" <x@y.z> wrote in message
news:eCntIXVVEHA.2988@TK2MSFTNGP10.phx.gbl...[color=blue]
> I know this might seem like an odd question.
>
> I've got a page that has a few url parameters. There's a couple of modes
> the page can be entered in, with correspondingly different urls params.
>
> Once on the page, typically the user causes a post back to occur. I then
> want the url to reflect the new mode of the page. Right now I am doing[/color]
that[color=blue]
> with a redirect to the same page, but with different url parameters,[/color]
however[color=blue]
> this is inefficient in terms of request processing.
>
> Really I want to serve up the page in response to the postback event, but[/color]
to[color=blue]
> change the url associated with that page. If this is possible, I guess[/color]
it's[color=blue]
> an http protocol issue.
>
> Anyone?
> Thanks
> Martin
>
>[/color]


Martin
Guest
 
Posts: n/a
#5: Nov 18 '05

re: Change url of supplied page without doing a redirect?


Hi Moondaddy,

Thanks for that. I would use post instead of get, but posting from another
page seems problematic in ASP.Net 1.x. I guess the other option is session
vars, but it really shouldn't have to be. I think cross posting *asp.net*
forms is something that is facilitated in asp.net2.0

What solution are you working with at present?

Martin

"moondaddy" <moondaddy@nospam.com> wrote in message
news:eImO4EfWEHA.1000@TK2MSFTNGP12.phx.gbl...[color=blue]
> Here's the content of a response I got from making a similar post.
>
>
>
>
>
> Hi Moondaddy,
>
> From your description, one of your ASP.NET web page will checking a[/color]
certain[color=blue]
> querystring parameter in the requested url and do some session operations
> depending on the parameter value. And currently you want to remove the
> certain parameter from the request url if it exist in the first request,[/color]
so[color=blue]
> that the following postback request won't do the duplicated operations on
> the session ,yes?
>
> As far as I know, the QueryString collection of the Request object are not
> modifiable by user, and I think you can consider the following means:
> 1.Still let the querystring param remain in the url and use the
> Page.IsPostBack property to check whether its the first time loaded or[/color]
post[color=blue]
> back request so as to determine whether to do the session modification or
> not.
>
> 2. User Server.Transfer or response.Redirect to reload the current page
> with the non-querystring url. But this will reduce the performance.
>
> Please have a consider on the above things. If you have any other[/color]
different[color=blue]
> ideas, please also feel free to post here. Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
>
>
>
>
>
>
> --
> moondaddy@nospam.com
> "Martin" <x@y.z> wrote in message
> news:eCntIXVVEHA.2988@TK2MSFTNGP10.phx.gbl...[color=green]
> > I know this might seem like an odd question.
> >
> > I've got a page that has a few url parameters. There's a couple of[/color][/color]
modes[color=blue][color=green]
> > the page can be entered in, with correspondingly different urls params.
> >
> > Once on the page, typically the user causes a post back to occur. I[/color][/color]
then[color=blue][color=green]
> > want the url to reflect the new mode of the page. Right now I am doing[/color]
> that[color=green]
> > with a redirect to the same page, but with different url parameters,[/color]
> however[color=green]
> > this is inefficient in terms of request processing.
> >
> > Really I want to serve up the page in response to the postback event,[/color][/color]
but[color=blue]
> to[color=green]
> > change the url associated with that page. If this is possible, I guess[/color]
> it's[color=green]
> > an http protocol issue.
> >
> > Anyone?
> > Thanks
> > Martin
> >
> >[/color]
>
>[/color]


Closed Thread