asp.net startkit commerce simple and easy to understand.
I think it's a first time study. NET code of choice, not afraid of everyone jokes, I have read the project code 3 times complete.
So, what knowledge can we learn by reading? Take a look at my summary below:
1. The realization of multilayer structure
In my opinion, 2-layer structure: PL layer and BLL layer (no obvious DAL layer, Dal and BLL together form BLL layer). But we can learn how to call the DB process.
2. Simple use of Web services
3. Use of Web user controls
4. Knowledge of data binding
Let's look at a piece of code in the project:
<asp:hyperlink cssclass= "menuselected" id= "HyperLink2" text= "<%# DataBinder.Eval" (Container.DataItem, " CategoryName ")%> ' navigateurl= ' <%# ' productslist.aspx? Categoryid= "+ DataBinder.Eval (Container.DataItem," CategoryID ") +" &selection= "+
container.itemindex% > ' runat= ' Server/>
Description
(1) data binding in single quotes, characters in single quotes in double quotes.
(2) Pay special attention to attributes: Container.itemindex, which generates the ID of each item, which is zero-based. Features similar to MS SQL's identity (0,1). Think about my old project. In order to show the index of each row, it is very foolish to use a temporary table in db to generate row indexes and then bind the data.
5. Form-based validation
In the Web.config file, we can see the following 2 paragraphs of code:
<authentication mode= "Forms" > <forms name= "Commerceauth" loginurl= "Login.aspx" protection= "All
" path= " /"/>
</authentication>
<location path=" orderdetails.aspx ">
<system.web>
<authorization>
<deny users= "?"/>
</authorization>
</system .web>
</location>
Description: This prohibits unauthorized access to the user page: Orderdetails.aspx, the user is automatically led to the page login.aspx login verification