+1  A: 

Wow the way you are doing this may make sense in PHP but it is as far as you can get from webforms assuming that is what you are using.

If you are familiar with PHP I'd recommend using ASP.Net MVC over webforms but from the sound of what you are saying you've already started down the road of webforms.

The simplest way of taking what you have there and turning it into something that will work is first to start using jQuery because it will save you time with javascript, then remove the OnLoadEvent function from your aspx and use the script manager to register it in your code behind. In your javascript function you can then change the value of the hidden fields before submitting.

Although having said that, you are better off redesigning the page to work better with asp.net webforms. You could have the entire flow done on one page if necessary, using updatepanels or postbacks to update the screen. I'd recommend having a look at sample asp.net code and seeing how flow is handled because it's very different and will take a bit of getting used to.

Stephen lacy
i can't use asp.net MVC, have to plug it into existing application.and, as i said, there is no sample asp.net code for this application
alex
No I mean that you need to look at c# code written by a c# coder, any code, just to learn the way it is written. Not enough to know what it can do or the syntax, also need to learn the style.WebForms are written very similarly to a WinForms (Windows application). They handle events more so than page requests.
Stephen lacy