.net - Do Response.Redirect in aspx markup -
i have .net button should response.redirect. can in markup?
<asp:button runat="server" onclick='<%# response.redirect("~/administration.aspx"); %>' text="cancel"></asp:button>
it not work because "cannot implicitly convert void object"
you can't assign code directly that. need assign method handles event, like:
onclick="btn1_click" protected void btn1_click(object sender, eventargs e) { response.redirect("~/administration.aspx"); }
edit
what can skip asp.net altogether , regular html , javascript, avoid post:
<input type="button" onclick="window.location.href = '<%= resolveurl("~/administration.aspx") %>'">
Comments
Post a Comment