title: How to change submit button text on condition inside Homecontroller in mvc?
body: <p>I have mvc 3 application in which i'm having one input form on Index.cshtml view.
  also having one webgrid which is having <code>edit</code>,<code>delete</code> button</p>
  
  <p>depending upon these action links i need to change my submit button text.
  how can i achieve this inside homecontroller.cs ? using only one view for all <code>edit</code>,<code>insert</code>.</p>
  
  <p>checking useraction inside homecontroller.cs</p>
  
  <pre><code>public ActionResult Index(string userAction)
      {
         if (userAction == "Edit" )
          {
  
          }
  
  
          if (userAction == "Delete" )
          {
  
          }
  
      }
  
  View code: 
  @model Mapping.Models.SecurityIdentifierMappingViewModel
  @using (Html.BeginForm())
  {
      @Html.ValidationSummary(true)
      &lt;fieldset&gt;
          &lt;legend&gt;Mapping&lt;/legend&gt;
          &lt;div class="editor-label"&gt;
              @Html.Label("Pricing SecurityID")
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.HiddenFor(model =&gt; model.MappingControls.Id)
              @Html.DropDownListFor(model =&gt; model.MappingControls.PricingSecurityID,
           new SelectList(Model.PricingSecurities, "Value", "Text"),
           "Select SecurityID"
              )
              @Html.ValidationMessageFor(model =&gt; model.MappingControls.PricingSecurityID)
          &lt;/div&gt;
          &lt;div class="editor-label"&gt;
              @Html.Label("CUSIP ID")
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.DropDownListFor(model =&gt; model.MappingControls.CUSIP,
           new SelectList(Model.CUSIPs, "Value", "Text"),
              "Select CUSIP"
              )
              @Html.ValidationMessageFor(model =&gt; model.MappingControls.CUSIP)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.Label("Calculation")
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.TextBoxFor(model =&gt; model.MappingControls.Calculation)
              @Html.ValidationMessageFor(model =&gt; model.MappingControls.Calculation)
          &lt;/div&gt;
          &lt;p&gt;
              &lt;input type="submit" value="Insert" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  
  on same page i have a webgrid I need to change text of submit button to Update when I clicked on webgrid's edit button. i'm newbie.
  
  Webgrid code
      @model IEnumerable&lt;Mapping.Models.SecurityIdentifierMapping&gt;
      @{
          ViewBag.Title = "Mapping";
          WebGrid grid = null;
          if (Model.Count() &gt; 0)
          {
              grid = new WebGrid(source: Model,
                                      defaultSort: "Id",
                                      canPage: true,
                                      canSort: true,
                                      rowsPerPage: 10);
          }
      }
      &lt;h3&gt;
          Mapping Web Grid&lt;/h3&gt;
      @if (grid != null)
      {
          @grid.GetHtml(
                      tableStyle: "grid",
                      headerStyle: "head",
                      alternatingRowStyle: "alt",
                      columns: grid.Columns(
                                                  grid.Column("", header: null, format: @&lt;text&gt;@Html.ActionLink("Edit", "Index", new { uid = (int)item.id, userAction = "Edit" })
          @Html.ActionLink("Delete", "Index", new { uid = (int)item.id, userAction="Delete" }, new { @class = "Delete" })&lt;/text&gt;),
                                                  grid.Column("PricingSecurityID"),
                                                  grid.Column("CUSIP"),
                                                  grid.Column("Calculation")
                                                )
  
                      )
      }
  </code></pre>