Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everybody,

I am working with Razor design pattern in MVC3. There I want to encode the url to Pass the values to another form.

For Example :
you might have a Delete Comment action on your CommentController which takes a CommentID. The action url might look like /Comments/Delete/3 to delete the comment with the id 3.


Now there is another question regarding same topic is that how to decode if it encoded . Because in asp.net we can be do that by split the string by ?.


Need Support..
Posted

With Razor all is automatically html encoded. You can use @Html.Raw(text) to avoid it.

Good luck!
 
Share this answer
 
Comments
Espen Harlinn 9-Feb-12 9:12am    
5'ed!
use the following statement to encode & decode :
Syntax :
@Ajax.JavaScriptStringEncode(@sharePointDocument.URL)

By Mahender Swamy
 
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