从弹出窗口向列表框中添加值 [英] adding values to list box from popup

查看:86
本文介绍了从弹出窗口向列表框中添加值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个页面中,我有一个列表框,在一个按钮上,单击我会显示一个弹出窗口,这是另一个aspx页面.

在该页面中,我显示一个带有复选框的网格

现在,我希望当用户选中复选框并单击添加"按钮时,当我单击页面上的保存"按钮(而不是弹出窗口)时,所选项目应添加到页面上的列表框中,该列表框中的所有记录应保存到数据库中.为此.

In one page I a have list box and on one button click I am showing a popup which is another aspx page.

In that page I''m showing one grid with check box

Now I want that when the user selects check boxes and click on add button selected items should gets added to list box on page when I click save button on page(not popup) all the records in that list box should gets saved to data base how to do this.

推荐答案



有三种方法可以解决此类问题.

一种方法.

通过使用ASP.NET的CrossPostBack功能,可以将一个aspx页面数据传递到另一页面.

通过ASP.NET中的CrossPostBack函数

http://msdn.microsoft.com/en-us/library/ms178139.aspx [ ^ ]

http://www.c-sharpcorner.com/UploadFile/DipalChoksi/xpgpostbk_asp2_dc08102006235543 /a> [ ^ ]

第二种方式.

不必在另一页中显示带有复选框的gridview,而是将其显示在同一页面中.通过单击gridview中选定项目的添加按钮,您可以将这些项目直接添加到同一页面本身的列表框中.

第三条路.

通过使用Session概念.

您可以将选中的复选框项放入会话中,然后在列表框页面中使用该会话变量.

http://www.codeproject.com/KB/aspnet/state_management_intro.aspx [ ^ ]


以上技术人员将解决您的问题.

如果您对此不满意,请告诉我.

问候,
Kiran.
Hi,

There are three ways to do this kind issues.

One Way.

By using CrossPostBack functionality of ASP.NET,you can pass the one aspx page data to another page.

Go through the CrossPostBack function in ASP.NET

http://msdn.microsoft.com/en-us/library/ms178139.aspx[^]

http://www.c-sharpcorner.com/UploadFile/DipalChoksi/xpgpostbk_asp2_dc08102006235543PM/xpgpostbk_asp2_dc.aspx[^]

Second Way.

Instead of displaying gridview with checkbox in another page,display it in same page.By clicking add button for selected items in gridview,you can directly add those items to listbox in the same page itself.

Third Way.

By using Session concept.

you can put the selected check box item in session,then use that session variable in listbox page.

http://www.codeproject.com/KB/aspnet/state_management_intro.aspx[^]


The above technies will solve your issue.

Still if you are not happy with this,let me know.

Regards,
Kiran.


如果您在弹出式表单中使用控件时遇到问题,请参考此链接-
使用弹出式表单中的控件 [ ^ ]
If you come across issues working with controls inside a popup form, then refer to this link -
Working with controls inside a pop-up form[^]


这篇关于从弹出窗口向列表框中添加值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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