惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
H
Help Net Security
小众软件
小众软件
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
Last Week in AI
Last Week in AI
爱范儿
爱范儿
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
博客园 - 【当耐特】
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
博客园_首页
Jina AI
Jina AI
D
Docker
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志

博客园 - laughterwym

edwin-wang.com GridView mouseover的高亮 GridView vs DataGrid 来句老套的~~~Happy 牛 Year !!! Grub vga模式 个人常用软件替代列表,支持开源 One more time, One more chance 获得Access数据表名列表 初面纪念 关于Windows 2003 ".." 表示父路径解决方法 Windows 2003 SD读卡器驱动方法 关于水晶报表分页统计的开发经验 残败的考试 一段时间的忙碌…… Standards: big benefits for small business 国庆、中秋快乐!!! 2 weeks later 2周,开始忙碌中适应这里的生活了……累 I Do Believe
Autopostback提示“该对象不支持此属性或方法”(Object doesn'...
laughterwym · 2008-12-23 · via 博客园 - laughterwym

在公司调试没有问题,回家改了些许东西,居然DropDownList的Autopostback不起作用了。。。郁闷,google了下。。。

google到的一个问题问题找到了,原来是最后第二行有个  
  <asp:button   id="submit"   Runat="server"   Text="添   加"></asp:button>  
  <asp:Button   id="submit"..>     ====>       变成   <asp:button..>了  
  晕死,后台里又有   protected   System.Web.UI.WebControls.Button   submit;   这个东西的,而且   submit   按钮功能一切正常,谁会想到是这个原因。

 没找到目标。。。

 1    <div class="font">
 2        <asp:Label ID="Label1" runat="server" Text="Label" ForeColor="Aqua"></asp:Label><br />
 3        Test Project:
 4        <asp:DropDownList ID="listTestProj" runat="server" AutoPostBack="true">
 5        </asp:DropDownList>
 6        <br />
 7        Test Plan:
 8        <asp:DropDownList ID="listTestPlan" runat="server" AutoPostBack="true">
 9        </asp:DropDownList>
10        <br />
11        <asp:Button ID="submit" runat="server" Text="Submit" OnClick="Do_Click" />
12    </div>

最后一一比对了修改处,发现问题出在Button上,我定义其ID为submit,修改为Do就没有问题了。

 1   <div class="font">
 2       <asp:Label ID="Label1" runat="server" Text="Label" ForeColor="Aqua"></asp:Label><br />
 3       Test Project:
 4       <asp:DropDownList ID="listTestProj" runat="server" AutoPostBack="true">
 5       </asp:DropDownList>
 6       <br />
 7       Test Plan:
 8       <asp:DropDownList ID="listTestPlan" runat="server" AutoPostBack="true">
 9       </asp:DropDownList>
10       <br />
11       <asp:Button ID="Do" runat="server" Text="Submit" OnClick="Do_Click" />
12   </div>

估摸着应该是asp.net要求asp.net空间需要放在runat server的form,而form的提交默认为button的submit的缘故。莫名死了。。。