Posts

Showing posts from December, 2018

How to reset Checkbox as Unchecked(false)

How to reset Checkbox as Unchecked(false) 1.        Syntax for Html   Helper CheckBox:        @ Html.CheckBox( "Status" , isChecked: false ) 2.        Syntax for reset checkbox status as unchecked: $(“CheckboxId”).prop(“checked”,false)

Add data and create temporary table which contains the newly created data dynamically

Image
Add data and create temporary table which contains the newly created data dynamically write the below code in view @{     ViewBag.Title = "Index"; } <h2>Index</h2> <div class="row">     <div class="col-md-12">         <div class="col-md-2">@Html.Label("Fname", "First name", new { style = "width:110px" })</div>         <div class="col-md-2">@Html.Label("Lname", "Last name", new { style = "width:110px" })</div>         <div class="col-md-2">             @Html.Label("Gender", "Gender", new { style = "width:110px" })         </div>         <div class="col-md-2">             @Html.Label("Status", "Status", new { style = "width:110px;margin-left: -15px;" })         </div>   ...

How to create and add a new div inside parent div(“mainDiv”) but before the child div(“child”) of parent div(“maindiv”) using InsertBefore

How to create and add a new div inside parent div(“mainDiv”) but before the child div(“child”) of parent div(“maindiv”) using InsertBefore < div id ="mainDiv">     < div class ="row" id ="child">   </div> </div> var p = document.getElementById(“ mainDiv ”); var html=(”<div>puja</div>”); var exNode = document.getElementById( "child" ); var newElement = document.createElement(“<div>”); newElement.setAttribute( 'id' , “elementId”); newElement.innerHTML = html; p.insertBefore(newElement, exNode);

How to Remove the child div from parent div using javascript

How to Remove the child div from parent div using javascript function removeElement(elementId) {         // Removes an element from the document         var element = document.getElementById(elementId.id);         element.parentNode.removeChild(element);     } elementId: this is the parent div element.id: this is the id of the parent div

How to know the checkbox value using jquery

How to know the checkbox   value 1.        Syntax for Html   Helper CheckBox:        @ Html.CheckBox( "Status" , isChecked: false ) 2.        Syntax for getting checkbox status:          $( "#Status" ).is( ":checked" )

Static Data Binding in html DropDownList

Static Data Binding in html DropDownList @ Html.DropDownList( "Gender" ,          new List < SelectListItem > {                  new SelectListItem () { Text = "Male" , Value = "Male" },                  new SelectListItem { Text = "feMale" , Value = "FeMale" },                  new SelectListItem { Text = "Select Gender" , Value = "Select Gender" }                                    }, "Select Gender" )

Dynamic Adding data and show in list

Image
Add data and show temporaly in below grid and save data show in below list during final click on SaveData @{     ViewBag.Title = "Index"; } <h2>Index</h2> <h2>Index</h2> <div class="row" >     <div class="col-md-12">         <div class="col-md-2">@Html.Label("Fname", "First name", new { style = "width:110px" })</div>         <div class="col-md-2">@Html.Label("Lname", "Last name", new { style = "width:110px" })</div>         <div class="col-md-2">             @Html.Label("Gender", "Gender", new { style = "width:110px" })         </div>         <div class="col-md-2">                       @Html.Label("Status", "Status", new { style = "width:110px" })         ...

Static Binding Of Html DropDownListFor using Model Binding

Static Binding Of Html DropDownListFor using Model Binding   @ Html.DropDownListFor(m => m.Gender, new SelectList ( new List < Object > {   new {value= "Select"  ,  text= "Select" },                                                    new  {value= "Female"  ,text= "Female" },                                                       new  {value= "Male"  ,text= "Male" }   },  "value" ,  "text" , "Select" ),  new  { style= "width:100px" })                                                            ...