firing the server side click event
Hi,
I have an ASP.NET datalist
- <asp:DataList ID="appointmentList" runat="server" Width="100%">
- <ItemTemplate>
- <div class="appointment">
- <div style="float: left; display: inline-block; width: 75%;">
- <asp:Label Font-Bold="true" ID="type" runat="server" Text='<%# Eval("AppointmentCategoryDescription") %>'></asp:Label>
- -
- <asp:Label ID="date" runat="server" Text='<%# DateTime.Parse(Eval("AppDate").ToString()).ToShortDateString() %>'></asp:Label><br />
- (<asp:Label ID="outcome" runat="server" Text='<%# Eval("Status") %>'></asp:Label>)
- <br />
- <asp:Label ID="location" runat="server" Text='<%# Eval("Clinic") %>'></asp:Label>
- <div class="clear"></div>
- </div>
- <div style="float: left; display: inline-block; width: 25%; text-align: right;">
- <asp:Button style="display: none;" ID="view" runat="server" Text="VIEW" CssClass="viewbutton" CommandName='<%# Eval("AppID").ToString() + "^" + Eval("AppointmentCategoryDescription") + "^" + Eval("Company") %>' OnClick="view_Click" />
- <div class="clear"></div>
- <asp:Image ID="icon" ToolTip='<%# Eval("Company") %>' runat="server" AlternateText='<%# Eval("Company") %>' ImageUrl='<%# string.Format("~/SpecsaversPortal/images/{0}icon.png", Eval("Company").ToString().Substring(0,1).ToLower()) %>' />
- </div>
- <div class="clear"></div>
- </div>
- </ItemTemplate>
- </asp:DataList>
I need to fire the OnClick event of the button when the whole div is clicked so I tried
- $(document).ready(function () {
- $(".appointment").click(function () {
- $('.viewbutton').click();
- });
- });
But, being new to jQuery, I am assuming that the click() event is the client not the server? How can I fire the server side?