Click here to Skip to main content
15,066,499 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dropdown code
@Html.DropDownListFor(model => model.Cbranch_courseCode, ViewData["ddlCourse"] as List<SelectListItem>, "--Select Course Group--", new { @class = "form-control",required = "required" })

                   var grid = new WebGrid(Model.listCbranchmasters, canPage: true, rowsPerPage: 5, selectionFieldName: "selectedRow", ajaxUpdateContainerId: "gridContent");
                               <div  id="gridContent">
                                       @grid.GetHtml(tableStyle: "webGrid",
                                        headerStyle: "header",
                                        alternatingRowStyle: "alt",
                                       selectedRowStyle: "select",
                                       columns: grid.Columns(
                                       grid.Column("Cbranch_code", "ID"),
                                       //grid.Column("Bank Name",format: (item) => item.GetSelectLink(item.Bbranch_eName)),
                                       grid.Column("Course_GroupName_E", "Course Group Name",style: "description"),
                                       grid.Column("Cbranch_eName", "Course Branch Name(English) "),
                                       grid.Column("Cbranch_hName", "Course Branch Name(Hindi)"),
                                       grid.Column("Cbranch_length_in_year", "Course Duaration"),
                                       grid.Column("Cbranch_Type", "Course Type"),
                                       grid.Column("Edit",format: @<text><a href="/Admin/CourseBranchMaster?itemId=@item.Cbranch_code"><img src="~/Content/Image/Text-Edit.png" /></a></text>)
Mayank Vashishtha 20-Aug-15 3:23am
What do you mean by "Submit the Form"? Are you talking about full post back. If it is so then why don't you go for jquery ajax post?
[no name] 20-Aug-15 7:11am
If i use javascript function onchange="this.form.submit();" my web form hit submit so
all validation has called.i need to post back my page for binding webgrid on selectedIndex of dropdown.

1 solution

Yes. That's why saying you to go for ajax post method available in jquery library. Try and have look on these[^]
Do GET, POST, PUT, DELETE in MVC with Jquery ajax[^]

Hope it helps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900