473,469 Members | 1,636 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

about UserControl Visible property

hi, everyone,

I've one user control "ctlList" , and one button "View" in the Page, in
the Page_Load event, I set the ctlList.Visible to false, then in the View's
click event, I set it to true.

But the result is when Load , it's really invisible, but Click didn't make
it visible.

where's my fault?

Edward
Nov 18 '05 #1
2 1052
I did . below is my code:

void Page_Load(Object Sender, EventArgs e) {
if (Page.IsPostBack == false) {
ctlList.Visible = false;
}
}

void btnGenerateInvoice_Click( Object Sender, EventArgs e ) {
ctlList.Visible = true;
}
On Sat, 19 Jun 2004 23:07:36 +0800, "Edward" <zi***@citiz.net> wrote:
hi, everyone,

I've one user control "ctlList" , and one button "View" in the Page, in
the Page_Load event, I set the ctlList.Visible to false, then in the View'sclick event, I set it to true.

But the result is when Load , it's really invisible, but Click didn't makeit visible.

where's my fault?

Edward


perhaps you didn't put the ctlList.Visible = false inside a postback
check (ie
if not ispostback then
ctlList.Visible = false
end if
)

if so then regardless of what happens in the onclick it still sets it
to false when the page loads.

hth,
Brian

Nov 18 '05 #2
Edward,

Make sure ctlList has any data to show on the postbacl. If it is databound,
do you re-bind it again on the postback?

Eliyahu

"Edward" <zi***@citiz.net> wrote in message
news:OO*************@TK2MSFTNGP11.phx.gbl...
I did . below is my code:

void Page_Load(Object Sender, EventArgs e) {
if (Page.IsPostBack == false) {
ctlList.Visible = false;
}
}

void btnGenerateInvoice_Click( Object Sender, EventArgs e ) {
ctlList.Visible = true;
}
On Sat, 19 Jun 2004 23:07:36 +0800, "Edward" <zi***@citiz.net> wrote:
hi, everyone,

I've one user control "ctlList" , and one button "View" in the Page, inthe Page_Load event, I set the ctlList.Visible to false, then in the View'sclick event, I set it to true.

But the result is when Load , it's really invisible, but Click didn't makeit visible.

where's my fault?

Edward


perhaps you didn't put the ctlList.Visible = false inside a postback
check (ie
if not ispostback then
ctlList.Visible = false
end if
)

if so then regardless of what happens in the onclick it still sets it
to false when the page loads.

hth,
Brian


Nov 18 '05 #3

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

Similar topics

0
by: chris | last post by:
Hi there I want to create a UserControl which simply uses a textbox and a calendar. The calendar's visibility is set to false. If I click the ImageButton the Calendar is visible. When you select a...
3
by: Iain | last post by:
Hi I have page (testCal.aspx) that contains a usercontrol (custCalendar.ascx) - see below signature for code. The UC contains a linkbutton which which when clicked, posts back and displays a...
2
by: Lau Lei Cheong | last post by:
Hello, I'm writing a usercontrol that contains a property named "disabled". It is set to false by default but there is also another button in the usercontrol that'll set it to true. On the...
11
by: Crirus | last post by:
I need to derive the Windows.Forms.Control 2 times so I design a class like this Public Class BMControl Inherits System.Windows.Forms.UserControl Public Class MapControl Inherits BMControl
1
by: JAWS | last post by:
I want to make an ASP.NET user control with only a gridview on it. My usercontrol must behave the same as a normal gridview, with some extra properties and methods (for security purposes, such...
0
by: Michael | last post by:
Hi I've got a couple user controls on a Mater Page. One of then I don't want to be shown on the screen until the user logs in. So I set the visible property to false, and during a Masterpage...
2
by: boomcreation | last post by:
Hi, When I load a userControl, I check if I have a variable session. If my variableSession1 = "A" and do nothing. but if my variableSession1 = "B", I want clear the html in my control and...
3
by: DougS | last post by:
I have a ASP.Net 1.1 application where I have several usercontrols, one is called DetailLine, that I add to a panel dynamically. I am converting the app to ASP.Net 2.0 and I cant do this anymore....
1
by: Joshua | last post by:
I'm creating a web control that has an image and a text box. I would like to then override the Visible and Text property of the usercontrol, so when you reference the visible property of the user...
1
by: =?Utf-8?B?TmV3YnJv?= | last post by:
I have created a usercontrol consisted of a linkLabel and textBox. textBox visible set to false initially. When I click on linkLabel linkClicked event fired which set textBox visible to true. I...
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.