Client-Side and Server-Side Control

Discussion in 'ASP .Net Web Controls' started by Ogre, Apr 26, 2004.

  1. Ogre

    Ogre Guest

    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.
    Ogre, Apr 26, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
    Victor Garcia Aprea [MVP], Apr 27, 2004
    #2
    1. Advertising

  3. Ogre

    Ogre Guest

    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?
    Ogre, Apr 28, 2004
    #3
  4. Well, you can simply use Page.Request.Params["txtBox"] to get the actual
    value sent to the page.

    Fred

    "Ogre" <> wrote in message
    news:...
    > 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?
    Fred Hirschfeld, Apr 28, 2004
    #4
  5. Ogre

    David Jessee Guest

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


    "Ogre" <> wrote in message
    news:...
    > 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.
    David Jessee, Apr 29, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page