Solved

dynamically change id

Posted on 2011-09-27
6
205 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

820 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