Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.. Friends, I have the following tag in my web.config file

HTML
<urlMappings enabled="true">
			<add url="~/addemployee" mappedUrl="~/addemployee.aspx"/>
			<add url="~/Default" mappedUrl="~/Default.aspx"/>
			<add url="~/editeemployee" mappedUrl="~/editeemployee.aspx"/>
		</urlMappings>


The problem is that I want to add next tag
HTML
<add url="~/empdetails" mappedUrl="~/empdetails.aspx"/> 


programmatically, so please give me some idea how can I do this.

Thanks & Regards
Parveen Rathi
Posted

1 solution

I would not suggest you to modify Web.Config for such thing. If you need to do something like this at runtime, I would suggest traditional URL Rewriting.

Read here: URL Rewriting with ASP.NET[^]
MSDN: URL Rewriting[^]

OR

Read about, In ASP.NET 4.0: URL Routing[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900