ASP. net e-commerce system development-1 (data list ),

Source: Internet
Author: User

ASP. net e-commerce system development-1 (data list ),
I. Preface

First, I declare that this is my first cooperation with others. net project, another person is working on background management, I am working on the front-end, this is an e-commerce system, the main function is to view goods and shopping features.

Ii. Start

First, let's take a look at the data list of some items I intercepted (the data is full of virtual data, not a logistics company after all: D)

<Telerik: RadListView ID = "RadListView1" runat = "server" CssClass = "Radbox"> <ItemTemplate> <a href = "aspx/GoodsInfo. aspx? Id = <% # Eval ("Goods_ID") %> "class =" good-item "> "class =" goods-img "/> <div class =" goods-content "> <span class =" good-title "> <% # Eval (" Goods_name") %> </span> <span class = "good-desc"> <% # Eval ("Goods_info ") %> </span> <ins class = "good-price"> <span class = "symbol" >¥ </span> <% # Eval ("In_store_price ") %> </ins> <span class = "price-value"> market price <del> ¥ <% # Eval ("Market_price ") %> </del> </span> <span class = "goods-foot"> <span class = "num"> 9 & nbsp </span> <span class =" text "> People </span> </div> </a> </ItemTemplate> </telerik: radListView>

This is the Radlistview control, which is written between spaces. It is the information of each item, for example, the first line <a href = "aspx/GoodsInfo. aspx? Id = <% # Eval ("Goods_ID") %> "class =" good-item "> is a large link. Note that the end position of this label is below, the initial value is the URL value. <% # Eval ("Goods_ID") %> This is the method for binding fields in the database, the data under the database field is displayed on the page, where ("Goods_ID") is the database field name.

2. Background
public void Dataload()        {            DataSet ds = bllgoods.GetList(6, " IN_group_buying = 1", "Uptime desc");            RadListView1.DataSource = ds;            RadListView1.DataBind();        }

Because it is implemented in a three-tier architecture, we use the "get the first few rows of Data" method in the three-tier architecture.

Public DataSet GetList (int Top, string strWhere, string filedOrder) {StringBuilder strSql = new StringBuilder (); strSql. append ("select"); if (Top> 0) {strSql. append ("top" + Top. toString ();} strSql. append ("Goods_ID, Goods_name, Market_price, expiration, In_store_price, Stock, Uptime, Goods_pic, Goods_info, Good_Brand, expiration, GS2, Sales_volume, GS_id, Message_ID, Color, Size, Qqp, (CASE WHEN Datalength (Goods_name) <= 12 THEN Goods_name else substring (Goods_name, 1, 12) + '... 'End) AS Goods_name1 "); strSql. append ("FROM GoodsInfo"); if (strWhere. trim ()! = "") {StrSql. append ("where" + strWhere);} strSql. append ("order by" + filedOrder); return DbHelperSQL. query (strSql. toString ());}

Remember to add

OK. That's all.

Because I am still studying, I am a senior high school student. This is the first time I wrote something in my blog and want to keep a record for my study or project development, the knowledge involved is not very extensive. I may be able to make an axe in front of Daniel in my blog. I hope the experts can give some advice and hope to help you!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.