Communicating client side information to the server - HTML controls vs Server controls

  • Thread starter Thread starter Emily
  • Start date Start date
E

Emily

Hi,
I'm quite new at this ASP.NET stuff and come from a jsp/java background. I
keep hitting a wall when I try to communicate information between the client
(user input) and the server.
Here's what I am trying to do: I need to collect a piece of information
(data set size limit) and use it to perform a query. I decided on a popup
window since there are 3 options the user can choose from along with an
input box.
In my experience I use javascript to popup a dialog. To do that, it appears
I must make the button that exposes this popup an HTML button that therefore
cannot do any server side work. Ok....so if I make the popup contain all
HTML controls and I collect the information from the user. I communicate it
back to the main page (still using javascript), but then I cannot access the
input containing the data at the server because it's contained in an html
control ( so javascript could access it ).
If I make the popup contain all server side controls, I still don't know how
to get the information entered by the user back to the main page to be used
there. Redirect opens a new instance of the page, and I don't want that.
There seems to be a huge gap when it comes to passing information between
pages and then on to the server.
As I said, I am quite new at this and it seems to me I must be missing
something key. Anyone who could shed some light on this for me, I would
great appreciate it!

Thanks!
Emily
 
I might not have understood your question completely but as far as I did
here it is:

1. No matter if you want to use Server control or HTML. If you have the.ID
property of the server textbox you should have it as html input with id in
the rendered html page.
2. So from your popup you can access the opener windows control values as
well. Like window.opener.document.getElementById("controlname").value =
"foo"

Or you can have a javascript function do it for you in your main
(opener) page. Just call that javascript function from popup.
Like window.opener.document.function(val1,val2)

So you can have both server and/or client side control do the job for you.

Hope this helps!
Harman Sahni
 
Back
Top