How do we get query string values in JavaScript?

You don’t need jQuery for that purpose. You can use just some pure JavaScript: function getParameterByName(name) { name = name.replace(/[\[]/, “\\[“).replace(/[\]]/, “\\]”); var regex = new RegExp(“[\\?&]” + name + “=([^&#]*)”), results = regex.exec(location.search); return results == null ? “” : decodeURIComponent(results[1].replace(/\+/g, ” “)); } Usage: var prodId = getParameterByName(‘prodId’);

How do we redirect the user from one page to another using jQuery?

jQuery is not necessary, and window.location.replace(…) will best simulate an HTTP redirect. It is better than using window.location.href =, because replace() does not put the originating page in the session history, meaning the user won’t get stuck in a never-ending back-button fiasco. If you want to simulate someone clicking on… Continue reading

How to call a C# Web(Page) Method from Javascript using ScriptManager

Atlas (Javascript Library) gave us the ability to easily call Web method from JavaScript. Microsoft AJAX has gone one step further! We can now call web methods in the code behind of the current page from Javascript. Here’s how: For Enable Page Methods on your ScriptManager set the EnablePageMethods=”true” attribute <asp:ScriptManager&nbsp;ID=”ScriptManager1″&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;EnablePageMethods=”true”&nbsp;… Continue reading

What is Client-Side Programming

At the same time that server-side web development was moving through an alphabet soup of technologies, a new type of programming was gaining popularity. Developers began to experiment with the different ways they could enhance web pages by embedding miniature applets built with JavaScript, ActiveX, Java, and Flash into web… Continue reading

Explain jQuery Selectors

Selectors are the strings you pass to the jQuery function to select elements in the DOM. Example: $(function () { $(“#album-list img”).mouseover(function () { $(this).animate({ height: ‘+=25’, width: ‘+=25’ }) .animate({ height: ‘-=25’, width: ‘-=25’ }); }); }); In this example, we used “#album-list img” as a selector to find… Continue reading

Check All Checkbox of a grid by using JavaScript

function CheckAllBox() { var chkval = document.getElementById(‘ctl00_cphMain_grdCategory_ctl01_chkAll’).checked; try { for (var i = 2; i & lt; 200; i++) { if (i & lt; = 9) { document.getElementById(‘ctl00_cphMain_grdCategory_ctl0’ + i + ‘_chk’).checked = chkval; } else { document.getElementById(‘ctl00_cphMain_grdCategory_ctl’ + i + ‘_chk’).checked = chkval; } } } catch (e) {}… Continue reading

How to use watermark property on password textbox in a web-page?

Here I am giving you an example where you can see that watermark property works fine with required field validator in Asp.Net. This whole process can be done by using simple jQuery tricks. In my concept we have 2 textboxes and one of them is <asp:TextBox ID=”txtPassword” runat=”server” Style=”height: 18px;… Continue reading