CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Unable to set div's Visible property to true

    Hi guys,

    I have the following markup
    Code:
    <div class="validation clear" runat="server" id="div_MyDiV" visible="false">
      Some text
    </div>
    and code behind
    Code:
    div_MyDiV.Visible = true;
    When I debug, the visible property is false, and after stepping over de line, it's still false?!?!

    Any ideas?

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: Unable to set div's Visible property to true

    Try setting it in the PreRender page event and see if it helps - my guess is that your assignment of true is overwritten

  3. #3
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: Unable to set div's Visible property to true

    I've used this a dozen of times before, always in the page load.

    Anyway, it wasn't visible because of some other reason. It works fine now. Only thing I don't understand is why the debugger always show that Visible=false.

    my guess is that your assignment of true is overwritten
    I looked at it the first step after setting the Visible property to true. When would it be overwritten then?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured