Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add update command for ImageButton in GridView ItemTemplate?
    primarykey
    data
    text
    <p>I am kinda lost.</p> <p>I have a GridView with ItemTemplate. I am trying to approve and reject booking using ImageButton but I do not know where and how to put the sql command to update booking status.</p> <p>I need hints to continue my coding.</p> <p>Here is my ItemTemplate for Accept and Reject imagebutton:</p> <pre><code>&lt;asp:TemplateField HeaderText="Action"&gt; &lt;ItemTemplate&gt; &lt;asp:ImageButton runat="server" ID="acceptBooking" ImageUrl="~/images/accept.png" OnClientClick="if (!window.confirm('Are you sure you want to accept this booking?')) return false;" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText="Action"&gt; &lt;ItemTemplate&gt; &lt;asp:ImageButton runat="server" ID="rejectBooking" ImageUrl="~/images/reject.png" OnClientClick="if (!window.confirm('Are you sure you want to reject this booking?')) return false;" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>My SQLdatasource:</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:ConnectionString1 %&gt;" SelectCommand="SELECT [bookingScheduleID], [eventTitle], [week1], [week2], [week3], [week4], [week5], [week6], [week7], [week8], [exhibitorname], [boothAlias], [category], [status], [dateBook],[custNo] FROM [bookingschedule]" &gt; &lt;/asp:SqlDataSource&gt; </code></pre> <p>I wish to update field [status] from table [bookingschedule]</p> <p>My interface: <img src="https://i.stack.imgur.com/1UIDh.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload