how do you navigate between virtual sites within a main site

G

Guest

I have a main site www.example.com which has a form.

On the form is 2 command buttons. One button I can to go to testa.aspx and
one button I want to go to testb.aspx.

www.example.com/sitea/testa.aspx

www.example.com/siteb/testb.aspx

What is the syntax for the server.transfer or the linkbutton?

Also in testa.aspx, it has a button that returns back to the main site
www.example.com/test.aspx - What is the syntax for server.transfer or the
link button?

As long as each of these sites are not under different applications or front
page site, do they share the same application / security realm?

Thanks

Eric
 
Y

Yuan Ren[MSFT]

Hi Eric,

Thanks for posting!

From your description, my understanding is that you want to redirect the
request the different page via click the button. If I have misunderstood
anything, please let me know.

As far as I know, you can use Response.Redirect method in the
linkbutton_click event as below:
Response.Redirect("www.example.com/sitea/testa.aspx");
The parameter of the method is the URL for the site.

BTW, the Server.Transfer method is not appropriated if these sites in
different vitrual directories.

"As long as each of these sites are not under different applications or
front page site, do they share the same application / security realm?"
I'm sorry I don't understand the issue very well. Based on my experience,
if the sites in the same vitrual directory in IIS, the security realm will
be shared. If not, they has portion of security by themselves.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
 
G

Guest

Hi Yuan,

What is the difference between server.transfer and Response.Redirect.

In my limited thinking, I thought they were the same...

Thanks for the response.

Thanks

Eric
 
Y

Yuan Ren[MSFT]

Hi Eric,

Thanks for your reply!

The following explanation about these two methods from MSDN document:
HttpResponse.Redirect method:
"Redirects a client to a new URL"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebHttpResponseClassRedirectTopic.asp

HttpServerUtility.Transfer method:
"Terminates execution of the current page and begins execution of a new
page for the current request."
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwebhttpserverutilityclasstransfertopic.asp

Response.Redirect method simply tells the browser to visit another page.
Server.Transfer helps reduce server requests, keeps the URL the same and,
with a little bug-bashing, allows you to transfer the query string and form
variables.

There is an appreciated article gives us more explanation about these two
methods:
http://www.codeguru.com/Csharp/.NET/net_asp/miscellaneous/article.php/c5359/

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 

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
474,261
Messages
2,571,041
Members
48,769
Latest member
Clifft

Latest Threads

Top