Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > why does this tag always remain hidden?

Reply
Thread Tools

why does this tag always remain hidden?

 
 
Bob
Guest
Posts: n/a
 
      06-14-2006
Hi,

I'm not sure of the priority in execution between aspx and aspx.vb code.
I define a tag which must be invisible as long as the user has not clicked
in the dropdownlist.
The problem is that it never becomes visible. When an user clicks in the
dropdownlist, the page is postbacked, so it would be visible, no?
Thanks for help
Bob

The aspx file:
<a href="#titel" id="ti" runat="server" style="visibilty:hidden"> Back</a>

<aspropDownList ID="DropDownList1" runat="server" >
</aspropDownList>

The code-behind:
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
....
if IsPostBack then
ti.visible=True
end if
....

end sub

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
....

end sub


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      06-14-2006
Hi,

setting Vsiible="True" in code doesn't affect the style="..." you have on
the element.

<a href="#titel" id="ti" runat="server" style="visibility:hidden"> Back</a>

About server-side Visible property
========================
Visible = False -- means that control's HTML is not sent to the browser at
all
Visible=True -- means that control's HTML is sent to the browser

But when it is Visible="true" your style which hides it at client, is taking
action.

Therefore change the ti element to be like:

<a href="#titel" id="ti" runat="server" Visible="False"> Back</a>

and removing the style should work

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke



"Bob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm not sure of the priority in execution between aspx and aspx.vb code.
> I define a tag which must be invisible as long as the user has not clicked
> in the dropdownlist.
> The problem is that it never becomes visible. When an user clicks in the
> dropdownlist, the page is postbacked, so it would be visible, no?
> Thanks for help
> Bob
>
> The aspx file:
> <a href="#titel" id="ti" runat="server" style="visibilty:hidden">
> Back</a>
>
> <aspropDownList ID="DropDownList1" runat="server" >
> </aspropDownList>
>
> The code-behind:
> Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
> Handles Me.Load
> ...
> if IsPostBack then
> ti.visible=True
> end if
> ...
>
> end sub
>
> Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
> ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
> ...
>
> end sub
>
>



 
Reply With Quote
 
 
 
 
Bob
Guest
Posts: n/a
 
      06-15-2006
Thanks

"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:O6LF3A$(E-Mail Removed)...
> Hi,
>
> setting Vsiible="True" in code doesn't affect the style="..." you have on
> the element.
>
> <a href="#titel" id="ti" runat="server" style="visibility:hidden">

Back</a>
>
> About server-side Visible property
> ========================
> Visible = False -- means that control's HTML is not sent to the browser at
> all
> Visible=True -- means that control's HTML is sent to the browser
>
> But when it is Visible="true" your style which hides it at client, is

taking
> action.
>
> Therefore change the ti element to be like:
>
> <a href="#titel" id="ti" runat="server" Visible="False"> Back</a>
>
> and removing the style should work
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
>
>
> "Bob" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > I'm not sure of the priority in execution between aspx and aspx.vb code.
> > I define a tag which must be invisible as long as the user has not

clicked
> > in the dropdownlist.
> > The problem is that it never becomes visible. When an user clicks in the
> > dropdownlist, the page is postbacked, so it would be visible, no?
> > Thanks for help
> > Bob
> >
> > The aspx file:
> > <a href="#titel" id="ti" runat="server" style="visibilty:hidden">
> > Back</a>
> >
> > <aspropDownList ID="DropDownList1" runat="server" >
> > </aspropDownList>
> >
> > The code-behind:
> > Private Sub Page_Load(ByVal sender As Object, ByVal e As

System.EventArgs)
> > Handles Me.Load
> > ...
> > if IsPostBack then
> > ti.visible=True
> > end if
> > ...
> >
> > end sub
> >
> > Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
> > ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
> > ...
> >
> > end sub
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why does control remain visible after postback? Dan ASP .Net 9 05-29-2008 02:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
WHY does Microsoft allow IE to remain so unpatched? Au79 Computer Support 0 03-03-2006 07:00 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Does a static variable in a class's member fn always remain static? Sam C++ 4 01-13-2004 11:05 PM



Advertisments