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 Server-Side Programming

To understand why ASP.NET was created, it helps to understand the problems of early web development technologies. With the original CGI standard, for example, the web server must launch a completely separate instance of the application for each web request. If the website is popular, the web server struggles under… 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