Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2007, 01:57 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Label onmouseover in code behind

I am trying to dynamically build a page. I have a label and a link button that when the mouse goes over it, I need a menu to display. I have 5 of these that are created and each has its own menu. How do I go about getting the code to build and display the menu to be called from the codebehind. I am using the label.attributes.add("onmouseover", "DisplayMenu"), but the 2nd part, which is my code where the menus are built, is not being called. What am I doing wrong? HELP Please.

Thanks
Liz

 
Old February 2nd, 2007, 03:45 PM
Registered User
 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to surendra.parashar
Default

Hi Liz

You are totaly wrong

Surendra
 
Old February 2nd, 2007, 03:48 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well what do I need to do to make it right?

 
Old February 5th, 2007, 01:09 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

BUMP!!

Could somebody please help me with this? Do I need to use Javascript?

 
Old February 5th, 2007, 01:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I don't understand why Surendra gave you such a ridiculous, unfriendly and useless answer.....

Anyway, I am not sure I understand your situation. onmouseover fires at the client; Code Behind fires at the server. How do you see this work?

Are you sure you need to do this at the server. Maybe you're just looking for a client side menu??

Can you elaborate a little?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old February 5th, 2007, 01:29 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, yes I am trying to create a menu dynamically using database values. So everything on the page is being built from the code behind. Basically everything is being driven from the database. So I am trying to display a menu when the user mouses over a button. Different menus for different buttons. I am not sure if I am explaining this right. THis is my first web project.

So yeah if I could create the menus on the client side, how would I do that? JavaScript?
 
Old February 5th, 2007, 01:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

let's clarify a little this..

every time you execute something on the server side, all the page will be refreshed, so there will be not pop up from any menu, unless you use AJAX...
the code behind fires on the server side, controls know this automatic and you don't have to register the events...
you are registering a javascript event and coding a code behind event, that's why the java script never run... and that's probably why don't you see anything happens, all the pages gets a refresh!

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old February 5th, 2007, 01:58 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I have downloaded AJAX and will start looking into it. Thanks for the information. And it does make sense.

Do you know of a good book reference for AJAX?

Thanks again.
 
Old February 5th, 2007, 02:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

final version of AJAX came out a month ago..

I think that wrox have a book about it..

but i was involved in the beta testing of it so I didn't read any book about it, just the docs and tutorial that are in the microsoft page...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old February 5th, 2007, 05:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you sure you need stuff like Ajax and server side event handling?

Aren't you just looking for a database driven version of this menu: http://www.htmldog.com/articles/suckerfish/example/

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
onmouseover sstuber BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 April 29th, 2008 12:30 PM
how to access with code-behind a label embedded in hertendreef ASP.NET 2.0 Basics 3 March 12th, 2007 06:47 AM
onmouseover gilgalbiblewheel HTML Code Clinic 4 February 4th, 2005 08:05 AM
Apply VBA Code To Report Label If Possible Ben Horne Access VBA 3 February 18th, 2004 10:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.