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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -