Hello.
I have an ASP.NET web application in which one page needs to execute another
page and retrieve it's results. The page to be called needs a couple
parameters passed in the URL. However, when I do this, the Server.Execute
fails. From tracing this is because the URL parameters are not properly
being accessed from the called page, so the functions in that page fail
because they are passed invalid parameters. I believe I am formatting my
Server.Execute function improperly. Any ideas? Thanks in advance.
HttpContext.Current.Server.Execute("~/Qstnr/SubmitQstnr.aspx?qId=2&sId=11",
pageResponse);
Ryan TaylorServer.Execute doesn't support query strings, it wants a path to the apx
file you want to create an instance of.
-- bruce (sqlwork.com)
"Ryan Taylor" <rtaylor@.stgeorgeconsulting.com> wrote in message
news:OvPtvCpuEHA.4044@.tk2msftngp13.phx.gbl...
> Hello.
> I have an ASP.NET web application in which one page needs to execute
another
> page and retrieve it's results. The page to be called needs a couple
> parameters passed in the URL. However, when I do this, the Server.Execute
> fails. From tracing this is because the URL parameters are not properly
> being accessed from the called page, so the functions in that page fail
> because they are passed invalid parameters. I believe I am formatting my
> Server.Execute function improperly. Any ideas? Thanks in advance.
>
HttpContext.Current.Server.Execute("~/Qstnr/SubmitQstnr.aspx?qId=2&sId=11",
> pageResponse);
> Ryan Taylor
>
Yeah,
I ended up coming to this conclusion. Server.Execute seems to call the page
within the context of the page it is called in. As such, If the calling page
has the URL parameters that I wanted in the page to be called, then the
called page can retrieve those parameters from the calling page URL.
Thanks.
Ryan
Thursday, March 22, 2012
Server.Execute with parameters does not work
Labels:
anotherpage,
application,
asp,
execute,
net,
page,
parameters,
retrieve,
serverexecute,
web
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment