Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

retain value

Posted on 2011-09-14
10
Medium Priority
?
324 Views
Last Modified: 2012-05-12
I have a user.aspx page that has grid and combobox, which combobox has static Please Select and dynamic items comes from datasource.. Grid gets populated based on the value selected from combobox. When row gets clicked windows opens up (windowUser.aspx) we can update that selected record, when it is updated windows closes and page goes back to user.aspx page, but it shows Please Select again.. I want it to show the value user selected, basically combobox should retain the value when return the page after updating the record from windows.aspx page.. what I need to do?
0
Comment
Question by:1jaws
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 7

Assisted Solution

by:Bill Nolan
Bill Nolan earned 1000 total points
ID: 36538904
when you say "window opens up" you are changing pages, correct?

Two solutions:

1) make your user UI a popup menu that belongs to the orginal page, and use ViewState to hold the selected user.
2) persist the selected user value elsewhere (e.g., to Session variable) and initialize the combox box on the user page as approrpriate
0
 

Author Comment

by:1jaws
ID: 36538955
ok, first one wouldnt work.. I'll go with second one.. can you be more specific a little bit, perhaps little example for me to visualize..would appreacite it...
0
 
LVL 7

Expert Comment

by:Bill Nolan
ID: 36539502
Syntax may not be exact...

Session["userID"] = ComboBox.GetSelectedValue();

ComboBox.SetSelectedValue(Session["userID"]);
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:1jaws
ID: 36539559
how about something like this??

passing  selected country combobox  value from user page on code behind to second page(window) and  
on javascript  when window closes pass that value back to first page again..
 winUser.NavigateUrl =xxx.aspx?id=" + dataKey["id"].ToString() + "&countryID ...

and how can I add add countryID to javascript function below after user.aspx?

 function OnClientClose(sender, eventArgs) {
                    var arg = eventArgs.get_argument();
                    if (arg) {
                        radalert("A custom argument was passed. Its value is: " + arg);
                    }
                    else {
                        window.location.href = "user.aspx";
                    }
0
 
LVL 7

Expert Comment

by:Bill Nolan
ID: 36539628
If you want to do it that way you have to access the combobox from jscript by its ID and get its selected value.  You have several solutions - syntax is up to you :)
0
 

Author Comment

by:1jaws
ID: 36539878
can you be able to add that correct snytax for me to to pass the countryID after aspx?
0
 
LVL 7

Expert Comment

by:Bill Nolan
ID: 36539907
Look up "access combobox from javascript".
0
 

Author Comment

by:1jaws
ID: 36540027
I need to set the value to combobox based on coountryID... that's what I need ..
0
 
LVL 60

Accepted Solution

by:
HainKurt earned 1000 total points
ID: 36540334
probably you are not using postback on popup close... use postback method, and make sure you rebind your data to your control based on posted values...
0
 

Author Closing Comment

by:1jaws
ID: 36540420
Yes, that was better HainKurt.. thanks both!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question