1
我有2个asp列表框控件和一个html输入按钮,并使用JS我添加项目(以前从DB加载项目)从列表框A到B,它工作正常,但是当我提交表单,在列表框B后面的代码中没有添加可访问的项目。listbox和javascript添加项目
我的想法是试图保存往返服务器,并在客户端,但看起来不起作用。
任何想法?
非常感谢你的时间!
编辑
有代码
<asp:ListBox ID="lstBoxOrgs" runat="server" Height="117px" Width="502px" SelectionMode="Multiple"></asp:ListBox>
<input type="button" value="Add" onclick="AddItems2Listbox('lstBoxOrgs', 'lstBoxUserRelOrgs') "/>
后面的代码:
protected void AssignOrgs_Click(object sender, EventArgs e)
{
foreach (ListItem orgItem in lstBoxUserRelOrgs.Items)
{
//Update database here...
}
//Commit updates to DB
cdc.SubmitChanges();
}
的onclick="AddItems2Listbox('lstBoxOrgs', 'lstBoxUserRelOrgs')
是,其将从lisbox A中的项目列表框B. JavaScript函数
Th anks
请添加您的代码(或简单的例子),然后我们更容易帮助您。 – 2009-10-27 10:00:12