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
Post a Comment