简体   繁体   中英

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?

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" %> 

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

目前尚不清楚您要查找的内容,但是您应该猜测是应该使用用户控件(.ascx)并将其呈现在页面上。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM