Solved

CSS Button onclick fire a code behind method

Posted on 2008-06-19
3
941 Views
Last Modified: 2012-08-14
I created a CSS Button with rollover effects.
Here is the Source code for the buton:
<div id="rollovers">  
    <a  href="#"  onclick="GetES()" >
    </a>
 </div>
What I would like to happen is that when the user clicks on the CSS Button the "GetES" function in the Code Behind would fire.
Thanks
Matt
0
Comment
Question by:mutlyp
  • 2
3 Comments
 
LVL 14

Expert Comment

by:ali_kayahan
ID: 21825042
<div id="rollovers">  
    <a  href="#"  onclick="GetES()" >click
    </a>
 </div>
should already work ..
0
 

Author Comment

by:mutlyp
ID: 21825144
Maybe I did not explain it correctly.
This code:
<div id="rollovers">  
    <a  href="#"  onclick="GetES()" >click
    </a>
 </div>
is in my default.aspx page in the source code.
The GetES function:
Public Sub GetES()

End Sub

is in my default.aspx.vb page in the code behind.

When I put a break point on the Public Sub GetES() and then click on the CSS Button it does NOT hit GetES().
Hope this clears it up some.
Matt
0
 

Accepted Solution

by:
mutlyp earned 0 total points
ID: 22210004
Hey Guys
Came up with the solution. All you do is use this code

<a  href="#"  onclick="javascript:__doPostBack('Button1', '');" />
then put a button on your page but make all the attributes for the button Transparent. Then when the user clicks on the hyuperlink the button will fire on the code behind.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now