473,394 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

why does this tag always remain hidden?

Bob
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>

<asp:DropDownList ID="DropDownList1" runat="server" >
</asp:DropDownList>

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
Jun 14 '06 #1
2 1230
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" <sd*@sdvsd.dc> wrote in message
news:OO**************@TK2MSFTNGP04.phx.gbl...
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>

<asp:DropDownList ID="DropDownList1" runat="server" >
</asp:DropDownList>

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

Jun 14 '06 #2
Bob
Thanks

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:O6**************@TK2MSFTNGP02.phx.gbl...
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" <sd*@sdvsd.dc> wrote in message
news:OO**************@TK2MSFTNGP04.phx.gbl...
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>

<asp:DropDownList ID="DropDownList1" runat="server" >
</asp:DropDownList>

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


Jun 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
4
by: Sam | last post by:
I'm thinking about this question. I've a class A and its member function fn. In fn there's a static variable s. If I create an object by A a; When I call the function a.fn, s would remain...
2
by: Joachim Bauer | last post by:
I'm using the code below to display a menu that opens when the mouse goes over the main menu item (try it in your browser to understand the behaviour). It uses "position:absolute" and a switch...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
8
by: Will Chamberlain | last post by:
I came across a rather interesting article this morning and thought I'd share. We all know that Visual Studio is a great IDE, but I think we can all agree that it is adds a dramatic change to how...
5
by: sam | last post by:
Hi all, I am using documnet.body.scroll to disable the window scroll bar. This works in IE only and not other browsers. Can any one tell me if there is any such method which is cross browser...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
12
by: -Lost | last post by:
In Firefox and Safari for example, if I serve my XHTML documents as application/xml or xhtml+xml they only display the top inch or so of the document. In Opera it says "object has been blocked."...
2
by: dbuchanan | last post by:
I intend to populate a listBox from the database for later use. (the intent for doing this is irrelevant to this questrion) The list box when hidden is never populated. The list box when visible...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.