?
Solved

CSS Button onclick fire a code behind method

Posted on 2008-06-19
3
Medium Priority
?
956 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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.…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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