Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 7th, 2010, 08:42 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default Issue with Panel control Visibility

Hi
I have issues with the visibility of the Dynamic Panel control 'pan1'.

-I have a Dynamic Button control, and if i hover my mouse on it, i want the Dynamic Panel control to popsup.

-The issue is The Dynamic Panel control is visible FOR A SECOND in a Page_load event and goes away. and when i hover on the Button control its working.

-But i want the Panel control to popup only when i hover on the Button, not in Page_load event.

i think its because in my code i added:

Panel pan1=new Panel();
pan1.cssClass="popupMenu";

Form.Controls.Add(pan1);


- if i create the same controls in a design time and set its visibility in cssClass its working, the issue is with Dynamically created controls.

-Here is my codes.

i just attached from my cssClass, the following code asusual in .aspx page.

<link href="AnimSheet.css"...

"AnimSheet.css" contains:

.popupMenu
{
height: 400px;
width: 400px;
visibility:hidden;
background-color: #800000;
}
.popupMenu:hover
{
visibility: visible;
}

So in "Default.aspx.cs": i added


pan1.CssClass = "popupMenu";


But it wasn't working.The Panel itself is hidden even when i hover on it. Please help.
-if i comment this line "visibility:hidden;"
Then the Panel is visible also in Page_load event for a second and goes away.
  #2 (permalink)  
Old April 8th, 2010, 04:03 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

As mentioned on the other thread, a more complete code sample is required to reproduce this problem.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
  #3 (permalink)  
Old April 8th, 2010, 06:57 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default

This is my "default.aspx.cs" code:


private void Page_Load(object sender, System.EventArgs e)
{
Button hovbut = new Button();
hovbut.ID = "b1";
hovbut.Text = "Hover on me";
Form.Controls.Add(hovbut);
Panel p = new Panel();
p.ID = "p1";

p.Height = Unit.Pixel(100);
p.Width = Unit.Pixel(300);
p.BackColor = Color.BurlyWood;
p.CssClass = "pops";
Form.Controls.Add(p);
AjaxControlToolkit.HoverMenuExtender x1 = new AjaxControlToolkit.HoverMenuExtender();
x1.TargetControlID = hovbut.UniqueID;
x1.PopupControlID = p.ClientID;
Form.Controls.Add(x1);
}

- i have my link and Script manager attached in the .aspx page:
<link href="AnimSheet.css" rel="stylesheet" type="text/css" />


And "AnimSheet.css" contains

.pops
{
visibility:hidden;
}
.pops:hover
{
visibility:visible;
}

So the Issue is Everytime the Page loads, the Panel "p" blinks for a Second and goes away. And it hover as i wanted. I dont want the panel control to blink for a second in the load event. Please help.
-Thanks
  #4 (permalink)  
Old April 9th, 2010, 04:30 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

This is the first time you have mentioned the HoverMenuExtender extender - something I think you should have mentioned before perhaps!

I have been unable to reproduce your problem with the details above. However if I remove the stylesheet then I do see the issue, so perhaps you need to confirm that your stylesheet is being loaded. Perhaps try putting your style info (width/height/color) in the stylesheet to confirm it is being loaded correct.

Also, I don't believe the .pops:hover is required, as the extender controls this for you.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
  #5 (permalink)  
Old April 9th, 2010, 03:17 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Sorry about that. And you are right. The Style sheet is not loaded when in try to give height/width/backcolor in css file. Its working only when i give it dynamically in load_event.

-So How can i make the panel visibility hidden in Load event?
  #6 (permalink)  
Old April 9th, 2010, 03:59 PM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Fix your stylesheet so it IS loaded.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
  #7 (permalink)  
Old April 10th, 2010, 03:04 AM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Thanks. It worked.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4: Using the Panel Control Steve1977 ASP.NET 3.5 Basics 3 September 14th, 2008 01:55 PM
Control panel maz_alaameri ASP.NET 2.0 Professional 0 March 17th, 2008 06:59 AM
Set Panel Visibility Problem niceFEPF C# 2005 0 November 21st, 2006 06:34 PM
Visibility Issue braheem ASP.NET 1.0 and 1.1 Basics 1 July 14th, 2005 05:20 PM
lock control panel anyone VB How-To 4 February 1st, 2005 08:59 PM



All times are GMT -4. The time now is 02:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.