2013-04-10 27 views
0

點擊按鈕功能不會被解僱。爲什麼發生這種情況。如何在asp.net中使用updateprogress控件綁定函數處理?

<asp:ScriptManager ID="ScriptManager1" runat="server"> 
</asp:ScriptManager> 

<asp:UpdateProgress ID="UpdateProgress1" runat="server" 
        AssociatedUpdatePanelID="UpdatePanel1"> 
    <ProgressTemplate> 
     <asp:Image ID="Image1" runat="server" 
        ImageUrl="~/images/ajax-progress.gif" 
        /> 
       <br /> 
       Please Wait. This will take few minutes. 
    </ProgressTemplate> 
</asp:UpdateProgress> 

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
    <ContentTemplate> 
     <asp:Button ID="btnUpdate" runat="server" 
        Text="Update" 
        onclick="btnUpdate_Click" 
        Width="100px" /> 
    </ContentTemplate> 
</asp:UpdatePanel> 

後面的代碼:

protected void btnUpdate_Click(object sender, EventArgs e) 
{   
    trunc(); 
    ConsumerUpld(FileUpload1);  
} 

ConsumerUpld(fileupld)功能更新表數據庫

回答

0

一切縫細,讓我由一個btnUpdate.Text = "updated";

protected void btnUpdate_Click(object sender, EventArgs e) 
{ 
    btnUpdate.Text = "updated"; 
    //trunc(); 
    //ConsumerUpld(FileUpload1); 
} 
取代它測試你的代碼

一切運行平穩,所以你的問題是你所調用的2個功能之一。

當在異步回發期間發生錯誤時,它會在瀏覽器頁面的按鈕上顯示(它顯示的方式取決於您的瀏覽器)。您應該嘗試使用斷點進行調試,或者註釋更新面板以查看發生了什麼。

相關問題