Sie sind auf Seite 1von 2

How to add blank option in Dropdown using Jquery var var_name = $("#DropdownId"); var_name .

prepend($('<option/>', { value: null, text: "" })); [RegularExpression(@"\d+(\.\d{1,3})?", ErrorMessage = "Only numbers > 0, <1000, up to 3 decimal places allowed.")] [Range(1, 999.999, ErrorMessage = "Only numbers > 0, <1000, up to 3 decimal places allowed.")]

Get value from textbox


var txtVal = $("input[name$='WriteOffAmount'][type='text']").val(); Function of JS, Jquery- [focus(),remove(),empty(),indexof(),join() ] if ($("input[name$='SelectedHospitalID']").data('tComboBox').value() == null) { alert('Select Practice'); }

Set property using JS and Jquery $("#ControlID").attr('selectedIndex', 0); $('#inputID').attr('readonly', 'readonly'); Function Call whil Keyup in Textbox $("#textBoxID").keyup(function (event) {var amt = this.value;}); Get value from Model var var_name = '@Model.modelProperty'; fix decimal place value in JS balance = parseFloat(balance).toFixed(2); Ienumerable- Exposes the Enumerator,which supports a simple iteration over a collection of a specified Type. static void Main(string[] args) { // Specify the data source. int[] scores = new int[] { 97, 92, 81, 60 }; // Define the query expression. IEnumerable<int> scoreQuery = from score in scores where score > 80 select score; // Execute the query. foreach (int i in scoreQuery) { Console.Write(i + " ");

} } Call this Function to blank Telerik Grid function NoRecordFound() { // set TelerikGrid Blank $("#gridID").data().tGrid.total = 0 $("#gridID").data().tGrid.dataBind([]) }

// Redirect to Verify action inside the Sample Controller return RedirectToAction("Verify", "Sample"); return File("Web.config", "text/html"); return Json("hello from JSON","text/html", JsonRequestBehavior.AllowGet);

isPostback(in ASP.net)= postback is the process of submitting asp.net page to the server for processing. Before page_load ispostback will be false. And after page_load itll be true.
var grid = $("#Grid").data("tGrid"); var a = grid.data[0].Category; alert(a); //category = column name in grid

Das könnte Ihnen auch gefallen