Click here to Skip to main content
16,012,107 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
currently I am using return BuildManager.CreateInstanceFromVirtualPath("~/test.aspx", typeof(Page)) as Page;

for re-writing. Please give me best solution with best code practice. My application is very slow and taking 100 % cpu usase some time. I have review code and find due to return BuildManager.CreateInstanceFromVirtualPath("~/News-Main/pressreleasedetail.aspx", typeof(Page)) as Page; it miglt be slow.
and what is best alternate.

Thanks In advance
Vineet
Posted
Comments
ZurdoDev 10-Jun-14 7:40am    
Why are you using this? What is it you are trying to do?
Member 10875333 10-Jun-14 8:05am    
Mr Ryan Please read my question again. I want to use url rewriting.

1 solution

If you mean URL rewriting, you can use the following solutions : first using UrlMapping configuration in web.config file
<urlMappings enabled="true">
<add url="~/Test.aspx" mappedUrl="~/Default.aspx?Code=0" />
<add url="~/Test1.aspx" mappedUrl="~/Default.aspx?Code=1" />
</urlMappings>


and the other way could be using RouteCollection.MapPageRoute method in application_Start event in global.asax class

for more information you can visit the following pages :

http://www.4guysfromrolla.com/articles/012710-1.aspx[^]

http://msdn.microsoft.com/en-us/library/vstudio/ms228302(v=vs.100).aspx[^]
 
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