Sample\" I am having 3 Tabs in my Application (Home,About,Product). When i check the check box,i should be redirected to t" />
开发者

Page Redirection in MVC2

I am having a check box in Home Page "<%=Html.CheckBox("Sample","1")%>Sample" I am having 3 Tabs in my Application (Home,About,Product). When i check the check box,i should be redirected to the Product Page. How to 开发者_如何转开发do this.


How about his:

 <% using (Html.BeginForm("Redirect", "Home", FormMethod.Post, new { id = "chksSubmit" })) %>
<%{ %>
        <%: Html.CheckBox("CheckNow", new { onclick = "javascript:document.getElementById('chksSubmit').submit();" })%>
<% }%>

In the controller:

 public ActionResult Redirect()
    {
        return RedirectToAction("Home");
    }


You could try

<%=Html.CheckBox("Sample","1", new {onclick="location='"+Url.Action("Product")+"'")%>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜