Server.Execute with parameters does not work

R

Ryan Taylor

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
 
B

bruce barker

Server.Execute doesn't support query strings, it wants a path to the apx
file you want to create an instance of.

-- bruce (sqlwork.com)
 
R

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top