2011-05-16 53 views

回答

2

好吧,我不知道哪来在于你的问题,但是这个工作对我来说有一个简单的代码

<div> 
    <asp:ScriptManager ID="sm" runat="server" EnablePageMethods="true" EnablePartialRendering="true"> 
    </asp:ScriptManager> 
    <div id="result"> 
     <asp:UpdatePanel runat="server" EnableViewState="false" ID="udpnl" UpdateMode="Conditional"> 
      <ContentTemplate> 
       <asp:Button runat="server" ID="btn" Text="UnClicked" OnClick="btn_click" /> 
      </ContentTemplate> 
     </asp:UpdatePanel> 
     <input type="button" value="DoPartialPost" onclick="__doPostBack('btn','')" /> 
    </div> 

后面的代码

protected void Page_Load(object sender, EventArgs e) 
    { 

    } 

    protected void btn_click(object sender,EventArgs e) 
    { 
     btn.Text = "Clicked"; 
     udpnl.Update(); 
    } 
+0

足够简单和工程!非常感谢。 – 2013-02-13 09:48:11