Solved

CSS Button onclick fire a code behind method

Posted on 2008-06-19
3
951 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

717 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