i have two user controls , both of them in the same master page
in one of them i have a counter , and the the other one there is some code that increment and decrement that counter
if i make a reload to the whole page the counter works well and get the right number , but if i made any changes in the second user control it didn’t feel it till the next page reload
what i want is that who i can make the counter feel the changes immediately
thanks in advance
that is the code
<%@ Master Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/Main.Master" CodeBehind="InboxMails.master.cs" Inherits="NAQQAB_Web.MasterPages.InboxMails" %>
<%@ Register Src="~/userControls/InboxMails.ascx" TagName="Mails" TagPrefix="InboxMailsUS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<InboxMailsUS:Mails ID="InboxMailsLists" runat="server" />
</asp:Content>
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="NAQQAB_Web.MasterPages.Main" %>
<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>
<%--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">--%>
<%@ Register Src="~/userControls/SearchBar.ascx" TagName="SearchBar" TagPrefix="SearchBarUC" %>
<%@ Register Src="~/userControls/UserStatusBar.ascx" TagName="LogIn_LogOutBar" TagPrefix="Shura" %>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<body marginheight="0" marginwidth="0" style="margin-bottom:0; margin-left:0; margin-right:0; margin-top:0; ">
<form id="form1" runat="server" method="post" target="_parent">
<div>
<asp:ScriptManager runat="server" ID="ScriptManager1" ScriptMode="Release">
</asp:ScriptManager>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="height: 100%;">
<tbody>
<tr>
<td width="834" height="100%">
<table id="table2" border="0" cellpadding="0" cellspacing="0" width="100%" style="height: 100%;">
<tbody>
<tr>
<td valign="top" height="231">
<table id="table3" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td valign="top">
<table id="table8" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="background-image: url(images/topBG.jpg);" align="right" bgcolor="#1a1e1f"
valign="top">
<br>
<Shura:LogIn_LogOutBar ID="userStatus" runat="server" Visible="True" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>
i want to call function from the code behind in the user status bar when changes done in the code behind in the inbox mail page done
try to enforce postpack to the whole page after you increment or decrement counter in your second control to make the first one take the right value
frankly , i feel something inproper in your assumption about 2 usercontrol under same page and one of them call function inside the other this issue is responsibility of master page
so you need to set event in master page and iside it call usercontrols to increment,decrement and showing counter
hope my post is useful !