单击按钮后没有回发

时间:2016-08-25 06:12:59

标签: c# asp.net webforms

在这里,我需要传递两个值,即客户登录时将采用的客户ID,以及客户点击特定产品时将添加的产品ID。 我在产品详细信息页面附近添加了AddToWishList按钮。当我点击添加到愿望清单按钮时,它什么都不做。

这是我的代码。

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="DetailsView">
    <asp:DetailsView ID="DetailsView1" runat="server"  CellPadding="4" ForeColor="Black" GridLines="None" Height="50px" Width="378px"
        DataKeyNames="ProductID" DataSourceID="SqlDataSource1"  AutoGenerateRows="False">
        <Fields>
            <asp:BoundField DataField="ProductID" HeaderText="ProductID" SortExpression="ProductID" InsertVisible="False" ReadOnly="True" />

            <asp:BoundField DataField="ProductName" HeaderText="Product Name" SortExpression="ProductName" />
            <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
            <asp:BoundField DataField="ItemsInSet" HeaderText="Items In Set" SortExpression="ItemsInSet" />
            <asp:BoundField DataField="UnitPriceOwner" HeaderText="Unit Price Owner" SortExpression="UnitPriceOwner" />
            <asp:BoundField DataField="UnitPriceReseller" HeaderText="Unit Price Reseller" SortExpression="UnitPriceReseller" />
            <asp:BoundField DataField="CategoryID" HeaderText="Category ID" SortExpression="CategoryID" />
            <asp:BoundField DataField="ShippingCost" HeaderText="Shipping Cost" SortExpression="ShippingCost" />
            <asp:CheckBoxField DataField="InOffer" HeaderText="In Offer" SortExpression="InOffer" />
            <asp:CheckBoxField DataField="Visible" HeaderText="Visible" SortExpression="Visible" />

            <asp:HyperLinkField DataNavigateUrlFields="ProductID" DataNavigateUrlFormatString="BookingPage.aspx?ProductID={0}" 
                HeaderText="Buy" Text="Add to Cart" />
            </Fields>         
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="#FFFFC0" Font-Bold="True" />
        <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
    </asp:DetailsView>

    <asp:Button ID="Button1" runat="server" Text="Add To Wishlist" CssClass="myButton" OnClick="Button1_Click" AutoPostBack="true"/>

     <asp:Label ID="MessageLabel" runat="server" Text=""></asp:Label>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:UmmatiConStr %>" 
        SelectCommand="SELECT ProductID, ProductName, Description, ItemsInSet, UnitPriceOwner, UnitPriceReseller, CategoryID, ShippingCost, InOffer, Visible FROM Products WHERE (ProductID = @ProductID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ProductID" QueryStringField="ProductID" />
        </SelectParameters>
    </asp:SqlDataSource>
</div>

Aspx代码:

CopyPartRequest copyRequest = new CopyPartRequest()
                    .withDestinationBucketName()
                    .withDestinationKey()
                    .withSourceBucketName()
                    .withSourceKey()
                    .withUploadId()
                    .withFirstByte()
                    .withLastByte()
                    .withPartNumber();

0 个答案:

没有答案