BlogList.aspx

1. Open Bloglist.aspx in Design view.

2. In the Content control type "Blog Members". Format this as an H2 header.

3. From the Data section //块,部分of the Toolbox, drag a SqlDataSource control onto the page, placing it below the header. In the SqlDataSource Tasks menu click Configure Data Source.

4. In the Configure Data Source wizard, for Choose Your Data Connection, select GeekSpeak.mdf, and then click Next. You should see the following, and then click Next.

5. For Configure Your Select Statement check MemberAccountName column//列 and Return only unique rows. Click Order By, and then for Sort by//分类 select MemberAccountName. Click OK. Verify //确认that your dialog looks like the following, then click Next and Finish.  Finally, change the SqlDataSource control's ID property //属性to "membersSqlDataSource".

The connection string //连接字符串has been added to the root //根<即本项目(站点)所在的位转置>Web.config file and referenced//被参考 by your SqlDataSource control.

6. From the Toolbox drag a DataList control below the SqlDataSource control. In the DataList Tasks menu, for Choose Data Source, select membersSqlDataSource. In the Properties window change the ID to "membersDataList". Switch to Source view, and replace the existing content between//在...中间 the <ItemTemplate> tags with the following:

 

<a href=Blog.aspx?un=<%# Eval("MemberAccountName") %>><%# Eval("MemberAccountName") %></a>

posted on 2007-04-16 14:46  改变热爱  阅读(168)  评论(0)    收藏  举报

导航