asp.net mvc - Ajax beginform() is not working -
i m trying load partial view in particular div using ajax form begin not working @ sametime please me while click submit button need load partial view div
master page :
<body> <form id="form1" runat="server" enctype="multipart/form-data" > <div> <div> <asp:contentplaceholder id="contentplaceholder2" runat="server">pagename</asp:contentplaceholder> <div id="content"> <div id="sidebar"> <asp:menu id="menubar" staticenabledefaultpopoutimage="false" runat="server" backcolor="black" dynamichorizontaloffset="2" font-names="arial" font-size="0.8em" forecolor="white" staticsubmenuindent="10px"> <dynamichoverstyle backcolor="white" forecolor="black" bordercolor="black" borderstyle="solid" borderwidth="1px" /> <dynamicmenuitemstyle horizontalpadding="10px" verticalpadding="7px" bordercolor="white" borderstyle="solid" borderwidth="1px" font-names="arial" font-size="12px" /> <staticselectedstyle backcolor="white" bordercolor="black" borderstyle="solid" borderwidth="1px" forecolor="black" /> </asp:menu> </div> <div id="main"> <asp:contentplaceholder id="maincontent" runat="server"></asp:contentplaceholder> </div> </div> </form>
view page :
<% using (ajax.beginform("gettruckexpenseschild", new { id="ex1001" }, new ajaxoptions { httpmethod = "post", insertionmode = insertionmode.replace, updatetargetid = "list" })) {%> <%: html.validationsummary(true)%> <div> <input type="submit" name="dina" value="show list" </div> <div id="list"> </div>
make sure should have follow bundle addition.
bundles.add(new scriptbundle("~/bundles/jquery").include( "~/scripts/jquery-{version}.js")); bundles.add(new scriptbundle("~/bundles/jqueryval").include( "~/scripts/jquery.unobtrusive*"));
and in html, make sure both bundles called.
@scripts.render("~/bundles/jquery") @scripts.render("~/bundles/jqueryval")
for detail check link -
Comments
Post a Comment