先被执行什么?试着在ASPX页面里把更新数据的控件移动到显示数据的控件前面去or show your code

解决方案 »

  1.   

    the following is  asp.net page that included three usercontrols.
    the NewWeeklyControl is for updating data and the DetailControl is for showing detail information of data.
    <%@ Page language="c#" Codebehind="weblog_weekly_report.aspx.cs" AutoEventWireup="false" Inherits="weblog.weblog_weekly" validateRequest=false%>
    //register usercontrols
    //===============================================================
    <%@ Register TagPrefix="uc1" TagName="TitleControl" Src="uControls/TitleControl.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="NewWeeklyControl" Src="weeklyControls/NewWeeklyControl.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="DetailControl" Src="weeklyControls/report_DetailControl.ascx" %><HTML>
    <HEAD>
    <title>weblogEditNewPost</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <LINK href="css\weekly.css" type="text/css" rel="stylesheet">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    <FORM id="Form2" runat="server">
    </HEAD>
    <body leftMargin="0" topMargin="0" marginwidth="0" marginheight="0" onscroll="javascript:defineTop()"
    id="thebody">//here i define the control of updating data.
    //==========================================
    <div id="Layer1" style="BORDER-RIGHT:#000000 1px; BORDER-TOP:#000000 1px; Z-INDEX:-1; LEFT:9px; VISIBILITY:hidden; OVERFLOW:scroll; BORDER-LEFT:#000000 1px; WIDTH:690px; BORDER-BOTTOM:#000000 1px; POSITION:absolute; TOP:18px; HEIGHT:350px; BACKGROUND-COLOR:#006699; layer-background-color:#006699">
    <uc1:NewWeeklyControl id="NewWeeklyControl1" runat="server"></uc1:NewWeeklyControl>
    </div>
    <TABLE id="Table1" width="100%" border="0">
    <TBODY>
    <TR>
    <TD>
    <uc1:TitleControl id="TitleControl1" runat="server"></uc1:TitleControl></TD>
    </TR>
    <TR>
    <TD vAlign="top">
    <table width="790" height="304" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td height="304" valign="top">

    //here i define showing detail information of my data
    ///====================================
    <uc1:DetailControl id="DetailControl1" runat="server"></uc1:DetailControl>
    </td>
    </tr>
    </table>
    </TD>
    </TR>
    </TBODY>
    </TABLE>
    <script language="javascript">
    function defineTop()
    {
    Layer1.style.left=6;
    Layer1.style.top=thebody.scrollTop+10;

    }
    </script>
    </FORM>
    </body>
    </HTML>//=============================================================
    according to my debug, i find these ,
    page_load
    DetailControl_page_load
    NewWeeklyControl_Button1_Onclick
    .....but i need showing the detail information after updating data ,
    so how to do that or any method could resolve that problem?thx  saucer
      

  2.   

    Page_Load will always run before OnClick, consider to resign your code, are you using if (!Page.IsPostBack)
    {
     //display your data
    }in your DetailControl_page_load?
      

  3.   

    If i put the code of displaying my data in !IsPostBack,
    it will not rebound data in the detail control, so the data will never be refreshed.plz give me another method..