I am working on asp.net using c#. I have one master page with 3 anchor tag links and one html label. When a user clicks on a particular link it should redirect to specific page and the link text should be displayed on the label. I have used following code,
$(document).ready(function () {
$('#div1 a').click(function () {
if (focus == true)
$('#lblHeader').text("Home");
});
$('#blog').click(function () {
if (focus == true)
$('#lblHeader').text("Blog");
});
$('#about').click(function () {
if (focus == true)
$('#lblHeader').text("About");
});
});
please guide me.
If you have a label server control, changing the text with javascript before a postback occurs will have no effect since the whole page is redrawn.
Edit: I think I know what you are trying to do. Why not create a
contentplaceholderin your master page, and set its value in each of the pages?In your Master page:
In each content page: