Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

refresh only part of page whit tabs

$
0
0

Hello,

I have a master page and one content page.

In the content page i have tabs .Each tab is a button and when clicking on the button(tab) it activate the according view.

In each view i have a usercontrol that have gridView with data that is loaded.

My problem is that when i click on a tab it will refresh the whole page and will call in each page load event of all the usercontrol of each view.

How can i change my code so that when clicking on a tab it will only load the page load event of this tab.

Thank you

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.master" CodeBehind="Main.aspx.cs" Inherits="SysManagement.Main" EnableEventValidation="false" %><%@ Register Src="~/WebUserControl_Users.ascx" TagName="UsersControl" TagPrefix="TWebControl" %><%@ Register Src="~/WebUserControl_Equipments.ascx" TagName="EquipmentsControl" TagPrefix="TWebControl" %><%@ Register Src="~/WebUserControl_OpSys.ascx" TagName="OpSysControl" TagPrefix="TWebControl" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"></asp:Content><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"><table width="100%" align="center"><tr><td><asp:Button Text="user" BorderStyle="None" ID="TabUser" CssClass="Initial" runat="server" OnClick="TabUser_Click" /><asp:Button Text="equipment" BorderStyle="None" ID="TabEquipment" CssClass="Initial" runat="server" OnClick="TabEquipment_Click" /><asp:Button Text="operating sys" BorderStyle="None" ID="TabOpSys" CssClass="Initial" runat="server" OnClick="TabOpSys_Click" /><asp:MultiView ID="MainView" runat="server"><asp:View ID="ViewUser" runat="server"><TWebControl:UsersControl ID="Tab_users" runat="server" /></asp:View><asp:View ID="ViewEquipment" runat="server"><TWebControl:EquipmentsControl ID="Tab_equipments" runat="server" /></asp:View><asp:View ID="ViewOpSys" runat="server"><TWebControl:OpSysControl ID="Tab_opsys" runat="server" /></asp:View></asp:MultiView></td></tr></table></asp:Content>

//in the content page server side event when clicking on the button to activate the view.
protected void TabUser_Click(object sender, EventArgs e)
{

TabUser.CssClass = "Clicked";
TabEquipment.CssClass = "Initial";
TabOpSys.CssClass = "Initial";
MainView.ActiveViewIndex = 0;

}

//in the usercontrol server side function to bind the grid
public partial class WebUserControl_Frequency : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
BindGridFrequency();
}
}
{


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>