Create a Url and redirect to the url in Asp.Net MVC -


i have notification controller saves data in table

public void enterdata() {    notification notify = new notification();    notify.url = "../controller/action/1?dataid=2"    db.notification.add(notify);    db.savechanges(); } 

after saving data, have go page when user clicks notification.

public actionresult message(id) {   notification notify = db.notification.find(id);   .   .   return redirect(notify.url); } 

it works in pages, pages redirection makes error.
in advance.

you can use redirecttoaction like

return redirecttoaction("action","controller", new routevaluedictionary(      new {parametername = value} )  ); 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -