Solved

dynamically change id

Posted on 2011-09-27
6
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 36708469
<script type="text/javascript">



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

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

    </script>
0
 

Author Comment

by:virafh
ID: 36709152
i want to change it dynamically not statically plz
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36709167
from where/what/which?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:virafh
ID: 36709176
<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
ID: 36709191
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
ID: 36709300
Thanks for your best support
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

623 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