WebControl.Style and ViewState

Discussion in 'ASP .Net Web Controls' started by Mesalem, Jul 19, 2005.

  1. Mesalem

    Mesalem Guest

    i'm creating a text box dynamically in the page load and on the client side i
    use the following script to hide the control

    document.getElementById('dynamicText').style.display='none';
    document.getElementById('dynamicText').style.visibility='hidden';

    after a post back the control is displayed again
    i examined the WebControl.Style properties and found that it's not affected
    by the client script, so how can i handle this??

    thanks in advance,
    Mesalem
    Mesalem, Jul 19, 2005
    #1
    1. Advertising

  2. Mesalem

    Brock Allen Guest

    You will need to send something to the server to tell it to do the same thing
    that was done in your client javascript. Pehrpas a hidden field of your own?
    Page.RegisterHiddenField will gen one for you. Have your script fill this
    in and then on the postback inspect it to know how to set the stype on the
    server.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > i'm creating a text box dynamically in the page load and on the client
    > side i use the following script to hide the control
    >
    > document.getElementById('dynamicText').style.display='none';
    > document.getElementById('dynamicText').style.visibility='hidden';
    >
    > after a post back the control is displayed again
    > i examined the WebControl.Style properties and found that it's not
    > affected
    > by the client script, so how can i handle this??
    > thanks in advance,
    > Mesalem
    Brock Allen, Jul 19, 2005
    #2
    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.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    725
  2. =?Utf-8?B?TWVzYWxlbQ==?=

    WebControl.Style and ViewState

    =?Utf-8?B?TWVzYWxlbQ==?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    462
    Teemu Keiski
    Jul 19, 2005
  3. Ken Varn
    Replies:
    0
    Views:
    430
    Ken Varn
    Apr 26, 2004
  4. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    186
    Luis Ramírez
    Jul 6, 2004
  5. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    178
    Kasabaarde Sumta
    Dec 13, 2004
Loading...

Share This Page