Asked by:
Same URL for every page in ASP.NET

Question
-
User1765954050 posted
I have multiple pages in my application, if I navigate through pages the URL changes accordingly, What I want is that whenever I navigate to any page the URL should not change, it should stay same doesn't matter which page I visit.<br>
<br>
I tried URL Mapping in web.config but it is not working. it's loosing all css also since I want same url for all pages it's not letting me do it.<br>
<br>
Thanks.Wednesday, September 5, 2018 7:52 PM
All replies
-
User475983607 posted
This is an old school technique used in the late 90s early 2000s that used an iframe as the target of a hyperlink.
Wednesday, September 5, 2018 8:09 PM -
User1765954050 posted
Thank you for your reply.
Can we achieve this without using iframe ? Is there any option in iis ?Thursday, September 6, 2018 3:31 AM -
User1724605321 posted
Hi smtaqi,
I'm not sure i understand your requirement , it seems you need one common URL for different resources/page . Could you please explain what problem you want to solve with that ?
Best Regards,
Nan Yu
Thursday, September 6, 2018 7:03 AM -
User475983607 posted
Is there any option in iis ?No, IIS is too late.
Can we achieve this without using iframe ?Use JavaScript. Look into building a Single Page Application.
Thursday, September 6, 2018 10:41 AM -
User1765954050 posted
Ok I used IFrame and it's working fine now.
But there is one issue suppose this is the IFrame control
<iframe id="ifrm" src="Pghome.aspx" ></iframe>
after doing some navigation inside my IFrame suppose now I'm on About.aspx, now if I press F5 the browser actually refresh IFrame which takes me back to default page of IFrame i.e. Pghome.aspx instead of refreshing About.aspx.
Any way to fix this ?
Thanks
Thursday, September 6, 2018 11:52 AM -
User753101303 posted
Hi,
Which is correct. You asked for refreshing a page that contains an iframe which points to Pghome.aspx. I believe it might work with a frameset.
But IMHO you should really make first sure about which problem you are trying to solve. You are starting to work against how the web works rather than to embrace its principle and it could cause more harm than good (what if a user want to bookmark a page or send a link to a friend ?).
Having a different url depending on which resource you want to show is perfectly normal exactly as you are used to load a file from a folder by its name rather than pretending that all files have the same name.
Which problem are you trying to solve ? Even in a single page application you are usually making sure the user can bookmark the current "view" (even if behing the scene it is actually a single "page").
Thursday, September 6, 2018 12:21 PM -
User1765954050 posted
Hi,
This is a banking application, and it's our client requirement that URL in address bar should not be changed doesn't matter on which page you navigate to.
Yes I have already inform them about bookmark, they are OK with it.
This is a Internal website and will not be exposed via Internet.
I hope I have cleared the idea.
Thanks
Friday, September 7, 2018 5:18 AM -
User753101303 posted
Not really. It will just hide the url from the browser user and it would be trivial to still have a look at them (using F12 Network or just "open this link in a new window"k). From a security point of view it won't change anything and I don't see any benefit.
It should work with https://www.w3schools.com/TAGs/tag_frameset.asp (if it still works as it is oudated) rather than iframes...
Friday, September 7, 2018 6:25 AM -
User-2054057000 posted
You can just fetch the other page contents using the JavaScript AJAX methods.
Wednesday, October 17, 2018 12:43 PM