Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 24-Mar-11 2:08am
v2

1 solution

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.
 
Share this answer
 
Comments
mohammad ayyash 24-Mar-11 12:29pm    
i need example about javascript or any solve for this problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900