Solved

dynamically change id

Posted on 2011-09-27
6
202 Views
Last Modified: 2012-06-27
Dear Team,

I am using the attached jquery to load some content area on my aspx page.
where i am passing a content id which i want to changes i my jquery script dynamically.
For example default id is 'NavS03_sub01.
My script is like this.
$.library.localnavi('NavS03_sub01');
Now i am passing a second id that is NavS03_sub02
My script must be like this
$.library.localnavi('NavS03_sub02');

Please give me some solution.

<script type="text/javascript">
$(document).ready(function(){
	$.library.globalnavi('NavG01');
	 $.library.localnavi('NavS03_sub01');
   
});

    </script>

Open in new window

0
Comment
Question by:virafh
  • 3
  • 3
6 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
<script type="text/javascript">



$(document).ready(function(){
      $.library.globalnavi('NavG01');

        var id = 'NavS03_sub01';
        $.library.localnavi(id);
});

    </script>
0
 

Author Comment

by:virafh
Comment Utility
i want to change it dynamically not statically plz
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
from where/what/which?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:virafh
Comment Utility
<script type="text/javascript">
 
   
$(document).ready(function()
 {
   var labelText = $('#<%= lblNames.ClientID %>').html();
                alert(labelText);
       $.library.localnavi(labelText);
   
});

    </script>

     <asp:Label ID="lblNames"  Visible="true" runat="server" Text="NavS01_sub01"></asp:Label>

i am using the above code script and its working when my label is visible but its not working when i set visible=false plz help
   
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
With  Visible="false"

the textbox is not created on the page.
instead use style="display:none"
and style="display:block"

Visible :

<asp:Label ID="lblNames" style="display:block"  runat="server" Text="NavS01_sub01"></asp:Label>

or

Not Visible :

<asp:Label ID="lblNames" style="display:none"  runat="server" Text="NavS01_sub01"></asp:Label>
0
 

Author Closing Comment

by:virafh
Comment Utility
Thanks for your best support
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now