⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chooseproductscontrol.ascx

📁 C#语言制作asp.net网上商店的
💻 ASCX
字号:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ChooseProductsControl.ascx.vb"
    Inherits="Admin_Controls_ChooseProductsControl" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<script language="javascript" type="text/javascript">

function toAdd(prefix){
	var checkvalue;
	var form = document.forms['aspnetForm'];
	checkvalue=false;
	 
	for (var i = 0; i < form.elements.length; i++) {
		if (form.elements[i].type == "checkbox" && (form.elements[i].name.search(prefix) > 0) && !form.elements[i].disabled && form.elements[i].checked)
			checkvalue=true;
	}
	
		if (checkvalue!=false){
				return confirm('你确认要添加选定的记录?');
			
		}
			else{
    	 alert(" 请在列表中选择要添加的记录!");
          return false;
		}
}
</script>

<div class="row">
    <asp:DropDownList ID="ddlSearch" runat="server">
        <asp:ListItem Text="SUK" Value="ProductCode"></asp:ListItem>
        <asp:ListItem Text="商品名称" Value="ProductName"></asp:ListItem>
    </asp:DropDownList>
    <asp:DropDownList ID="ddlCategory" runat="server">
    </asp:DropDownList>
    <asp:TextBox ID="txtSearch" runat="server" onclick="if(this.value=='输入查询关键字')this.value=''"
        onfocus="this.select()" onmouseover="this.focus()" value="输入查询关键字"></asp:TextBox>
    <asp:Button ID="btnSearch" runat="server" Text="查找" Width="76px" /></div>
<div class="grid">
    <asp:GridView ID="gvProduct" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        DataKeyNames="ProductID" Width="100%">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="cbSelect" runat="server" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="10px" />
                <HeaderStyle Width="10px" />
            </asp:TemplateField>
            <asp:BoundField DataField="ProductCode" HeaderText="SUK">
                <ItemStyle Width="100px" />
                <HeaderStyle Width="100px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="商品名称">
                <ItemTemplate>
                    <asp:Label ID="lbProductName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="price" Visible="False">
                <ItemTemplate>
                    <asp:Label ID="lbPrice" runat="server" Text='<%# Bind("price") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerSettings Visible="False" />
    </asp:GridView>
</div>
<div class="grid-pager">
   <webdiyer:AspNetPager ID="Pager" runat="server" EnableTheming="False" FirstPageText='<span   style="font-family:Webdings, Wingdings" >9</span>'
            HorizontalAlign="Left" LastPageText='<span   style="font-family:Webdings, Wingdings" >:</span>'
            NextPageText='<span   style="font-family:Webdings, Wingdings" >4</span>' NumericButtonCount="8"
            NumericButtonTextFormatString="[{0}]" OnPageChanged="ChangePage"
            PagingButtonSpacing="8px" PrevPageText='<span   style="font-family:Webdings, Wingdings" >3</span>'
            ShowCustomInfoSection="Right" SubmitButtonText="转页" Width="100%" CustomInfoSectionWidth="75%"
            ShowBoxThreshold="5" CustomInfoHTML Align="Right" ShowInputBox="Never">
        </webdiyer:AspNetPager>

</div>
<div class="blankbox">
</div>
<div class="row">
    <asp:Button ID="btnSelect" runat="server" OnClientClick="Javascript:return toAdd('gvProduct');"
        Text="添加选中" Width="125px" /></div>
<asp:HiddenField ID="hfSearchText" runat="server" />

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -