-1

I am using two tabs in my page like the attached image.

Controls with two tabs.

Here, after selecting the value in all dropdownlist controls then, i click the generate button. so, the tab is moved from parameter to report. Then again i click the parameter tab. At this time all my dropdown controls shows null value.

but I want all the dropdown values which i selected before.

how can i get the dropdown control values?

Matthew Haugen
  • 12,916
  • 5
  • 38
  • 54
BAGAVATH
  • 23
  • 2
  • 6

1 Answers1

0

It's important to remember that web pages like this are stateless. One request won't remember anything about another request.

So in your situation, you're putting in data, then it sounds like you're clicking a link (or button) that redirects you to another page, then you try and go back to the first one, and it has to fire off yet another request, with no knowledge of the first one's state.

Given that, it seems like you have two primary options (and dozens of others that I won't bother mentioning):

  1. Move the tabs to be on the same page. (My recommendation)

    There are lots of controls out there, or you could easily write one yourself, that don't separate tab pages via multiple requests. If you did that, switching tabs wouldn't lose the data.

  2. Add a "save" button, and disable the other tab.

    This way, the user actively has to save the data before being able to leave the page via another tab. The biggest issue here comes in the form of usability.

Which one of those you choose is dependent on a number of factors, not the least of which being code maintainability and the size of requests.

Matthew Haugen
  • 12,916
  • 5
  • 38
  • 54