代码大,没法贴
不知道什么原因

解决方案 »

  1.   

    input type="button"??
    input type="submit"??
    asp:button/linkbutton/imagebutton????
      

  2.   

    不提供资料,叫我们如何判断原因
    你可以把相关Button代码贴出来我们参考一下
      

  3.   

    右键BUTTON属性点事件为button指定事件
    代码太长你可以贴你button的html代码
      

  4.   

    加 runat="server"  生成网站生成解决方案重新试试
      

  5.   

    如果你用的是服务器端控件,是不是加了onclientclick如果是检查一下onclientclick返回的是什么值,
    还有检查一下你的onclcick本身的事件
      

  6.   

    服务器控件?input?稍微描述一下嘛,这样怎么给你判断呢
      

  7.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="zhuangxiu_rukou1.aspx.cs" Inherits="zhuangxiu_rukou1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table align="right" border="0" cellpadding="0" cellspacing="0" width="99%">
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td class="title" height="24">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <tr bgcolor="#f1f1f1">
                                        <td bgcolor="#f8f8f8" height="30" width="19">
                                        </td>
                                        <td bgcolor="#f8f8f8" class="news_list_rihgt_top" width="91">
                                            信息登记</td>
                                        <td bgcolor="#f8f8f8" width="548">
                                            (标 <font color="#ff0000">*</font> 为必填项)</td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <table align="center" border="0" bordercolordark="#ffffff" bordercolorlight="#cccccc"
                                cellpadding="3" cellspacing="2" class="txt2" width="95%">
                                <form method="post" name="form1119">
                                </form>
        </form>
                                <tbody>
                                    <tr bgcolor="#f2fbe1">
                                        <td bgcolor="#e6f0fc" class="blue">
                                            您所在区县
                                        </td>
                                       。。
                                    <tr valign="bottom">
                                        <td colspan="2" style="height: 20px">
                                            <div align="center">
                                                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="提交" />
                                                &nbsp;
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        
        </div>
    </body>
    </html>
      

  8.   

          Button1.Click+=new EventHandler(Button1_Click);
      

  9.   


    我用的是.NET 05,上面的代码怎么添加呀
      

  10.   


    ASP.NET 2.0不需要這樣寫的,你寫了OnClick="Button1_Click1"並且存在Button1_Click1方法就可以了。不過為什麼是Click1不是Click呢?你確定不是拼寫錯誤?
      

  11.   

    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="提交" /> 你code-behind中应该还有一个方法 Button1_Click
      

  12.   

    拜托,你这个代码是HTML,你加了asp:Button也没用,因为你连<script>都没有,上下文没有定义好事件,你点击按钮要实现什么功能呢?
      

  13.   

    在cs文件里找你写的那个事件的名称是不是这个Button1_Click1
      

  14.   

    <%@ Page Language="C#"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
       void Button1_Click1(Object Sender, EventArgs e)
       {
          Message1.Text="你填写了信息登记:"+Text1.Text+" 和您所在区县: "+Text2.Text;
       }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页 </title>
    </head>
    <body>
    <asp:label id="Message1" runat="server"></asp:label><br/><br/>
        
        <div>
            <table align="right" border="0" cellpadding="0" cellspacing="0" width="99%">
                <tbody>
                <form id="form1" runat="server">
                    <tr>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td class="title" height="24">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <tr bgcolor="#f1f1f1">
                                        <td bgcolor="#f8f8f8" height="30" width="19">
                                        </td>
                                        <td bgcolor="#f8f8f8" class="news_list_rihgt_top" width="91">
                                            信息登记 </td>
                                        <td bgcolor="#f8f8f8" width="548">
                                            (标 <font color="#ff0000"><asp:TextBox id="Text1" runat="server"></asp:TextBox></font> 为必填项) </td>
                                    </tr>
                                    
                                </tbody>
                                
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp; </td>
                    </tr>
                    <tr>
                        <td>
                            <table align="center" border="0" bordercolordark="#ffffff" bordercolorlight="#cccccc"
                                cellpadding="3" cellspacing="2" class="txt2" width="95%">
                                
      
                                <tbody>
                                    <tr bgcolor="#f2fbe1">
                                        <td bgcolor="#e6f0fc" class="blue">
                                            您所在区县
                                        </td>
                                      。。
                                      <asp:TextBox id="Text2" runat="server"></asp:TextBox>
                                    <tr valign="bottom">
                                        <td colspan="2" style="height: 20px">
                                            <div align="center">
                                                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="提交" />
                                                &nbsp;
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                                </form>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
       
        </div>
    </body>
    </html> LZ,按照上面的代码改一改就行了,我这个可以通过编译。
      

  15.   

    我被ASP.NET论坛管理员闭屏了!!!!刚换了个浏览器才登上,又没做错什么,严重抗议!!!!
      

  16.   

    可能原因:1.你的click事件没有关联上,重新双击button,然后把要执行的操作copy到新生成的事件中;2.打断点,查看你点击button的时候所执行的所有操作中有没有抛出异常,被你catch了,但是catch里没有做处理,这样也可能出问题但是click没有响应;3.如果涉及到数据绑定的话在执行了submit之后是否重新绑定了控件,如果没有当然还是会显示原来的样子,看似没有响应了
      

  17.   

    public partial class zhuangxiu_rukou : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {    }
       
       
        protected void Button1_Click1(object sender, EventArgs e)
        {
            if ("" == Name.Value.ToString())
            {
                Response.Write("<script>alert('请按要求输入');</script>");
                Response.Write("<script>history.go(-1);</script>");
                Response.End();
    }}上面是我的CS里面的代码,双击后定位到该函数,没问题的
    但是执行的时候,压根就不调用
      

  18.   


    if ("" == Name.Value.ToString()) //这句拦住了
    protected void Button1_Click1(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Name.Value.ToString()))
            {
                Response.Write(" <script>alert('请按要求输入'); </script>");
                Response.Write(" <script>history.go(-1); </script>");
                Response.End();
            }
            else 
            {
                Response.Write(" <script>alert('Name不为空'); </script>");
                //Go ahead.
            }
        } 
      

  19.   

    哎呀神奇了 你的button不放在form里面 不报错的吗???
      

  20.   

    1.
    protected void Button1_Click1(object sender, EventArgs e)
        {
             // Name 是控件吗?先注释掉
             Response.Write("看你行不行!!!");
            /* if ("" == Name.Value.ToString())
            {
                Response.Write(" <script>alert('请按要求输入'); </script>");
                Response.Write(" <script>history.go(-1); </script>");
                Response.End();
            } */ 
    }
    2. 在这个函数内打个断点,然后 Debug 菜单 > Start,看进得去不?
      

  21.   

    没有关联click事件
    form
    runat="server"
      

  22.   

    1.群众的眼睛是雪亮的 !2.form 标签没匹配<form id="form1" runat="server">
        <div>
            <table align="right" border="0" cellpadding="0" cellspacing="0" width="99%">
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td class="title" height="24">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <tr bgcolor="#f1f1f1">
                                        <td bgcolor="#f8f8f8" height="30" width="19">
                                        </td>
                                        <td bgcolor="#f8f8f8" class="news_list_rihgt_top" width="91">
                                            信息登记 </td>
                                        <td bgcolor="#f8f8f8" width="548">
                                            (标 <font color="#ff0000">* </font> 为必填项) </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp; </td>
                    </tr>
                    <tr>
                        <td>
                            <table align="center" border="0" bordercolordark="#ffffff" bordercolorlight="#cccccc"
                                cellpadding="3" cellspacing="2" class="txt2" width="95%">
                                <form method="post" name="form1119">
                                </form>
    <!--    </form> -->
                                <tbody>
                                    <tr bgcolor="#f2fbe1">
                                        <td bgcolor="#e6f0fc" class="blue">
                                            您所在区县
                                        </td>
                                      。。
                                    <tr valign="bottom">
                                        <td colspan="2" style="height: 20px">
                                            <div align="center">
                                                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="提交" />
                                                &nbsp;
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
       </form>
        </div>
    </body>
    </html> 
      

  23.   

    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="提交" />你的事件是写在Button1_Click1里面 还是写在Button1_Click里面 要确定
      

  24.   

    实在Button1_Click1里面 没问题,双击后都能定位到函数里,但是不执行
      

  25.   

    我遇到过的  你看下 aspx.cs文件里面的啊  那个 命名空间对不?
      

  26.   

    form也能嵌套? 还真没试过
      

  27.   

    明白额,是里面有多个FORM的事情
      

  28.   

    button的响应函数太消耗资源了就会这样
      

  29.   

    首先.<form method="post" name="form1119"> </form> </form>此处的form结束标记应挪到下头</div>处吧其次.protected void Button1_Click1(object sender, EventArgs e) 中的Name是什么东东?