ASP.Net DropDownList Filter and Search items using JavaScript

In this article, we will learn how to create, search, and filter a DropDownList control in Asp.Net as using JavaScript. Filter and Search ASP.Net DropDownList items using JavaScript Fist, let start by creating a WebForm, then add controlse to it as shown below: <div> <asp:TextBox ID="txtFilter" runat="server" onkeyup="FilterDDL(this.value)"></asp:TextBox><br /> <asp:DropDownList ID="ddlColors" runat="server"> <asp:ListItem Text="Black" Value="1"></asp:ListItem> <asp:ListItem... » read more

JavaScript Disable browser’s back button in ASP.Net

Web browsers enable users to go back to the previous page while browsing the internet by clicking on the back button. But sometimes, you need to prevent the user from visiting the previous page. You might want to disable the browser’s back button but you can’t disable the functionality through the code in the web... » read more

Show/Hide Text Box using JavaScript & jQuery

In this article, you will learn how to show/hide a textbox based on the user’s selection of the drop-down menu. If the user selects yes from the drop-down menu, the text box will appear. Show/Hide a TextBox in Javascript and jQuery HTML <form> <div id="drop-down" name="drop-down"> <label for="travel">Have you visited Europe before? </label> <select name="travel"... » read more

Convert HTML table to JSON string in ASP.NET using C# and JavaScript

In this tutorial, I will explain to you how to convert an HTML table to a JSON string using C#. Convert HTML table to JSON in ASP.NET To get started, insert a static table and an ASP button as shown in the code below: <table class="nav-justified" border="1" id="tblEmployees"> <tr> <td><strong>Name</strong></td> <td><strong>Department</strong></td> </tr> <tr> <td>Jeff</td> <td>IT</td>... » read more

How to get hidden field value using JavaScript

Here are the two ways to get a hidden filed value using JavaScript: document.getElementById(‘Id of the hidden field).value document.formName.elements[‘name of the hidden field].value You can use the way you prefer; both will return the same value. And here is an example: JavaScript: <script type="text/javascript"> function GetHiddenFieldValue(){ var HiddenFiledID; var HiddenFiledName; HiddenFiledID = document.getElementById(hfID).value; HiddenFiledName =... » read more