单击按钮或图像按钮时不刷新

单击按钮或图像按钮时不刷新

本文介绍了单击按钮或图像按钮时不刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何当我点击一个按钮或ImageButton然后页面没有刷新。我也使用更新面板在服务器上不起作用。感谢asp.net2008的答案

how to When I click on a button or ImageButton then the page is not refreshed.I also used the update panel does not work on server.Thanks for the answer with asp.net2008

推荐答案

<asp:UpdatePanel ID="UpdatePanelID" runat="server">
   <ContentTemplate>


            //YOUR Image Button/Button

   </ContentTemplate>
                <Triggers>
                         <asp:AsyncPostBackTrigger ControlID="Button/imageButtonID" EventName="Click" />
                </Triggers>
 </asp:UpdatePanel>







希望它会有所帮助.. :)




Hope it will help.. :)


  <asp:updatepanel id="UpdatePanel2" runat="server" xmlns:asp="#unknown">
    <contenttemplate>
        <div>
            <asp:textbox id="editor" runat="server" cssclass="bord" width="40%" maxlength="80">
                ValidationGroup="1" TabIndex="1"></asp:textbox>
        </div>
<pre lang="vb"><asp:Button ID="Button1" runat="server" Text="send " OnClick="Button1_Click"
              CssClass="btn" Width="10%" ValidationGroup="1"/>









align =center>

< asp:imagebutton id =ImageButton1runat =serverimageurl =〜/ yahoo / 1.gifonclick = ImageButton1_Click>

< asp:imagebutton id =ImageButton2runat =serverimageurl =〜/ yahoo / 2.gifimag ealign =中>

OnClick =ImageButton2_Click/>


align="center">
<asp:imagebutton id="ImageButton1" runat="server" imageurl="~/yahoo/1.gif" onclick="ImageButton1_Click">
<asp:imagebutton id="ImageButton2" runat="server" imageurl="~/yahoo/2.gif" imagealign="Middle">
OnClick="ImageButton2_Click" />





<触发器> < asp:asyncpostbacktrigger controlid =ImageButton1eventname =Click>





标签会显示内容TextBox



<triggers> <asp:asyncpostbacktrigger controlid="ImageButton1" eventname="Click">


The labels will show you the contents of the TextBox

 public string chg(string s)
        {

            s = s.Replace("[a]","<img src="yahoo/1.gif">");
            s = s.Replace("[b]", "<img src="yahoo/2.gif">");
   return s;
        }
label.text=user + ":" + chg(editor.Text.ToString());
</img></img>



我在服务器主机上的客户端的updatepanel上,但你没有
如何jquery或javascript不刷新到页面。


I was on a updatepanel the client from the server host, but you do not
how to jquery or javascript doesnot refresh to page.



这篇关于单击按钮或图像按钮时不刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 08:54