Wednesday, February 20, 2013

Solution for Button tag not working in ie7 using ASP.NET MVC

Button tags in IE (v. 8, at least) will not work without an 'onclick' handler. Well, at least you can't simply wrap the button in an anchor tag. You can fix this issue with below specified way

 

Example :

 

   1:  
   2: <a href="@Url.Action("Add", "Product", new { id = 0 })" 
   3: onclick="javascript:window.location=this.href">
   4:  
   5: <input type="submit" id="imgAdd" name="imgAdd" value="imgAdd" 
   6: />
   7:  
   8: </a> 

No comments:

Post a Comment