刷新ASP网络中的页面或组合框 [英] Refresh page or combobox in asp net

查看:62
本文介绍了刷新ASP网络中的页面或组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好;

我需要一个示例,当用户在form2中添加新项目时,如何刷新form1中的组合框
例如:-
我需要在关闭此表单时在form2中添加新城市.我想在组合框无提示刷新页面中添加新项目.

hello;

I need example how to refresh combo box in form1 when the user add new item in form2
ex:-
I need add new city in form2 when close this form I want to add new item in combobox whitout refresh page

推荐答案

因为asp.net每页只允许1个表单声明我必须假设您所指的是不同的窗口,并且希望在一个窗口中选择某些内容并在另一个窗口中进行反映.

现在,最流畅的解决方案是使用javascript和一个名为lightbox的应用程序(它的窗口弹出窗口非常干净整洁.然后使用javascript根据选择进行传输.

另一个更高级的选项是使用Web服务和javascript,当在表2中选择一个对象时,它会设置一个Session变量,然后在表1中使用java-script Interval方法在该Web服务中运行一个方法,该方法将寻找该saeeion变量更改.但这要复杂得多,对于一个简单的应用程序来说可能会显得过分.
Because asp.net only allows 1 form declaration per page I have to assume you are referring to different windows and you wish to select something in one window and have it reflect in the other.

Now the sleekest solution would be to use javascript and a application called lightbox (its a kind of window popup very clean and neat. then use javascript to do the transfer based on the selection.

The other bit more advanced option would be using a web service and javascript, when an object is chosen in form 2 it sets a Session variable , then in form 1 use a java-script Interval method to run a method in the web service that will look for that saeeion variable change. but this is far more complicated and will be overkill for a simple app.


这篇关于刷新ASP网络中的页面或组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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