将DropDownlist连接到TextBox [英] DropDownlist connected to a TextBox

查看:64
本文介绍了将DropDownlist连接到TextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我们可以解释一下我如何创建绑定到mySql数据库字段的DDL,该DDL更新连接到同一数据库的textBox吗?
这是代码:

Hi Folks,

may we explain me how I do for to create a DDL, binded to a mySql database field, that update a textBox connected to a same database?
Here is the code:

<![CDATA[<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>]]>
<![CDATA[<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>]]>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:dropdownlist id="DropDownList1" runat="server" datasourceid="SqlDataSource1" xmlns:asp="#unknown">
DataTextField="sku" DataValueField="cod_sezione" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged"&gt;
</asp:dropdownlist><asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="&lt;%$ ConnectionStrings:scartoprodottoConnectionString %&gt;" xmlns:asp="#unknown">
ProviderName="&lt;%$ ConnectionStrings:scartoprodottoConnectionString.ProviderName %&gt;"
SelectCommand="SELECT * FROM products"&gt;
</asp:sqldatasource>
<br />
<br />
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox>
</div>
</form>
</body>
</html>



非常感谢's



Many thank''s

推荐答案

ConnectionStrings:scartoprodottoConnectionString%& gt;" xmlns:asp =" > ProviderName =& lt;%
ConnectionStrings:scartoprodottoConnectionString %&gt;" xmlns:asp="#unknown"> ProviderName="&lt;%


ConnectionStrings:scartoprodottoConnectionString.ProviderName%& gt;" SelectCommand ="SELECT * FROM产品"& gt; < /asp:sqldatasource > < br > < br > < asp:textbox id =" runat 服务器" xmlns:asp #unknown" < /asp:textbox > < /div > < /form > < /body > < /html >
ConnectionStrings:scartoprodottoConnectionString.ProviderName %&gt;" SelectCommand="SELECT * FROM products"&gt; </asp:sqldatasource> <br /> <br /> <asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox> </div> </form> </body> </html>



非常感谢



Many thank''s


请不要按ANSWER提出更多问题.这真的很简单,该事件是离开"之类的事件,您可以对其进行处理,然后在控件中获取新文本并将其移至列表中.除了我看到您已将帖子更改为包括代码之外,我回答的核心问题是您最初并没有费心告诉它它是ASP.NET.在那种情况下,事件很模糊,我希望您需要编写JavaScript来完成您想要的事情.最好只使用组合框.
Please don''t push ANSWER to ask more questions. It''s really simple, the event is Leave or something, and you handle it, and then grab the new text in the control and move it to the list. Except I see that you have changed your post to include code, and your core issue with my answer is that you didn''t initially bother to tell is it was ASP.NET. In that case, the event IS blur, and you need to write javascript to do what you want, I expect. You''re probably better off just using a combobox.


这篇关于将DropDownlist连接到TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆