Ask a Question related to ASP.NET General, Design and Development.
-
Jon Sequeira #1
Server.Transfer to ASP.old pages?
Is there a way to redirect from an ASP.NET page to an ASP page without
showing the ASP page's URL in the client's browser?
This works perfectly with an HTML page, for example:
path = "~/cp/test.htm"
Server.Transfer(path, False)
But with an .asp extension, the I get an HttpException, "Error executing
child request for ~/cp/test.asp."
I suppose the ASP.NET page factory is trying to execute the ASP page.
If anyone has suggestions on another way to accomplish this, I'm very
curious.
Thanks.
--Jon
Jon Sequeira Guest
-
Error Server.Transfer / Server.Execute ()
Hi! Any one has Idea, How to use Server.Transfer and Server.Execute, When I tried to use these methods I got an eror: Server object error 'ASP... -
Server.Transfer vs. Server.Execute
i'm using a model, view, control architecture for a group of .asp pages. i can't decide whether to use Server.Transfer or Server.Execute to pass... -
Server.Execute and Server.Transfer not detecting session state
I am setting a session variable, then doing a server.transfer in global.aspx and the page I am going to is saying that session state is not enable... -
Server.Transfer
Using Server.Trasfer the control is shiftewd to the form specified in the parameters of the Server.Transfer. however the URL still contains the... -
Server.Transfer and Authentication
Add <Identity Impersonate=True> in the web.config file. This might solve your problem. Cheers Nitc3 "Raghuvansh" <raghuvansh@yahoo.com>... -
Kevin Spencer #2
Re: Server.Transfer to ASP.old pages?
Try Response.Redirect. Server.Transfer works within the ASP.Net ISAPI, and
can never work with ASP pages. Response.Redirect sends a redirect request to
the browser, which then requests the ASP page appropriately.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
news:u0ESV0xPDHA.1556@TK2MSFTNGP10.phx.gbl...> Is there a way to redirect from an ASP.NET page to an ASP page without
> showing the ASP page's URL in the client's browser?
>
> This works perfectly with an HTML page, for example:
>
> path = "~/cp/test.htm"
> Server.Transfer(path, False)
>
> But with an .asp extension, the I get an HttpException, "Error executing
> child request for ~/cp/test.asp."
>
> I suppose the ASP.NET page factory is trying to execute the ASP page.
>
> If anyone has suggestions on another way to accomplish this, I'm very
> curious.
>
> Thanks.
>
> --Jon
>
>
>
Kevin Spencer Guest
-
Kevin Spencer #3
Re: Server.Transfer to ASP.old pages?
Hi Ted,
I thought so too at first. However, if you look at my second response, I
think you'll agree that I've come up with a solution that should work.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"Ted" <commcorpVERWIJDER@DIThotmail.com> wrote in message
news:3f007938$0$28903$1b62eedf@news.euronet.nl...rewriter,> "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> news:e29AE6yPDHA.2480@tk2msftngp13.phx.gbl...> > Thanks.
> >
> > I'm looking for a way to do it without Response.Redirect-- I'd like the
> > redirect to take place on the server, without the browser seeing the new
> > URL. The intention here is to create a similar effect to an URL> so> URL,> > that site users and search engines are not aware of the second, target>> > which contains a number of query string parameters that I don't wish to
> > expose.
> >
> > Any ideas are appreciated.
> >
> > --Jon
> >
> This is not possible. Also because Server.Redirect in ASP will not accept
> 'new' querystring parameters, only the ones that were sent by the browser
> with the original request are available.
>
> Ted
>
>
Kevin Spencer Guest
-
Jon Sequeira #4
Re: Server.Transfer to ASP.old pages?
This is almost working. It does serve up the desired page, but THAT page is
a bit crippled. Its form doesn't submit properly (the stack trace shops an
HttpException being thrown on System.Web.HttpApplication.MapHttpHandler),
and the served page's CSS is missing.
Do you have any sense of how easily these issues can be dealt with? (In a
pure ASP.NET scheme, I can implement an URL rewriter using an HttpModule and
I think it will be pretty simple. Since these ASP pages need to be rewritten
eventually anyway, I'm considering skipping right to that step.)
Thanks for your input.
--Jon
"Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
news:e7PLnRzPDHA.2460@TK2MSFTNGP10.phx.gbl...WebRequest> Well, there is one way that I can think of. On the server side, you can
> create a WebRequest, which is an HTTP request for a resource. Therewriter,> can request the ASP page, which invokes the ASP ISAPI on the web server to
> handle that request. The HTML Response from that Request can then be
> returned to the browser using Response.Write from the ASP.Net Page class.
>
> HTH,
>
> Kevin Spencer
> Microsoft FrontPage MVP
> Internet Developer
> [url]http://www.takempis.com[/url]
> Big things are made up of
> lots of Little things.
>
> "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> news:e29AE6yPDHA.2480@tk2msftngp13.phx.gbl...> > Thanks.
> >
> > I'm looking for a way to do it without Response.Redirect-- I'd like the
> > redirect to take place on the server, without the browser seeing the new
> > URL. The intention here is to create a similar effect to an URLwithout> so> URL,> > that site users and search engines are not aware of the second, target> and> > which contains a number of query string parameters that I don't wish to
> > expose.
> >
> > Any ideas are appreciated.
> >
> > --Jon
> >
> >
> > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
> > news:#Cby0pyPDHA.1584@TK2MSFTNGP11.phx.gbl...> > > Try Response.Redirect. Server.Transfer works within the ASP.Net ISAPI,> request> > > can never work with ASP pages. Response.Redirect sends a redirect> > to> > > the browser, which then requests the ASP page appropriately.
> > >
> > > HTH,
> > >
> > > Kevin Spencer
> > > Microsoft FrontPage MVP
> > > Internet Developer
> > > [url]http://www.takempis.com[/url]
> > > Big things are made up of
> > > lots of Little things.
> > >
> > > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > > news:u0ESV0xPDHA.1556@TK2MSFTNGP10.phx.gbl...
> > > > Is there a way to redirect from an ASP.NET page to an ASP pagepage.> executing> > > > showing the ASP page's URL in the client's browser?
> > > >
> > > > This works perfectly with an HTML page, for example:
> > > >
> > > > path = "~/cp/test.htm"
> > > > Server.Transfer(path, False)
> > > >
> > > > But with an .asp extension, the I get an HttpException, "Error> > > > child request for ~/cp/test.asp."
> > > >
> > > > I suppose the ASP.NET page factory is trying to execute the ASPvery> > > >
> > > > If anyone has suggestions on another way to accomplish this, I'm>> >> > > > curious.
> > > >
> > > > Thanks.
> > > >
> > > > --Jon
> > > >
> > > >
> > > >
> > >
> > >
> >
>
Jon Sequeira Guest
-
Kevin Spencer #5
Re: Server.Transfer to ASP.old pages?
I see what you mean. I believe this could be fairly easily accomplished, as
you know the path to the requested file, and the path to the current file.
From there, it is a (fairly) simple matter of parsing the string returned in
the Response from the WebRequest, and replacing relative paths with absolute
paths. You should be able to locate and Replace the URLs using Regular
Expressions.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
news:OdkN7l$PDHA.2036@TK2MSFTNGP10.phx.gbl...because> Sorry, my post was a bit confusing. I was doing a test-of-theory by
> referring to an ASP.NET page, to take advantage of the debugger (andsecond> I'm trying to find a solution that won't need to be extensively rewritten
> when the whole site is migrated to ASP.NET).
>
> I think the problem is that for the page to be served correctly via aas> HttpWebRequest, all of the relative links in the served page need to be
> replaced with absolute URLs. Otherwise the page's form won't work, and
> graphics and CSSs and includes can't be found, and so on.
>
> At this point, rewriting the ASP page to be served this way may be nearly"stack> much work as reimplementing it in ASP.NET. Unless I'm missing something.
>
> Regards,
>
> --Jon
>
> "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
> news:ueIv7Q$PDHA.2228@tk2msftngp13.phx.gbl...> > As the ASP page in the browser is pure HTML, I have no idea what you're
> > referring to when you say "a bit crippled" and I have no idea whata> > trace" you're referring to. From your description, the "stack trace" ispage> you're> > stack trace from an ASP.Net application. So I'm at a loss as to what> > describing here.
> >
> > HTH,
> >
> > Kevin Spencer
> > Microsoft FrontPage MVP
> > Internet Developer
> > [url]http://www.takempis.com[/url]
> > Big things are made up of
> > lots of Little things.
> >
> > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > news:eMGkO39PDHA.2768@tk2msftngp13.phx.gbl...> > > This is almost working. It does serve up the desired page, but THATshops> > is> > > a bit crippled. Its form doesn't submit properly (the stack trace(In> an> System.Web.HttpApplication.MapHttpHandler),> > > HttpException being thrown on> > > and the served page's CSS is missing.
> > >
> > > Do you have any sense of how easily these issues can be dealt with?HttpModule> a> > > pure ASP.NET scheme, I can implement an URL rewriter using anlike> can> > and> > rewritten> > > I think it will be pretty simple. Since these ASP pages need to be> > > eventually anyway, I'm considering skipping right to that step.)
> > >
> > > Thanks for your input.
> > >
> > > --Jon
> > >
> > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
> > > news:e7PLnRzPDHA.2460@TK2MSFTNGP10.phx.gbl...
> > > > Well, there is one way that I can think of. On the server side, you> server> > > > create a WebRequest, which is an HTTP request for a resource. The
> > > WebRequest
> > > > can request the ASP page, which invokes the ASP ISAPI on the web> > to> > class.> > > > handle that request. The HTML Response from that Request can then be
> > > > returned to the browser using Response.Write from the ASP.Net Page> > > >
> > > > HTH,
> > > >
> > > > Kevin Spencer
> > > > Microsoft FrontPage MVP
> > > > Internet Developer
> > > > [url]http://www.takempis.com[/url]
> > > > Big things are made up of
> > > > lots of Little things.
> > > >
> > > > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > > > news:e29AE6yPDHA.2480@tk2msftngp13.phx.gbl...
> > > > > Thanks.
> > > > >
> > > > > I'm looking for a way to do it without Response.Redirect-- I'dthe> > the> > > > > redirect to take place on the server, without the browser seeingwish> target> > new> > > > > URL. The intention here is to create a similar effect to an URL
> > > rewriter,
> > > > so
> > > > > that site users and search engines are not aware of the second,> > > > URL,
> > > > > which contains a number of query string parameters that I don'tredirect> > to> > ISAPI,> > > > > expose.
> > > > >
> > > > > Any ideas are appreciated.
> > > > >
> > > > > --Jon
> > > > >
> > > > >
> > > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
> > > > > news:#Cby0pyPDHA.1584@TK2MSFTNGP11.phx.gbl...
> > > > > > Try Response.Redirect. Server.Transfer works within the ASP.Net> > > > and
> > > > > > can never work with ASP pages. Response.Redirect sends aASP> > > > request
> > > > > to
> > > > > > the browser, which then requests the ASP page appropriately.
> > > > > >
> > > > > > HTH,
> > > > > >
> > > > > > Kevin Spencer
> > > > > > Microsoft FrontPage MVP
> > > > > > Internet Developer
> > > > > > [url]http://www.takempis.com[/url]
> > > > > > Big things are made up of
> > > > > > lots of Little things.
> > > > > >
> > > > > > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > > > > > news:u0ESV0xPDHA.1556@TK2MSFTNGP10.phx.gbl...
> > > > > > > Is there a way to redirect from an ASP.NET page to an ASP page
> > > without
> > > > > > > showing the ASP page's URL in the client's browser?
> > > > > > >
> > > > > > > This works perfectly with an HTML page, for example:
> > > > > > >
> > > > > > > path = "~/cp/test.htm"
> > > > > > > Server.Transfer(path, False)
> > > > > > >
> > > > > > > But with an .asp extension, the I get an HttpException, "Error
> > > > executing
> > > > > > > child request for ~/cp/test.asp."
> > > > > > >
> > > > > > > I suppose the ASP.NET page factory is trying to execute theI'm> > > page.
> > > > > > >
> > > > > > > If anyone has suggestions on another way to accomplish this,>> >> > > very
> > > > > > > curious.
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > > --Jon
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Kevin Spencer Guest
-
Jon Sequeira #6
Re: Server.Transfer to ASP.old pages?
Thanks. This should definitely work.
I appreciate your help.
--Jon
"Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
news:Ob#MLdAQDHA.2228@tk2msftngp13.phx.gbl...as> I see what you mean. I believe this could be fairly easily accomplished,in> you know the path to the requested file, and the path to the current file.
> From there, it is a (fairly) simple matter of parsing the string returnedabsolute> the Response from the WebRequest, and replacing relative paths withrewritten> paths. You should be able to locate and Replace the URLs using Regular
> Expressions.
>
> HTH,
>
> Kevin Spencer
> Microsoft FrontPage MVP
> Internet Developer
> [url]http://www.takempis.com[/url]
> Big things are made up of
> lots of Little things.
>
> "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> news:OdkN7l$PDHA.2036@TK2MSFTNGP10.phx.gbl...> because> > Sorry, my post was a bit confusing. I was doing a test-of-theory by
> > referring to an ASP.NET page, to take advantage of the debugger (and> > I'm trying to find a solution that won't need to be extensivelynearly> second> > when the whole site is migrated to ASP.NET).
> >
> > I think the problem is that for the page to be served correctly via a> > HttpWebRequest, all of the relative links in the served page need to be
> > replaced with absolute URLs. Otherwise the page's form won't work, and
> > graphics and CSSs and includes can't be found, and so on.
> >
> > At this point, rewriting the ASP page to be served this way may beyou're> as> > much work as reimplementing it in ASP.NET. Unless I'm missing something.
> >
> > Regards,
> >
> > --Jon
> >
> > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
> > news:ueIv7Q$PDHA.2228@tk2msftngp13.phx.gbl...> > > As the ASP page in the browser is pure HTML, I have no idea whatis> "stack> > > referring to when you say "a bit crippled" and I have no idea what> > > trace" you're referring to. From your description, the "stack trace"you> a> page> > you're> > > stack trace from an ASP.Net application. So I'm at a loss as to what> > > describing here.
> > >
> > > HTH,
> > >
> > > Kevin Spencer
> > > Microsoft FrontPage MVP
> > > Internet Developer
> > > [url]http://www.takempis.com[/url]
> > > Big things are made up of
> > > lots of Little things.
> > >
> > > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > > news:eMGkO39PDHA.2768@tk2msftngp13.phx.gbl...
> > > > This is almost working. It does serve up the desired page, but THAT> shops> > > is
> > > > a bit crippled. Its form doesn't submit properly (the stack trace> (In> > an> > System.Web.HttpApplication.MapHttpHandler),> > > > HttpException being thrown on> > > > and the served page's CSS is missing.
> > > >
> > > > Do you have any sense of how easily these issues can be dealt with?> HttpModule> > a> > > > pure ASP.NET scheme, I can implement an URL rewriter using an> > > and
> > > > I think it will be pretty simple. Since these ASP pages need to be
> > > rewritten
> > > > eventually anyway, I'm considering skipping right to that step.)
> > > >
> > > > Thanks for your input.
> > > >
> > > > --Jon
> > > >
> > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
> > > > news:e7PLnRzPDHA.2460@TK2MSFTNGP10.phx.gbl...
> > > > > Well, there is one way that I can think of. On the server side,be> > can> > server> > > > > create a WebRequest, which is an HTTP request for a resource. The
> > > > WebRequest
> > > > > can request the ASP page, which invokes the ASP ISAPI on the web> > > to
> > > > > handle that request. The HTML Response from that Request can thenmessage> like> > > > > returned to the browser using Response.Write from the ASP.Net Page
> > > class.
> > > > >
> > > > > HTH,
> > > > >
> > > > > Kevin Spencer
> > > > > Microsoft FrontPage MVP
> > > > > Internet Developer
> > > > > [url]http://www.takempis.com[/url]
> > > > > Big things are made up of
> > > > > lots of Little things.
> > > > >
> > > > > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > > > > news:e29AE6yPDHA.2480@tk2msftngp13.phx.gbl...
> > > > > > Thanks.
> > > > > >
> > > > > > I'm looking for a way to do it without Response.Redirect-- I'd> the> > > the
> > > > > > redirect to take place on the server, without the browser seeing> wish> > target> > > new
> > > > > > URL. The intention here is to create a similar effect to an URL
> > > > rewriter,
> > > > > so
> > > > > > that site users and search engines are not aware of the second,> > > > > URL,
> > > > > > which contains a number of query string parameters that I don't> > > to
> > > > > > expose.
> > > > > >
> > > > > > Any ideas are appreciated.
> > > > > >
> > > > > > --Jon
> > > > > >
> > > > > >
> > > > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote inASP.Net> > > > > > news:#Cby0pyPDHA.1584@TK2MSFTNGP11.phx.gbl...
> > > > > > > Try Response.Redirect. Server.Transfer works within thepage> redirect> > > ISAPI,
> > > > > and
> > > > > > > can never work with ASP pages. Response.Redirect sends a> > > > > request
> > > > > > to
> > > > > > > the browser, which then requests the ASP page appropriately.
> > > > > > >
> > > > > > > HTH,
> > > > > > >
> > > > > > > Kevin Spencer
> > > > > > > Microsoft FrontPage MVP
> > > > > > > Internet Developer
> > > > > > > [url]http://www.takempis.com[/url]
> > > > > > > Big things are made up of
> > > > > > > lots of Little things.
> > > > > > >
> > > > > > > "Jon Sequeira" <jsequeir@twcny.rr.com> wrote in message
> > > > > > > news:u0ESV0xPDHA.1556@TK2MSFTNGP10.phx.gbl...
> > > > > > > > Is there a way to redirect from an ASP.NET page to an ASP"Error> > > > without
> > > > > > > > showing the ASP page's URL in the client's browser?
> > > > > > > >
> > > > > > > > This works perfectly with an HTML page, for example:
> > > > > > > >
> > > > > > > > path = "~/cp/test.htm"
> > > > > > > > Server.Transfer(path, False)
> > > > > > > >
> > > > > > > > But with an .asp extension, the I get an HttpException,> ASP> > > > > executing
> > > > > > > > child request for ~/cp/test.asp."
> > > > > > > >
> > > > > > > > I suppose the ASP.NET page factory is trying to execute the> I'm> > > > page.
> > > > > > > >
> > > > > > > > If anyone has suggestions on another way to accomplish this,>> >> > > > very
> > > > > > > > curious.
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > > > --Jon
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Jon Sequeira Guest



Reply With Quote

