Possible to pass parameters from web user control client-side to server

Discussion in 'ASP .Net' started by Henke, Dec 2, 2003.

  1. Henke

    Henke Guest

    How can data be passed to the server when an event is fired in client-side
    jscript, ie on a drop event?
    I have tried using hidden fields and submitting the page, but for some
    reason I can't access a html hidden field that is set to run as server
    control.
    Please can someone point me in the right direction here?

    /Henke
    Henke, Dec 2, 2003
    #1
    1. Advertising

  2. Henke

    anon Guest

    Not sure if this will help...

    If you have set the HTML control as hidden
    via .Visible=false then .Net won't load its new value on
    postback.

    Try hiding the control via its style property instead and
    it should be populated with the new value on postback.


    >-----Original Message-----
    >How can data be passed to the server when an event is

    fired in client-side
    >jscript, ie on a drop event?
    >I have tried using hidden fields and submitting the page,

    but for some
    >reason I can't access a html hidden field that is set to

    run as server
    >control.
    >Please can someone point me in the right direction here?
    >
    >/Henke
    >
    >
    >.
    >
    anon, Dec 2, 2003
    #2
    1. Advertising

  3. Henke

    Henke Guest

    Thanks for your answer, but the problem is that when I try to access the
    <INPUT> that should be populated with the new value I get:
    ....document.forms[0].hidden is null or not an object... It seems that when I
    set it run as a server object it can't be access on the client side. This
    happens only if the control is used on a WebUserControl not on a WebForm.
    /Henke

    "anon" <> skrev i meddelandet
    news:0b2801c3b8ce$a07c99c0$...
    > Not sure if this will help...
    >
    > If you have set the HTML control as hidden
    > via .Visible=false then .Net won't load its new value on
    > postback.
    >
    > Try hiding the control via its style property instead and
    > it should be populated with the new value on postback.
    >
    >
    > >-----Original Message-----
    > >How can data be passed to the server when an event is

    > fired in client-side
    > >jscript, ie on a drop event?
    > >I have tried using hidden fields and submitting the page,

    > but for some
    > >reason I can't access a html hidden field that is set to

    > run as server
    > >control.
    > >Please can someone point me in the right direction here?
    > >
    > >/Henke
    > >
    > >
    > >.
    > >
    Henke, Dec 2, 2003
    #3
  4. Henke

    anon Guest

    If you just want to pass the value to the client script
    take a look at

    Page.RegisterHiddenField

    If you need the field to be posted back too then use the
    style attribute to hide the control.

    D
    >-----Original Message-----
    >Thanks for your answer, but the problem is that when I

    try to access the
    ><INPUT> that should be populated with the new value I get:
    >....document.forms[0].hidden is null or not an object...

    It seems that when I
    >set it run as a server object it can't be access on the

    client side. This
    >happens only if the control is used on a WebUserControl

    not on a WebForm.
    >/Henke
    >
    >"anon" <> skrev i

    meddelandet
    >news:0b2801c3b8ce$a07c99c0$...
    >> Not sure if this will help...
    >>
    >> If you have set the HTML control as hidden
    >> via .Visible=false then .Net won't load its new value on
    >> postback.
    >>
    >> Try hiding the control via its style property instead

    and
    >> it should be populated with the new value on postback.
    >>
    >>
    >> >-----Original Message-----
    >> >How can data be passed to the server when an event is

    >> fired in client-side
    >> >jscript, ie on a drop event?
    >> >I have tried using hidden fields and submitting the

    page,
    >> but for some
    >> >reason I can't access a html hidden field that is set

    to
    >> run as server
    >> >control.
    >> >Please can someone point me in the right direction

    here?
    >> >
    >> >/Henke
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >
    anon, Dec 3, 2003
    #4
    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