Active navigation menu for current url

Set the active/current menu link based or Url in Jquery:

suppose we have menu like:

<div class="nav">

 <li class="active"><a href="~/url1/">URL 1</a>
 <li><a href="~/url2/">URL 2</a>
 <li><a href="~/url3/">URL 3</a>

and user when clicked on URL 2 then item look as active :


    var url = window.location.pathname, 
    urlRegExp = new RegExp(url.replace(/\/$/,'') + "$"); 

     $('#nav a').each(function(){


Edited version

$(document).ready(function() {
var str = location.href.toLowerCase();
$(".ddsmoothmenu li a").each(function() {
if (str.indexOf(this.href.toLowerCase()) > -1) {

Posted in Uncategorized

Wrap Label Text in

Today I found one issue with my site, that is a label text was not wrapped and display continued. Found finally working solution:

 <div style="float:left;overflow-y:auto;overflow-x:auto; word-break:break-all;">
	<asp:Label ID="lbDesc" runat="server" />
Tagged with: ,
Posted in Asp.Net 4.0 web form routing in iis7

Today I have completed my first phase of the project on Asp.Net 4.0 and I have implemented Web Form routing feature. It was working fine on VS inbuilt IIS server but when I deployed on IIS server, it was not working. I did little bit search on Google and finally found working solution. It may help you in future.

<modules runAllManagedModulesForAllRequests="true">
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,
                    System.Web, Version=, Culture=neutral,
                    PublicKeyToken=b03f5f7f11d50a3a" />      
            verb="*" path="UrlRouting.axd"
            type="System.Web.HttpForbiddenHandler, System.Web,  
              Version=, Culture=neutral,  

Tagged with: ,
Posted in Asp.Net, IIS7

RadioButtonList change event in jquery

Trap RedioButtonList change event in Jqury OR RadioButtonList selected value in Jquery:

<asp:RadioButtonList ID="rblBannerType" ClientIDMode="Static" runat="server" 
              RepeatDirection="Horizontal" >
    <asp:ListItem Value="image" Selected="True">Image</asp:ListItem>
    <asp:ListItem Text="html" >Html</asp:ListItem>

//jquery script
	$(function () {
		var t = $("#rblBannerType input:checked").val();

		//Banner Type
		$("#rblBannerType").change(function () {
			var type = $("#rblBannerType input:checked").val();
	function SetBannerType(type) {
		if (type == "image") {
		else {
Tagged with: ,
Posted in Asp.Net, C#

CheckboxList required field validation

Today I came across a situation where I need to validate CheckboxList as required field and found below solution:

//Bound list from Database
<asp:CheckBoxList ID="chlZones" runat="server" RepeatColumns="5" 
RepeatDirection="Horizontal" />
//Create Custom validator that will work as required validator. Profile function
<asp:CustomValidator ID="cvalZones" runat="server" 
ClientValidationFunction="ValidateZones" ErrorMessage="!!!" 
Display="Dynamic" />

//Implement Client method
function ValidateZones(source, args) {
		var chlZones = document.getElementById('');
		var chkLista = chlZones.getElementsByTagName("input");
		for (var i = 0; i < chkLista.length; i++) {
			if (chkLista[i].checked) {
				args.IsValid = true;
		args.IsValid = false;
Tagged with: ,
Posted in Asp.Net

Application Lifecycle Management

Today I found very good article for Project Management activity and how you can manage your project in very effective manner. I would like to share and you must see once this article and follow it:

  • Integrated planning
  • Traceability of related artifacts
  • Development intelligence
  • Automation and Collaboration
  • Continuous process improvement

Tagged with: ,
Posted in Project Management

IE9 Beta download

Today Microsoft announced IE9 beta released and now available for download in different languages. To get more about it find below URL:


Tagged with:
Posted in IE
Top Rated

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats
  • 30,874 hits