 |
| ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 6th, 2007, 01:27 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hide pagename in url
Hi friends ,
am creating one application in that i want to navigate across multiple pages (around 10 pages)by showing firstpage url(hiding all other pages in url)
if any onee knows pls give rep
Vinod
|
|

August 6th, 2007, 09:55 AM
|
|
Friend of Wrox
|
|
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Use Server.Transfer instead of Response.Redirect. But there are some drawbacks with using Server.Transfer . Search and read those drawbacks before using it.
|
|

August 6th, 2007, 10:23 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Or you can create a single frame frameset in the first page and all navigation afterwards happens within the frame which doesn't affect the address bar.
-Peter
|
|

August 7th, 2007, 12:26 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I agree with Peter, use frameset
Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"
|
|

August 8th, 2007, 12:51 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
|
|
are you people talking about frame tag of HTML?
thanks......
|
|

August 8th, 2007, 08:07 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Yes. You could either create one page with an IFRAME in it or an html FRAMESET with a single FRAME. They'll each function the same.
-Peter
|
|

August 10th, 2007, 02:21 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
|
|
okay well what are its advantages compare to server.tranfer.
thanks......
|
|

August 10th, 2007, 08:43 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Server.Transfer really doesn't make any sense for this because it doesn't do anything from the client perspective. It transfers execution of a page to another page and is invisible to the user.
Let's say that your main page is Default.aspx. Every time the client requests a page they will be hitting Default.aspx. If they want to go to another page (let's say you have a News.aspx page) they click on some link/button. This link/button MUST do a postback in order to execute some server-side to perform a Server.Transfer. So they click the button, you do Server.Transfer and execute the News.aspx page. Now the user is still seeing Default.aspx in the browser. So if there is a button that does something on the news page, the browser is still posting to Default.aspx. You need logic in Default.aspx that knows the user is now on *really* looking at the News.aspx page so you can Server.Transfer (again, and every single time) to the appropriate page.
As you can see the problem is that you are going to have to keep track of what page you really need to run and have all kinds of logic in the "main page" that handles the transferring to all the other pages.
Another problem is that every single link to other pages which could normally be satisfied with a standard hyperlink now has to be server postback. This creates lots of unnecessary round trips just to go to another page.
I think you would find building this a major pain and the difficulty far outweighs the desire to obfuscate the URL, particularly when there are far easier solutions.
I have been build web apps for a long time and I have never found a reason to use Server.Transfer in either classic ASP or ASP.NET.
-Peter
|
|

August 11th, 2007, 12:50 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi if i use server.transfer we can navigate but it is possible only for two pages in my application there are 10 pages how can i pls tell me frnd
Quote:
quote:Originally posted by planoie
Server.Transfer really doesn't make any sense for this because it doesn't do anything from the client perspective. It transfers execution of a page to another page and is invisible to the user.
Let's say that your main page is Default.aspx. Every time the client requests a page they will be hitting Default.aspx. If they want to go to another page (let's say you have a News.aspx page) they click on some link/button. This link/button MUST do a postback in order to execute some server-side to perform a Server.Transfer. So they click the button, you do Server.Transfer and execute the News.aspx page. Now the user is still seeing Default.aspx in the browser. So if there is a button that does something on the news page, the browser is still posting to Default.aspx. You need logic in Default.aspx that knows the user is now on *really* looking at the News.aspx page so you can Server.Transfer (again, and every single time) to the appropriate page.
As you can see the problem is that you are going to have to keep track of what page you really need to run and have all kinds of logic in the "main page" that handles the transferring to all the other pages.
Another problem is that every single link to other pages which could normally be satisfied with a standard hyperlink now has to be server postback. This creates lots of unnecessary round trips just to go to another page.
I think you would find building this a major pain and the difficulty far outweighs the desire to obfuscate the URL, particularly when there are far easier solutions.
I have been build web apps for a long time and I have never found a reason to use Server.Transfer in either classic ASP or ASP.NET.
-Peter
|
Vinod
|
|

August 11th, 2007, 12:53 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
There are seperate pages in my application is der any possibility without using frameset , without using frame set how can we implement this its urgent friend give Rep and also tell me how can i implement FRAMESET
Vinnu
Quote:
quote:Originally posted by planoie
Or you can create a single frame frameset in the first page and all navigation afterwards happens within the frame which doesn't affect the address bar.
-Peter
|
Vinod
|
|
 |