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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
H
Help Net Security
V
Visual Studio Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
The Cloudflare Blog
Martin Fowler
Martin Fowler
D
Docker
腾讯CDC
F
Fortinet All Blogs
雷峰网
雷峰网
GbyAI
GbyAI
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - 叶小钗

博客园 - 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的缘故。莫名死了。。。