Solved

CSS Button onclick fire a code behind method

Posted on 2008-06-19
3
946 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

Suggested Solutions

Title # Comments Views Activity
Customizing jQuery UI Accordion CSS 3 55
I want a tab to always be underlined when I open div then change 1 52
Why "Mobile First"? 5 60
HTML CSS and  Table design 4 61
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
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 …

738 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