Solved

dynamically change id

Posted on 2011-09-27
6
203 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

23 Experts available now in Live!

Get 1:1 Help Now