Client-Side and Server-Side Control

O

Ogre

I need to access a control that's used client-side and server side. Is this possible? For example, I have an input box on a form that's manipulated using javascript. When the form is submitted, I need the code behind the page to be able to access that input box, but I can't find any way to get to it.
 
V

Victor Garcia Aprea [MVP]

Hi Ogre,

If you mean accesing any property for your server-side control in the
client-side then no, thats not possible without writing some (large)
ammount of code. The opposite isn't supported automatically also, that is,
accessing any client-side properties from the server-side. Note that this is
not supported out of the box just because at first it doesn't make much
sense, but if you have a need for this, nothing stops you from implementing
such support.

Note that in your example you don't need any additional support to get at
the text property from the client-side AND the server-side.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

Ogre said:
I need to access a control that's used client-side and server side. Is
this possible? For example, I have an input box on a form that's
manipulated using javascript. When the form is submitted, I need the code
behind the page to be able to access that input box, but I can't find any
way to get to it.
 
O

Ogre

So I CAN access the input box on the server? How is that? The input box is simply that: <INPUT name=txtBox>. How can the code access txtBox?
 
F

Fred Hirschfeld

Well, you can simply use Page.Request.Params["txtBox"] to get the actual
value sent to the page.

Fred

Ogre said:
So I CAN access the input box on the server? How is that? The input box
is simply that: <INPUT name=txtBox>. How can the code access txtBox?
 
D

David Jessee

Question. the Server-Side Textbox control ends up rendering a <input
type="text"> HTML element. Why can't you just use that?


Ogre said:
I need to access a control that's used client-side and server side. Is
this possible? For example, I have an input box on a form that's
manipulated using javascript. When the form is submitted, I need the code
behind the page to be able to access that input box, but I can't find any
way to get to it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top