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 8009945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:35:38+00:00 2026-06-04T18:35:38+00:00

I have 2 image buttons, Accept and Reject. Accept button will update [status] to

  • 0

I have 2 image buttons, Accept and Reject.
Accept button will update [status] to 1
Reject button will update [status] to 2

I had successfully use UpdateCommand to update Accept button

UpdateCommand="UPDATE [bookingschedule] SET status='1'WHERE [bookingScheduleID] = @bookingScheduleID"

But, I do not know how to set update command for Reject button since I can declared UpdateCommand once only.

UpdateCommand2="UPDATE [bookingschedule] SET status='2'WHERE [bookingScheduleID] = @bookingScheduleID" (incorrect)

What should I do to make Reject button function? Where should i put this 2nd update command line:

UpdateCommand="UPDATE [bookingschedule] SET status='2'WHERE [bookingScheduleID] = @bookingScheduleID"

I do all this coding at client side:

Accept Button:

<asp:TemplateField HeaderText="Action Approve">
<ItemTemplate>
<asp:ImageButton runat="server" ID="UpdateCommand"
  CommandName="update" ImageUrl="~/images/accept.png"
  OnClientClick="if (!window.confirm('Are you sure you want to approve this booking?')) return false;" />
</ItemTemplate>
</asp:TemplateField>

Reject Button:

<asp:TemplateField HeaderText="Action Reject">
<ItemTemplate>
<asp:ImageButton runat="server" ID="UpdateCommand" CommandName="update" OnClick="reject"
  ImageUrl="~/images/reject.png"
  OnClientClick="if (!window.confirm('Are you sure you want to reject this booking?')) return false;" />
</ItemTemplate>
</asp:TemplateField>

SQL datasource:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
            SelectCommand="SELECT [bookingScheduleID], [eventTitle], [week1], [week2], [week3], [week4], [week5], [week6], [week7], [week8], [exhibitorname], [boothAlias], [category], [status], [dateBook],[custNo] FROM [booking_all]" 
            UpdateCommand="UPDATE [bookingschedule] SET status='1'WHERE [bookingScheduleID] = @bookingScheduleID"
            >
        </asp:SqlDataSource>
        <UpdateParameters>
        <asp:Parameter Name="bookingScheduleID" Type="Int32" />
        </UpdateParameters> 
  • 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-06-04T18:35:39+00:00Added an answer on June 4, 2026 at 6:35 pm

    Use a control to dynamically store/pass the status based on the button clicked

    UpdateCommand="UPDATE [bookingschedule] SET status=@Status WHERE [bookingScheduleID] = @bookingScheduleID"
    

    then add

    <asp:ControlParameter Name="Status" ControlID="StatusSelectionControl" PropertyName="Text" Type="Int32" />
    

    the propertyName should be relative to the control used – am assuming TextBox, but you can also use hidden field

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MasterPage that has two image buttons , and two content pages,
I have some 10 buttons with image-text and hover states for each. What I
I have to buttons, image input that work fine when in the markup like
I have a image button thats acts as a form submit button: <a href=#
I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
I have a problem that when I click on the image button instead of
I have setup background image for a button as below. // declarations globally declared...
I have put image as background of button. but I don't know at what
I have an image with a play/pause button positioned absolute and centered over top.
I have an image sprite of sorts with multiple frames for 1 button. I'm

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.