Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

THis is bharat kumar,

i face a small problem with master page and chaild page. when i click the href button the master page is refreshed. here href button is placed in master page. in that button redirect to child page, the child page is rendered but the master page is refreshed.

how to fix the problem

Please help me

thank you
bharat kumar
Posted
Comments
Tejas Vaishnav 19-Mar-14 8:47am    
can you share your code of master page?
bharat peggem 19-Mar-14 9:47am    
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<div class="row margintop">
<div class="col-md-12">
<ul class="nav nav-tabs" id="myTab">
<li id="nielsenclick" class="active">Jan</li>
<li id="secclick">Feb</li>
<li>Mar</li>
<li >Appr</li>
</ul>
</div>
<div class="col-md-12">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</div>
</div>
</div>

-----// Js //-----

$('#myTab a').click(function (e) {
e.preventDefault()
$(this).tab('show')
debugger;
var name = $(this).text();
if (name == 'Jan') {
$('#Label1').html(name);
$('#nielsenclick').addClass('active');
window.location.href = "Nielsen.aspx";
}
if (name == 'Feb') {
window.location.href = "Sec_Single_Metric_Charts.aspx";
$('#secclick').addClass('active');
}
})
bharat peggem 19-Mar-14 9:48am    
Here Default Menu active is jan but i select Feb It is not Active state master page is refreshed

I'd suggest you to use UpdatePanel[^], in your content placeholder.

See this,
Introduction to the UpdatePanel Control[^] and
http://geekswithblogs.net/ranganh/archive/2007/05/11/112405.aspx[^]

-KR
 
Share this answer
 
Hai

If u click link form master page for redirect to child page,definitely master page refresh,u cant avoid that one,if it is child page refresh when u click any buttons or links can handle refresh problem itself in child page.But from master pager it will refresh.
 
Share this answer
 
Comments
Krunal Rohit 20-Mar-14 12:01pm    
See my answer. :)
This is can be done using AJAX..

-KR
bharat peggem 4-Apr-14 1:32am    
thank you for responding. will check it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900