<script language="javascript">
   function a(){
       window.document.Form1.="sssssssssss";//这句window.document.Form1.button6怎么就点不能出来呢(button6出不来,而且强行写进去报错)(其它的web组件也出不来)
   }
</script>

解决方案 »

  1.   

    呵呵,我很少用ASP.net,帮不上忙,帮你UP
      

  2.   

    在页面装载的服务器段代码里加上
    button6.attribute.add("onclick","return a()");
    大小写可能不正确
    试验看看
      

  3.   

    在asp.net里,后台写的控件编号和生成到前台的html控件里的编号是不一样的。
      

  4.   

    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication11.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML> <HEAD>
    <title>刷新</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">
    <script language="vbscript">
       function a(){
           window.document.Form1.all("Button6").text="sssssssssss";
       }
    </script>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <FONT face="宋体">
    <asp:button id="Button1" style="Z-INDEX: 101; LEFT: 232px; POSITION: absolute; TOP: 104px" runat="server"
    Text="测试" Width="112px" Height="32px"></asp:button><asp:button id="Button5" style="Z-INDEX: 110; LEFT: 360px; POSITION: absolute; TOP: 360px" runat="server"
    Text="删除" Width="112px" Height="32px"></asp:button><asp:button id="Button4" style="Z-INDEX: 109; LEFT: 360px; POSITION: absolute; TOP: 304px" runat="server"
    Text="修改" Width="112px" Height="32px"></asp:button><asp:textbox id="TextBox1" style="Z-INDEX: 102; LEFT: 64px; POSITION: absolute; TOP: 168px" runat="server"
    Width="152px" Height="24px"></asp:textbox></FONT><asp:button id="Button2" style="Z-INDEX: 103; LEFT: 232px; POSITION: absolute; TOP: 152px" runat="server"
    Text="刷新" Width="112px" Height="32px"></asp:button><asp:dropdownlist id="DropDownList1" style="Z-INDEX: 104; LEFT: 64px; POSITION: absolute; TOP: 40px"
    runat="server" Width="160px" Height="64px"></asp:dropdownlist><asp:datagrid id="DataGrid1" style="Z-INDEX: 105; LEFT: 64px; POSITION: absolute; TOP: 208px"
    runat="server" Width="280px" Height="192px"></asp:datagrid><asp:textbox id="TextBox2" style="Z-INDEX: 106; LEFT: 64px; POSITION: absolute; TOP: 128px" runat="server"
    Width="152px" Height="24px"></asp:textbox><asp:textbox id="TextBox3" style="Z-INDEX: 107; LEFT: 64px; POSITION: absolute; TOP: 80px" runat="server"
    Width="153px" Height="24px"></asp:textbox><asp:button id="Button3" style="Z-INDEX: 108; LEFT: 360px; POSITION: absolute; TOP: 248px" runat="server"
    Text="添加" Width="112px" Height="32px"></asp:button>
    <asp:Button id="Button6" style="Z-INDEX: 111; LEFT: 376px; POSITION: absolute; TOP: 160px" runat="server"
    Text="Button" Width="112px" Height="32px" OnClick="a()"></asp:Button>
    <asp:TextBox id="TextBox4" style="Z-INDEX: 112; LEFT: 384px; POSITION: absolute; TOP: 88px" runat="server"
    Width="152px"></asp:TextBox></form>
    </body>
    </HTML>
    asp 地式系统生成的,又问题嘛,楼上的,“后台写的控件编号和生成到前台的html控件里的编号是不一样的”这句怎么解释?我看到的是一样的阿