mercredi 27 janvier 2016

How to change the URL of @Html.BeginForm

there some tab have its own form,the form1 in tab-1 looks like code below, the url will be like http://localhost/view/Display?Airline=CA when I click any tab for searching, so I want to change the URL when I click the button for example in tabs-2, so the URL should be http://localhost/view/Display?Airline=CA#tabs-2, then it could back to tab 2, so how can I change the URL? Thanks!

@using (@Html.BeginForm("Display", "Manual", FormMethod.Get, new { id = "searchForm1", enctype = "multipart/form-data" }))
{                                
    <span><b>Airline:</b></span>
    @Html.TextBox("Airline", Model.Airline??"", new { @class = "public_input1", style = "width: 60px;" })    
}

<input class="btnSubmit" id="searchNote1" type="button" value="search" />

$("#searchNote" + index).click(function () {
    var searchFormElement = "#searchForm" + index;
    $(searchFormElement).attr("action", "/View/Display");
    $(searchFormElement).submit();
    return true;
});

Aucun commentaire:

Enregistrer un commentaire