用户编号:<asp:TextBox ID="TextBox7" runat="server" Height="18px" Width="120px"
MaxLength="8" ></asp:TextBox>
<asp:Button ID="Button7" runat="server" Text="查 询" /></td>
<td>
片区:<asp:DropDownList ID="DropDownList6" runat="server" >
<asp:ListItem Value="100000" >01</asp:ListItem>
<asp:ListItem Value="200000" >02</asp:ListItem>
<asp:ListItem Value="200000" >03</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button6" runat="server" Text="查 询" /></td>
现在的情况是按哪个都能执行查询,而且
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList6" Name="i" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
这个查询在页面载入时就执行查询了,我希望按Button6后执行查询。下面这个应该在按Button7后执行查询。
<asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:zlsConnectionString7 %>"
<SelectParameters>
<asp:ControlParameter ControlID="TextBox7" Name="UserID" PropertyName="Text" />
</SelectParameters>
MaxLength="8" ></asp:TextBox>
<asp:Button ID="Button7" runat="server" Text="查 询" /></td>
<td>
片区:<asp:DropDownList ID="DropDownList6" runat="server" >
<asp:ListItem Value="100000" >01</asp:ListItem>
<asp:ListItem Value="200000" >02</asp:ListItem>
<asp:ListItem Value="200000" >03</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button6" runat="server" Text="查 询" /></td>
现在的情况是按哪个都能执行查询,而且
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList6" Name="i" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
这个查询在页面载入时就执行查询了,我希望按Button6后执行查询。下面这个应该在按Button7后执行查询。
<asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:zlsConnectionString7 %>"
<SelectParameters>
<asp:ControlParameter ControlID="TextBox7" Name="UserID" PropertyName="Text" />
</SelectParameters>
解决方案 »
- 服务器硬盘空间不够,新买了个,加上去之后如何管理?
- 一个简单的SQL查询语句.错在哪了呢?
- WebGrid复选框删除数据问题?(线上请教)
- 如何打印label中的内容?且如何分页?判断一页已满,在线等,马上结帖
- 求一SQL语句,谢谢!
- 内容重复提交!?
- asp.net问题求助!散分!
- 请教一些很基础的问题(请进来看问题)
- DataList如何统计出数据库的记录数,类似GridView.Rows.Count
- 哪位兄弟知道:VS.NET 中连Web Service的问题?
- HtmlInputFile问题
- 不好意思小弟向大家求助DATAGRID中单击选中一行以后,该行的数值传递给CHECKBOXLIST.
首先问题是你的数据绑定给谁没有定义。Button触发後已经不执行查询了。现在数据查询工作已经被Sqldatasourse做完了,关键是出力数据的绑定显示,这个工作由Button来做,所以哪个bUtton执行了DataBind()事件,就是哪个Button能够执行查询。