thuaso
thuaso

Reputation: 1095

how to load aspx files programmatically?

I am new to web development. I have 2 .aspx files and in default page I want to open other page programmatically. how can I do that?

Upvotes: 1

Views: 1781

Answers (3)

kemiller2002
kemiller2002

Reputation: 115430

There are two you can use Response.Redirect and Server.Transfer. Response.Redirect forces the browser to load a new page a new URL, while Server.Transfer changes the paged being loaded on the server.

Here is an article on the two:

http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=15

MSDN Response.Redirect:

http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirect.aspx

MSDN Server.Transfer:

http://msdn.microsoft.com/en-us/library/ms525800.aspx

Upvotes: 4

Paul Creasey
Paul Creasey

Reputation: 28824

It's unclear what you are looking for but at a guess you should be using user control (.ascx) and rendering them on the page.

Upvotes: 0

ChrisF
ChrisF

Reputation: 137128

You need to use the Response.Redirect method:

The following example shows you how to use the VBScript programming language to redirect the user to a virtual directory on the same IIS server.

<% Response.Redirect "/samples/asp/newpage.asp" %> 

Upvotes: 4

Related Questions