在ListBox和ListView在中间放按钮点击传值怎么做???

来源:百度知道 编辑:UC知道 时间:2024/05/18 16:45:19
两个ListBox中间放两个按钮互相间点击传值,很好做,可是如果换成ListBox和ListView之间通过点击按钮传值该怎么做列?最好能有关键代码!
希望高手能帮忙!
可是我没学过ASP 怎么办!

WINFORM or WEBFORM???

WINFORM 应该不会有这样的问题

我这里说下WEBFORM的

比如listbox双击添加到listview

ASP.NET的listbox是没有双击事件的,自己写一个

在aspx页面中 添加ListBox 控件再添加如下代码:

<asp:ListBox ID="ListBox1" runat="server" Height="146px" Width="313px"></asp:ListBox>
<input id="Dbclickflag" type="hidden" value="false" name="Dbclickflag" runat="server">
<script language="vbscript">
option explicit
sub ListBox1_ondblclick()
Form1.Dbclickflag.value="true"
Form1.submit()
end sub
</script>

CS文件代码:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
if (Dbclickflag.Value == "true")
ListBox_Dbclick();
}
}