-1

I try to add a cancel button in MVC form besides submit button which is also image button.
The code is :

<input type="image" src="../../Images/SUBMIT_bttn1.gif" alt="Submit" />
<a href='<%= Html.ActionLink("EditPage", "Home")%>'>
<img src="../../Images/Cancel_bttn1.gif" /></a>

But it gives Error :

Server Error in '/' Application. HTTP Error 400 - Bad Request 

What is the problem?
Thanks.

Dharmesh Porwal
  • 1,406
  • 2
  • 12
  • 21

1 Answers1

1

This is because HTML.ActionLink will create the <a> tag. You need Url.Action which just create a link the following should work.

<a href='<%= Url.Action("EditPage", "Home")%>'>
    <img src="../../Images/Cancel_bttn1.gif" />
</a>
Rajdeep Dosanjh
  • 1,157
  • 1
  • 9
  • 20
  • After change to url.action, I got crashed at it with error, "Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space." –  Jan 09 '15 at 09:09
  • That seems to be a different issue take a look at [link]http://stackoverflow.com/questions/16658803/insufficient-stack-to-continue-executing-the-program-safely-asp-net-mvc-4 – Rajdeep Dosanjh Jan 09 '15 at 09:17
  • You need hit the tick below the arrows – Rajdeep Dosanjh Jan 09 '15 at 23:17