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. Advertisements

  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. Advertisements

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. Marri Suliez
    Replies:
    1
    Views:
    2,296
    Teemu Keiski
    Jan 23, 2004
  2. Guest
    Replies:
    2
    Views:
    904
  3. =?Utf-8?B?TWVzYWxlbQ==?=

    WebControl.Style and ViewState

    =?Utf-8?B?TWVzYWxlbQ==?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    540
    Teemu Keiski
    Jul 19, 2005
  4. Marri Suliez

    WebControl, CssStyleCollection and ViewState

    Marri Suliez, Jan 23, 2004, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    272
    Teemu Keiski
    Jan 23, 2004
  5. Ken Varn
    Replies:
    0
    Views:
    743
    Ken Varn
    Apr 26, 2004
  6. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    322
    Kasabaarde Sumta
    Dec 13, 2004
  7. Marri Suliez

    WebControl, CssStyleCollection and ViewState

    Marri Suliez, Jan 23, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    320
    Teemu Keiski
    Jan 23, 2004
  8. ThunderMusic

    WebControl, ClientCallback and Viewstate... Help Please!!

    ThunderMusic, Oct 11, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    186
    ThunderMusic
    Oct 11, 2006
Loading...