Skip to main content

Posts

Showing posts with the label HTML5

Session value show in html ASP.NET

Set the value: HttpContext.Current.Session["CVVAndOTPRequiredCardMessage"] = cardNoMessage; HttpContext.Current.Session["CVVAndOTPRequiredCardMessage2"] = cardNoMessage2; Show session value in html: <p> <%=Server.HtmlEncode(HttpContext.Current.Session["CVVAndOTPRequiredCardMessage"].ToString())%></br> <%=Server.HtmlEncode(HttpContext.Current.Session["CVVAndOTPRequiredCardMessage2"].ToString())%> </p>

asp.net mvc checkbox will check all the check box in html table

Table: <table class="rptcontenttext" style="width: 100%; border-style: solid; border-collapse: collapse" border="1px" cellpadding="0" cellspacing="0"> <thead> <tr> <th style="text-align:left;width:10px;"> <input type="checkbox" value="true" name="chkVerifySelection" id="chkVerifySelection" onchange="return checkAllVerifySelection();" /> </th> <td class="rptrowdata" align="left"> Employee ID </td> </tr> </thead> <tbody style="overflow-y: auto; overflow-x: hidden; max-height: 400px; width: 100%;"> @for (int i = 0; i < Model.EmployeeInformationList.Count; i++) { <

html get checkbox value by id

try this: <input id="SelectedCB" type="checkbox" style = "z-index: 99999 !important; margin-top: 0px;" onchange="return getCustomer(this);" /> function getCustomer(ctrl) { if ($('#SelectedCB').is(':checked')) { alert('checked'); } else { alert('Unchecked'); } return false; }

mvc razor show hide any id based on dropdown

Drop Down @Html.DropDownListFor(m => m.AttendenceBonus.BonusIn, new SelectList(Model.BonusInList, "Value", "Text", Model.AttendenceBonus.BonusIn), new { @class = "selectBoxRegular", onchange = "return GetBonusType(this);"}) Script <script> function GetBonusType(ctrl) { var x = $("#AttendenceBonus_BonusIn").val(); // hide any control by id if (x == "Fixed") { $('#persent').text(""); $('#Applylevel').show(); $('#AttendenceBonus_BonusApplyOn').show(); } // Show any control by id else { $('#persent').text("%"); $('#Applylevel').hide(); $('#AttendenceBonus_BonusApplyOn').hide(); } } </script>