Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 April 13th, 2007, 03:27 AM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Event handling in Asp.net

i want to get vbscript function so that if i move the curser on a text
a panel is gone hide and visevarsa.
i wrote this function but does not work
<script language="vbscript" runat=server>
sub hide(sender as object,e as evenargs)
panal1.visible=false
end sub

<html>
<body>
<p id=p1 onmouseover="hide">Plese move curser here</p>
</body>
</html>


Also guide me to create a main menu under which there are several sub menu .when i move the mouse over main menu it's submenu appears otherwise submenu remain hidden.please note that source code must be in vbscript using asp.net
                                      thank you
 
Old April 13th, 2007, 06:30 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

First your second question. Do a google search as there are many examples already wrote on how to do what you are asking.

Secondly, unless you are clicking a button or raising some other event on the server, the above code will never work. You have to options:
1: Raise an event on the server when the user moves their mouse over a selected area and hide the panel
2: Use javascript instead.

Javascript is the better option for this as making another round trip to the server seems pointless just to unhide a panel. However, there is a caveat. A .NET control that has its visiblity property set to false is never placed on the page anywhere in code when the page is rendered so, what you would need to do, is something like this:

<div style="visiblity:hidden;">
<asp:panel runat=server id="panel1" visible="true" />
</div>

This will render the panel to the page, just inside a hidden div, so your javascript only needs to set the visibility style of the div to visible.

hth

================================================== =========
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 planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Handling in asp.net 2.0 kulkarnimonica ASP.NET 2.0 Professional 1 June 29th, 2007 03:33 AM
Error Handling in ASP.NET myunus VS.NET 2002/2003 1 August 18th, 2004 06:18 PM
error handling in asp.net e-commerce programming 123 All Other Wrox Books 0 October 19th, 2003 04:55 AM
ASP Event Handling mathuranuj Classic ASP Basics 1 July 18th, 2003 02:05 AM
Exception Handling in ASP.net class mittalpa VS.NET 2002/2003 0 July 11th, 2003 03:22 PM





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