Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5931893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:45:31+00:00 2026-05-22T14:45:31+00:00

i have a button in asp.net like below : <asp:Button ID=btnSaveInrpvEdit CssClass=btnSaveInrpvEdit runat=server Text=

  • 0

i have a button in asp.net like below :

<asp:Button ID="btnSaveInrpvEdit" CssClass="btnSaveInrpvEdit" runat="server" 
    Text="" ValidationGroup="B" onclick="btnSaveInrpvEdit_Click" />

and it’s css :

.btnSaveInrpvEdit
{
    background: url(/Images/Admin/btnSave.png) no-repeat left top;
    width: 155px;
    height: 63px;
    border: 0px;
    outline: none;
}
.btnSaveInrpvEdit:hover,.btnSaveInrpvEdit:active
{
    background: url(/Images/Admin/btnSave_Hover.png) no-repeat left 1px;
    cursor: pointer;
    outline: none;
}

so every thing is ok about it’s hovering…
at this time i want to implement this button behaviour about left mouse HOLDING and RELEASING on it!
if you attention to regular buttons in asp.net u will see when left mouse is clicked and holded on that button , so it seems it’s text has been moved a bit…
also when we release left mouse, that button goes back to normal mode!

how can i do this job with css and javascript?

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:45:32+00:00Added an answer on May 22, 2026 at 2:45 pm

    First, note that the text moving (and if the text moves) in the pressed button has nothing to do with the <asp:Button (or the input element it renders) directly. The button styles and visual behaviour depend to a small part on the browser and to a large part on the windows version and theme the client uses. Manually moving the background image could look very weird on themes that don’t actually move the text.

    That said, you can emulate the behaviour relatively easy with JavaScript respectively jQuery in particular.

    Something like this should work:

    CSS (I used normal style here because pressing usually removes the hover style)

    .btnSaveInrpvEdit.mousedown
    {
        background: url(/Images/Admin/btnSave.png) no-repeat 1px 1px;
    }
    

    JS + jQuery

    $("#btnSaveInrpvEdit").mousedown(function () { $(this).addClass("mousedown"); });
    $("#btnSaveInrpvEdit").mouseup(function () { $(this).removeClass("mousedown"); });
    

    You probably also have to handle the user pressing the button but then holding and dragging the cursor away from the button, which causes the button to un-press visually but will also return to the pressed state if you move the mouse back over the button. This is a bit more tricky but I’m sure you got the gist of it and can work something out 😉

    As a quick fix to at least prevent the button background staying offset forever you can add

    $("#btnSaveInrpvEdit").mouseleave(function () { $(this).removeClass("mousedown"); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following ASP.NET code: <div id=panelIssue runat=server style=width: 450px; height: 320px;> <gsl:IssueUC
I have a button on an ASP.NET wep application form and when clicked goes
I have a button on an ASP.Net page that will call Response.Redirect back to
I use ASP.NET and have a Button and a CustomValidator, which has to validate
I have a ASP.NET page with an asp:button that is not visible. I can't
In my ASP.Net Web Site I have a button.When I click the button and
I use yui datatable in my asp.net application... I have a link button in
I have ASP.Net code generating my button's HTML for me using divs to get
I have an asp.net page with a button. This button generates and inserts a
I have a asp.net webform with a button. The OnClientClick event is wired to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.