MVC- Redirect to Current URL with all parameters

Jak
Jak
908 Points
132 Posts

 

Hi,

how to redirect to current url in mvc4?

 

Views: 9784
Total Answered: 1
Total Marked As Answer: 0
Posted On: 06-Jan-2015 17:09

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
4916 Points
27 Posts
         

Hi,

In View page you can use Request.RawUrl:

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" >
<head runat="server"> 
<title>Index</title>
</head>
<body> 
<div>
 
 <a href="<%:Request.RawUrl %>">Redirect to Same page</a>
</div>
</body>
</html>

 

Posted On: 10-Jan-2015 19:40
 Log In to Chat