Reputation: 19815
I have two user types: Readers and Authors. And I'm using Reader.Master
and Author.Master
for authorization purposes.
Then, there are StoriesR.aspx
inherited from Reader.Master
and StoriesA.aspx
inherited from Author.Master
. (In StoriesR.aspx
page, you able to read the stories and in StoriesA.aspx
you able to write the story.) So,
Reader.Master
--> StoriesR.aspx
Author.Master
--> StoriesA.aspx
Now, the thing is I don't want my users to see StoriesR.aspx?s=3
or StoriesA.aspx?s=3
in their browsers. I only want them to see stories?s=3
. (even without the .aspx
part)
How can I achieve this?
Upvotes: 1
Views: 116
Reputation: 941
you can do this using urlMappings from web.config file
add in web.confing
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<urlMappings enabled="true">
<add url="~/reader/stories" mappedUrl="~/reader/StoriesR.aspx"/>
<add url="~/author/stories" mappedUrl="~/author/StoriesA.aspx"/>
This will do url mapping.
Upvotes: 2
Reputation: 2755
You could have one aspx page and change the master page programmatically depending on what type of user they are, Author or Reader.
You can do this in the Page_PreInit
event of your aspx page.
Check this c# example or this VB example
Upvotes: 1