473,659 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can someone explain this?

Let's say you set

txtlastname1.vi sible = true

Then

DirectCast(Page .FindControl("t xtLastName1"), TextBox).Visibl e = False
Why when you check txtlastname1.vi sible it is equal to True?
Can someone please explain? Thanks

Nov 19 '05 #1
5 1460
Watcha-talkin-about-foo?

txtLastName1.Vi sible = True
DirectCast(Page .FindControl("t xtLastName1"), TextBox).Visibl e = False
Response.Write( txtLastName1.Vi sible)

Shows up false to me.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
<kl******@hotma il.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Let's say you set

txtlastname1.vi sible = true

Then

DirectCast(Page .FindControl("t xtLastName1"), TextBox).Visibl e = False
Why when you check txtlastname1.vi sible it is equal to True?
Can someone please explain? Thanks

Nov 19 '05 #2
<kl******@hotma il.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Let's say you set

txtlastname1.vi sible = true

Then

DirectCast(Page .FindControl("t xtLastName1"), TextBox).Visibl e = False
Why when you check txtlastname1.vi sible it is equal to True?
Can someone please explain? Thanks


I bet you have a typo somewhere. Try this:

Response.Write( txtlastname1.Eq ual(Page.FindCo ntrol("txtLastN ame1")))

John Saunders
Nov 19 '05 #3
Here is what I'm doing
blnShow = true
Sub Show (ByVal blnShow As Boolean)

txtlastname1.vi sible = blnShow

if txtlastname1.vi sible = true then
response.write( "1")
else
response.write( "2")
end if

2 comes up. Why?

Nov 19 '05 #4
The problem is with your code...it should be showing 1 (and it is on my
computer)...Wha t value is being passed into the Show() call? What is
blnShow = true? a field declaration? are you just telling us that you are
sure it's true?
Show(false) ' displays 2
Show(true) ' displays 1

if you are doing Show(false) but have a field named blnShow that you are
setting to true, such as :

private blnShow as boolean = true
public sub Page_Load()
Show(false)
end sub

Sub Show(Byval blnShow as boolean)
...
end sub

the local blnShow variable you are declaring in the Show function overrides
the more global blnShow field declared at the top. In other words, you
might be getting confused because you have two variables named the same
thing (bad) at different scopes and it isn't the one you are expecting.

karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
<kl******@hotma il.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Here is what I'm doing
blnShow = true
Sub Show (ByVal blnShow As Boolean)

txtlastname1.vi sible = blnShow

if txtlastname1.vi sible = true then
response.write( "1")
else
response.write( "2")
end if

2 comes up. Why?

Nov 19 '05 #5
<kl******@hotma il.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Here is what I'm doing
blnShow = true
Sub Show (ByVal blnShow As Boolean)

txtlastname1.vi sible = blnShow

if txtlastname1.vi sible = true then
response.write( "1")
else
response.write( "2")
end if

2 comes up. Why?

Hey, just for fun, could you send us some context? Like:

Sub Page_Load(sende r as Object, EventArgs as e)
Dim blnShow as Boolean = True
Show(blnShow)
End Sub

Sub Show (ByVal blnShow As Boolean)

txtlastname1.vi sible = blnShow

if txtlastname1.vi sible = true then
response.write( "1")
else
response.write( "2")
end if
End Sub
What you actually sent us so far looks like it could be VBScript.

John Saunders
Nov 19 '05 #6

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

Similar topics

11
3162
by: Maciej Nadolski | last post by:
Hi! I can`t understand what php wants from me:( So: Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in /home/krecik/public_html/silnik.php on line 251 Line 208: print ( "error: " . mysql_error()); Line 251: session_register("uprawnienia", "zalogowany"); I can understand that sth, is wrong in line 251 after line 208 and it is logical to
8
2217
by: Peter Foti | last post by:
I'm working on a site and the client said he thinks "the main title should be around 28pt and the subtitle probably 18pt". I know pt's are bad, and I want to convince him that he should NOT be sizing the headers with pts (or perhaps at all), but I was wondering if there is a website that describes why it's bad (instead of trying to explain it myself in a lengthy email). Anyone have a resource I could use? Thanks, Peter Foti
3
1582
by: MarcJessome | last post by:
Hi, I was wondering if someone could help me through learning C++. I've tried learning before, but I find I would work better if I had someone that could help explain a few things to me. Im using Bruce Eckel's Thinking in C++, but I have used others before. I use msn, icq and aim if its possible for someone to help me on an instant messenger. Thanks, Marc
5
2793
by: J Allen Horner | last post by:
I'm just starting to learn C, and the tutorial I'm reading uses this code as an example: ----------- #include <stdio.h> #define MAX 10 int a; int rand_seed=10;
4
1326
by: Richard L Rosenheim | last post by:
Using Visual Studio 2003 running under Windows XP Pro w/SP 1, when I create a new form, the form's title bar has the Windows 2000 look. Yet, in the various Microsoft demos, the form's title bar have the XP look. For example, I'm looking at examples from the DevDays 2004 CD. And this is even without invoking the EnableVisualStyles method. The Microsoft demo appears to be running on a Windows XP machine. Can someone explain why I'm...
1
1245
by: Tran Hong Quang | last post by:
Hi, In header file, I see this declaration: #define DECLARE_VTBL(iname) iname vt##iname; then, in C file, there are below codes: typedef struct _Abc { .......... } abc;
4
5045
by: Adrian | last post by:
can someone explain the cross domain security re AJAX in IE? I have a page that calls a web service (WS) from another domain (the target browser is only IE6) and displays it's results! all works fine when the page is run from my hdd, however when run from the web I get "Access denied" due to the cross domain security (I assume). So I set the browser setting to allow cross domain but this did not seem to work, I got the same error!
1
1064
by: mansa | last post by:
a) A company receives hundreds of orders every week through the mail. Explain carefully how BATCH- PROCESSING might be used. Describe the role of the BATCH TOTAL in this process. Explain how batch total is calculated. b) Explain how errors in data submitted to a computer program are corrected during batch processing. c) Explain why there is less batch-processing now than in the past. d) Select any TWO of the processes below and...
6
1208
by: Dave Young | last post by:
I'm looking at some code that i've inherited and I'm not really familar with what's going on here and was hoping somone could explain it to me. For reference: f1 is a long f2 is a long here's the statement
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.