MVC- Redirect to Current URL with all parameters

Jak
Jak
Member
352 Points
151 Posts

 

Hi,

how to redirect to current url in mvc4?

 

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

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
Moderator
1170 Points
210 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
banner

Blog

Active User (2)

 Log In to Chat