Search code examples
asp.net-mvcmodel-view-controllerhyperlinkanchorform-post

How to submit a form on anchor click with out script in asp.net mvc2?


Can any one tell , How to submit a form on anchor link click without script in asp.net mvc2?


Solution

  • I removed the anchor & used button with css

    .link
    { 
       background-color: Transparent;                 
       text-decoration: underline;                 
       color: blue;
       cursor: pointer; 
       border:0
    }   
    

    Need to show Next as button text & posting the diffent value to controller(i.e. submiting button value itself)

    <button type="submit" class="link" Value="10">
       Next
    </button>
    

    Below code for normal form post.

    <input type="submit" class="link" Value="Click"/>