Problem with page post back
-
I have a web page with a table with in a scroll pane that lists a selection of data from a database. They can set different parameters to filter the results shown. via a series of pop up selections like a calendar to set the date and so on. Then they can click a button to refresh the results in the table. Obviously I want to check to make sure that the values they have selected are in the correct format so i added this code to the button that they press to do the update. The problem was that it was updating the whole page and reseting the textboxes to their default values. I then added an ajax update panel and script manager and the panel holds the table where the results are displayed so it only updates this on the screen. The problem now is that it ignores the validation. Thank you in advance :)
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
-
I have a web page with a table with in a scroll pane that lists a selection of data from a database. They can set different parameters to filter the results shown. via a series of pop up selections like a calendar to set the date and so on. Then they can click a button to refresh the results in the table. Obviously I want to check to make sure that the values they have selected are in the correct format so i added this code to the button that they press to do the update. The problem was that it was updating the whole page and reseting the textboxes to their default values. I then added an ajax update panel and script manager and the panel holds the table where the results are displayed so it only updates this on the screen. The problem now is that it ignores the validation. Thank you in advance :)
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
lose the AJAX, do validation on the client side, in javascript, and use a !IsPostback block to stop your code from resetting the values on every postback.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
-
lose the AJAX, do validation on the client side, in javascript, and use a !IsPostback block to stop your code from resetting the values on every postback.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
ditched the ajax and added the !IsPostBack but it is still resetting all the text boxes to their default values. I think i've found out why in that i'm using javscript to get a value from a popup window and everytime the button to refresh the table is pressed it goes through the javascript functions. Thanks for the help
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson