Solved

dynamically change id

Posted on 2011-09-27
6
204 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
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

13 Experts available now in Live!

Get 1:1 Help Now