ASP.net中数据分页是由自己管理好还是由控件管理好?

news/2025/3/22 1:23:21
ASP.net 2.0的发布给广大Web开发人员带来了福音,特别是其中新增加的很多控件,比如GridView、FormView、DetailView等,极大地提高了开发人员的效率。然而,我曾是一名熟练的ASP开发人员,对HTML、CSS都相当熟悉,所以对这些控件的语法很是不习惯,同时,对这些控件的性能和灵活性表示怀疑。

    GridView可以非常方便的管理数据分页,只用设置几个简单的属性即可,为了了解其自动分页的性能,我做了一个测试。

    第一步,打开SQL Server Express,建立一个数据表TestPaging,如下图,id字段是主键,postdate字段默认值是当前的时间。
x1.JPG

    第二步,向表中添加10万行数据,呵呵,数据少了看不出效果,如下图所示的SQL语句:
x2.JPG

    第三步,测试使用服务器控件自动管理分页的性能,建立一个页面TestGridViewPaging.aspx,在页面中添加一个SqlDataSource控件和一个GridView控件,再设置几个简单的属性,不到一分钟就完工,真的是简单方便啊。如下图:
x3.JPG

    下面是IDE自动生成的代码,我们把页面的跟踪功能打开:

 1ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Page Language="C#" Trace="true"%>
 2None.gif
 3None.gif<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 4None.gif
 5ExpandedBlockStart.gifContractedBlock.gif<script runat="server">dot.gif
 6ExpandedBlockEnd.gif
 7None.gif
</script>
 8None.gif
 9None.gif<html xmlns="http://www.w3.org/1999/xhtml" >
10None.gif<head runat="server">
11None.gif    <title>使用控件管理数据分页</title>
12None.gif</head>
13None.gif<body>
14None.gif    <form id="form1" runat="server">
15None.gif    <div>
16None.gif        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AspStudyConnectionString %>"
17None.gif            SelectCommand="SELECT * FROM [TestPaging]"></asp:SqlDataSource>
18None.gif    
19None.gif    </div>
20None.gif        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
21None.gif            DataSourceID="SqlDataSource1" PageSize="20" Width="551px">
22None.gif            <Columns>
23None.gif                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
24None.gif                    SortExpression="id" />
25None.gif                <asp:BoundField DataField="subject" HeaderText="subject" SortExpression="subject" />
26None.gif                <asp:BoundField DataField="postdate" HeaderText="postdate" SortExpression="postdate" />
27None.gif            </Columns>
28None.gif            <AlternatingRowStyle BackColor="Silver" />
29None.gif        </asp:GridView>
30None.gif    </form>
31None.gif</body>
32None.gif</html>


    第四步,测试,结果发现该页面首次运行时需花时20多秒,如下图:
x4.JPG
x5.JPG

随便翻页,页面的运行时间都是8到9秒,如下:
x6.JPG


    第五步,建立TestCustomPaging.aspx页面,自己编写翻页代码,直接使用ADO.net编程,数据显示使用了DataGrid控件,同时,我再页面中使用了三个隐藏控件,分别用于保存每一页的第一条记录和最后一条记录的id以及当前页号,下面测试,结果发现不管是首次显示,还是上下翻页,都不超过0.05秒,如下图:
x7.JPG
x8.JPG

    只有跳转到特定页面时速度稍慢,因为使用了嵌套查询,我主要是偷懒,如果使用存储过程的话,速度应该更快,如下图:
x9.JPG

结论:使用微软提供的服务器控件,开发效率高,但是在访问数据量大的数据库时,速度非常慢,我想,该控件可能是每次访问时都将数据全部从数据库中取出,保存到内存中,如果数据量继续增加,或者访问人数增多,服务器会不会当机呢?而我自己编写的代码,每次只访问一个页面的数据,速度快,且性能不会随数据量增大而下降,更可以提供如下所示的更人性化的用户界面:
x10.JPG
但是,我自己编写代码,从设计到调试完成,花了约2小时的时间。

开发效率: 服务器控件/自己编写代码 = 1分钟/2小时 = 1/120
运行效率: 服务器控件/自己编写代码 = 9秒/0.05秒 = 180/1

最后,我想问一下,各位有开发经验的大侠们,你们平时的开发中,是使用控件多一些,还是自己写代码多一些?

下面是我自己编写的页面的代码:

  1ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Page Language="C#" Trace="true" Debug="true" %>
  2ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Import Namespace="System.Data" %>
  3ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Import Namespace="System.Data.SqlClient" %>
  4None.gif
  5None.gif<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6None.gif
  7ExpandedBlockStart.gifContractedBlock.gif<script runat="server">dot.gif
  8InBlock.gif    
  9InBlock.gif    int pagecount;
 10InBlock.gif    int curpage;
 11InBlock.gif    int pagesize;
 12InBlock.gif
 13InBlock.gif    SqlConnection con;
 14InBlock.gif    SqlCommand command;
 15InBlock.gif    SqlDataReader dr;
 16InBlock.gif    
 17InBlock.gif    DataTable CreateDataTable(SqlDataReader reader)
 18ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
 19InBlock.gif        DataTable dt = new DataTable();
 20InBlock.gif        DataRow dr;
 21InBlock.gif
 22InBlock.gif        dt.Columns.Add(new DataColumn("ID"typeof(Int32)));
 23InBlock.gif        dt.Columns.Add(new DataColumn("主题"typeof(string)));
 24InBlock.gif        dt.Columns.Add(new DataColumn("发表时间"typeof(DateTime)));
 25InBlock.gif
 26InBlock.gif        while (reader.Read())
 27ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 28InBlock.gif            dr = dt.NewRow();
 29InBlock.gif
 30InBlock.gif            dr[0= reader.GetInt32(0);
 31InBlock.gif            dr[1= reader.GetString(1);
 32InBlock.gif            dr[2= reader.GetDateTime(2);
 33InBlock.gif
 34InBlock.gif            dt.Rows.Add(dr);
 35ExpandedSubBlockEnd.gif        }

 36InBlock.gif        return dt;
 37ExpandedSubBlockEnd.gif    }

 38InBlock.gif
 39InBlock.gif    void SaveIndex(DataTable dt)
 40ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
 41InBlock.gif        int rowcount = dt.Rows.Count;
 42InBlock.gif        DataRow firstrow = dt.Rows[0];
 43InBlock.gif        DataRow lastrow = dt.Rows[rowcount - 1];
 44InBlock.gif        int minid = (int)firstrow[0];
 45InBlock.gif        int maxid = (int)lastrow[0];
 46InBlock.gif        if (maxid > minid)
 47ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 48InBlock.gif            minidctl.Value = minid.ToString();
 49InBlock.gif            maxidctl.Value = maxid.ToString();
 50ExpandedSubBlockEnd.gif        }

 51InBlock.gif        else
 52ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 53InBlock.gif            maxidctl.Value = minid.ToString();
 54InBlock.gif            minidctl.Value = maxid.ToString();
 55ExpandedSubBlockEnd.gif        }

 56ExpandedSubBlockEnd.gif    }

 57InBlock.gif
 58InBlock.gif    
 59InBlock.gif    void Page_Load()
 60ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
 61InBlock.gif        pagesize = 20;
 62InBlock.gif        con = new SqlConnection(@"Data Source=XIELAOSAN\SQLEXPRESS;Initial Catalog=AspStudy;User ID=xielaosan;Password=811116");
 63InBlock.gif        command = new SqlCommand();
 64InBlock.gif        command.Connection = con;
 65InBlock.gif        con.Open();
 66InBlock.gif        
 67InBlock.gif        if (!IsPostBack)
 68ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 69InBlock.gif            command.CommandText = "select top " + pagesize + " * from TestPaging";
 70InBlock.gif            dr = command.ExecuteReader();
 71InBlock.gif            DataTable dt = CreateDataTable(dr);
 72InBlock.gif            data1.DataSource = dt;
 73InBlock.gif            data1.DataBind();
 74InBlock.gif            dr.Close();
 75InBlock.gif            //获取该页面上的最大id和最小id,保存到隐藏控件中
 76InBlock.gif            SaveIndex(dt);
 77ExpandedSubBlockEnd.gif        }

 78InBlock.gif        //设置总页数和当前页数
 79InBlock.gif        command.CommandText = "select count(id) from TestPaging";
 80InBlock.gif        dr = command.ExecuteReader();
 81InBlock.gif        dr.Read();
 82InBlock.gif        int recordcount = dr.GetInt32(0);
 83InBlock.gif        pagecount = (recordcount-1-((recordcount-1)%pagesize))/pagesize + 1;
 84InBlock.gif        lblTotalPage.Text = "当前是第1页/" + "总共" + pagecount + "";
 85InBlock.gif        dr.Close();
 86InBlock.gif        curpage = Int32.Parse(curpagectl.Value);
 87ExpandedSubBlockEnd.gif    }

 88InBlock.gif
 89InBlock.gif    protected void btnNext_Click(object sender, EventArgs e)
 90ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
 91InBlock.gif        int minid = Int32.Parse(minidctl.Value);
 92InBlock.gif        int maxid = Int32.Parse(maxidctl.Value);
 93InBlock.gif        command.CommandText = "select top 20 * from TestPaging where id>" + maxid + "";
 94InBlock.gif        dr = command.ExecuteReader();
 95InBlock.gif        DataTable dt = CreateDataTable(dr);
 96InBlock.gif        data1.DataSource = dt;
 97InBlock.gif        data1.DataBind();
 98InBlock.gif        dr.Close();
 99InBlock.gif        //获取该页面上的最大id和最小id,保存到隐藏控件中
100InBlock.gif        SaveIndex(dt);
101InBlock.gif        //保存当前页标号
102InBlock.gif        curpage ++;
103InBlock.gif        curpagectl.Value = curpage.ToString();
104InBlock.gif        if (curpage >= pagecount)
105ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
106InBlock.gif            btnNext.Visible = false;
107InBlock.gif            btnLast.Visible = false;
108ExpandedSubBlockEnd.gif        }

109InBlock.gif        else
110ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
111InBlock.gif            btnNext.Visible = true;
112InBlock.gif            btnLast.Visible = true;           
113ExpandedSubBlockEnd.gif        }

114InBlock.gif        if (curpage <= 1)
115ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
116InBlock.gif            btnFirst.Visible = false;
117InBlock.gif            btnPrev.Visible = false;
118ExpandedSubBlockEnd.gif        }

119InBlock.gif        else
120ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
121InBlock.gif            btnFirst.Visible = true;
122InBlock.gif            btnPrev.Visible = true;
123ExpandedSubBlockEnd.gif        }

124InBlock.gif        lblTotalPage.Text = "当前是第" + curpage + "页/" + "总共" + pagecount + "";
125ExpandedSubBlockEnd.gif    }

126InBlock.gif
127InBlock.gif    protected void btnLast_Click(object sender, EventArgs e)
128ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
129InBlock.gif        int minid = Int32.Parse(minidctl.Value);
130InBlock.gif        int maxid = Int32.Parse(maxidctl.Value);
131InBlock.gif        command.CommandText = "select top 20 * from TestPaging order by id desc";
132InBlock.gif        dr = command.ExecuteReader();
133InBlock.gif        DataTable dt = CreateDataTable(dr);
134InBlock.gif        DataView dv = new DataView(dt);
135InBlock.gif        dv.Sort = "id";
136InBlock.gif        data1.DataSource = dv;
137InBlock.gif        data1.DataBind();
138InBlock.gif        dr.Close();
139InBlock.gif        //获取该页面上的最大id和最小id,保存到隐藏控件中
140InBlock.gif        SaveIndex(dt);
141InBlock.gif        //保存当前页标号
142InBlock.gif        curpage = pagecount;
143InBlock.gif        curpagectl.Value = curpage.ToString();
144InBlock.gif        if (curpage <= 1)
145ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
146InBlock.gif            btnFirst.Visible = false;
147InBlock.gif            btnPrev.Visible = false;
148ExpandedSubBlockEnd.gif        }

149InBlock.gif        else
150ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
151InBlock.gif            btnFirst.Visible = true;
152InBlock.gif            btnPrev.Visible = true;
153ExpandedSubBlockEnd.gif        }

154InBlock.gif        if (curpage >= pagecount)
155ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
156InBlock.gif            btnNext.Visible = false;
157InBlock.gif            btnLast.Visible = false;
158ExpandedSubBlockEnd.gif        }

159InBlock.gif        else
160ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
161InBlock.gif            btnNext.Visible = true;
162InBlock.gif            btnLast.Visible = true;
163ExpandedSubBlockEnd.gif        }

164InBlock.gif        lblTotalPage.Text = "当前是第" + curpage + "页/" + "总共" + pagecount + "";
165ExpandedSubBlockEnd.gif    }

166InBlock.gif
167InBlock.gif    protected void btnPrev_Click(object sender, EventArgs e)
168ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
169InBlock.gif        int minid = Int32.Parse(minidctl.Value);
170InBlock.gif        int maxid = Int32.Parse(maxidctl.Value);
171InBlock.gif        command.CommandText = "select top 20 * from TestPaging where id<" + minid + " order by id desc";
172InBlock.gif        dr = command.ExecuteReader();
173InBlock.gif        DataTable dt = CreateDataTable(dr);
174InBlock.gif        DataView dv = new DataView(dt);
175InBlock.gif        dv.Sort = "id";
176InBlock.gif        data1.DataSource = dv;
177InBlock.gif        data1.DataBind();
178InBlock.gif        dr.Close();
179InBlock.gif        //获取该页面上的最大id和最小id,保存到隐藏控件中
180InBlock.gif        SaveIndex(dt);
181InBlock.gif        //保存当前页标号
182InBlock.gif        curpage --;
183InBlock.gif        curpagectl.Value = curpage.ToString();
184InBlock.gif        if (curpage <=1)
185ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
186InBlock.gif            btnFirst.Visible = false;
187InBlock.gif            btnPrev.Visible = false;
188ExpandedSubBlockEnd.gif        }

189InBlock.gif        else
190ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
191InBlock.gif            btnFirst.Visible = true;
192InBlock.gif            btnPrev.Visible = true;
193ExpandedSubBlockEnd.gif        }

194InBlock.gif        if (curpage >= pagecount)
195ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
196InBlock.gif            btnNext.Visible = false;
197InBlock.gif            btnLast.Visible = false;
198ExpandedSubBlockEnd.gif        }

199InBlock.gif        else
200ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
201InBlock.gif            btnNext.Visible = true;
202InBlock.gif            btnLast.Visible = true;
203ExpandedSubBlockEnd.gif        }

204InBlock.gif        lblTotalPage.Text = "当前是第" + curpage + "页/" + "总共" + pagecount + "";
205ExpandedSubBlockEnd.gif    }

206InBlock.gif
207InBlock.gif    protected void btnFirst_Click(object sender, EventArgs e)
208ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
209InBlock.gif        int minid = Int32.Parse(minidctl.Value);
210InBlock.gif        int maxid = Int32.Parse(maxidctl.Value);
211InBlock.gif        command.CommandText = "select top 20 * from TestPaging order by id asc";
212InBlock.gif        dr = command.ExecuteReader();
213InBlock.gif        DataTable dt = CreateDataTable(dr);
214InBlock.gif        data1.DataSource = dt;
215InBlock.gif        data1.DataBind();
216InBlock.gif        dr.Close();
217InBlock.gif        //获取该页面上的最大id和最小id,保存到隐藏控件中
218InBlock.gif        SaveIndex(dt);
219InBlock.gif        //保存当前页标号
220InBlock.gif        curpage = 1;
221InBlock.gif        curpagectl.Value = curpage.ToString();
222InBlock.gif        if (curpage >= pagecount)
223ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
224InBlock.gif            btnNext.Visible = false;
225InBlock.gif            btnLast.Visible = false;
226ExpandedSubBlockEnd.gif        }

227InBlock.gif        else
228ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
229InBlock.gif            btnNext.Visible = true;
230InBlock.gif            btnLast.Visible = true;
231ExpandedSubBlockEnd.gif        }

232InBlock.gif        if (curpage <= 1)
233ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
234InBlock.gif            btnFirst.Visible = false;
235InBlock.gif            btnPrev.Visible = false;
236ExpandedSubBlockEnd.gif        }

237InBlock.gif        else
238ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
239InBlock.gif            btnFirst.Visible = true;
240InBlock.gif            btnPrev.Visible = true;
241ExpandedSubBlockEnd.gif        }

242InBlock.gif        lblTotalPage.Text = "当前是第" + curpage + "页/" + "总共" + pagecount + "";
243InBlock.gif
244ExpandedSubBlockEnd.gif    }

245InBlock.gif
246InBlock.gif    protected void btnJumpToPage_Click(object sender, EventArgs e)
247ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
248InBlock.gif        int minid = Int32.Parse(minidctl.Value);
249InBlock.gif        int maxid = Int32.Parse(maxidctl.Value);
250InBlock.gif        int pagenum = Int32.Parse(txtPageNum.Text);
251InBlock.gif        if (pagenum > 1 && pagenum <pagecount)
252ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
253InBlock.gif
254InBlock.gif            command.CommandText = "select top 20 * from TestPaging where id>"
255InBlock.gif                + "(select max(id) from TestPaging where id in "
256InBlock.gif                + "(select top " + pagesize * (pagenum - 1+ " id from TestPaging as temptable))";
257InBlock.gif            dr = command.ExecuteReader();
258InBlock.gif            DataTable dt = CreateDataTable(dr);
259InBlock.gif            data1.DataSource = dt;
260InBlock.gif            data1.DataBind();
261InBlock.gif            dr.Close();
262InBlock.gif            //获取该页面上的最大id和最小id,保存到隐藏控件中
263InBlock.gif            SaveIndex(dt);
264InBlock.gif            //保存当前页标号
265InBlock.gif            curpage = pagenum;
266InBlock.gif            curpagectl.Value = curpage.ToString();
267InBlock.gif            if (curpage >= pagecount)
268ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
269InBlock.gif                btnNext.Visible = false;
270InBlock.gif                btnLast.Visible = false;
271ExpandedSubBlockEnd.gif            }

272InBlock.gif            else
273ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
274InBlock.gif                btnNext.Visible = true;
275InBlock.gif                btnLast.Visible = true;
276ExpandedSubBlockEnd.gif            }

277InBlock.gif            if (curpage <= 1)
278ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
279InBlock.gif                btnFirst.Visible = false;
280InBlock.gif                btnPrev.Visible = false;
281ExpandedSubBlockEnd.gif            }

282InBlock.gif            else
283ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
284InBlock.gif                btnFirst.Visible = true;
285InBlock.gif                btnPrev.Visible = true;
286ExpandedSubBlockEnd.gif            }

287InBlock.gif            lblTotalPage.Text = "当前是第" + curpage + "页/" + "总共" + pagecount + "";
288ExpandedSubBlockEnd.gif        }

289ExpandedBlockEnd.gif    }

290None.gif
</script>
291None.gif
292None.gif<html xmlns="http://www.w3.org/1999/xhtml" >
293None.gif<head runat="server">
294None.gif    <title>Untitled Page</title>
295None.gif</head>
296None.gif<body>
297None.gif    <form id="form1" runat="server">
298None.gif    <div>
299None.gif    <asp:DataGrid runat=server ID="data1"></asp:DataGrid><br />
300None.gif        &nbsp;<asp:HiddenField ID="minidctl" runat="server" />
301None.gif        <asp:HiddenField ID="maxidctl" runat="server" />
302None.gif        <asp:HiddenField ID="curpagectl" runat="server" Value="1" />
303None.gif        <asp:Label ID="lblTotalPage" runat="server" Text="Label"></asp:Label>
304None.gif        <asp:Button ID="btnFirst" runat="server" Text="首页" OnClick="btnFirst_Click" />
305None.gif        <asp:Button ID="btnPrev" runat="server" Text="上一页" OnClick="btnPrev_Click" />
306None.gif        <asp:Button ID="btnNext" runat="server" OnClick="btnNext_Click" Text="下一页" />
307None.gif        <asp:Button ID="btnLast" runat="server" Text="尾页" OnClick="btnLast_Click" />
308None.gif        <asp:Label ID="Label2" runat="server" Text="跳转到"></asp:Label>
309None.gif        <asp:TextBox ID="txtPageNum" runat="server" Height="12px" Width="16px"></asp:TextBox>
310None.gif        <asp:Label ID="Label3" runat="server" Text="页"></asp:Label>
311None.gif        <asp:Button ID="btnJumpToPage" runat="server" Text="Go" OnClick="btnJumpToPage_Click" /></div>
312None.gif    </form>
313None.gif</body>
314None.gif</html>
315None.gif

转载于:https://www.cnblogs.com/jhobo/archive/2006/08/17/479465.html


https://dhexx.cn/news/show-969722.html

相关文章

DirectShow 使用时个人整理的一些常见问题和解决方案

SDK中Sample编译错误及其解决方案 SDK中Sample的编译环境 如果使用Microsoft Visual Studio 2005&#xff0c;在工具->选项->项目和解决方案->vc目录中进行如下设置。 可执行文件&#xff1a; D:/Program Files/Microsoft Visual Studio 8/VC D:/Program Files/Micros…

社交、职场28条

1.长相不令人讨厌&#xff0c;如果长得不好&#xff0c;就让自己有才气&#xff1b;如果才气也没有&#xff0c;那就总是微笑。 2.气质是关键。如果时尚学不好&#xff0c;宁愿纯朴。 3.与人握手时&#xff0c;可多握一会儿。真诚是宝。4.不必什么都用“我”做主语。 5.不要向朋…

【小程序开发】常见的内置组件

【小程序开发】常见的内置组件 文章目录【小程序开发】常见的内置组件写在前面一、Text文本组件二、Button按钮组件2.1 type属性2.2 open-type属性三、View视图组件三、Image图片组件3.1 mode属性3.2 wx.chooseMedia四、ScrollView滚动组件五、组件的共同属性写在前面 &#x1…

省略号怎么打

在中文输入法状态以及中文标点状态下&#xff0c;用shift键加数字6中文标点输入和英文标点输入可以用Ctrl .(句号)键相互切换

vs.net 2003安装时提示缺少组件FrontPage服务器扩展

问题&#xff1a; vs.net 2003安装时提示缺少组件"FrontPage服务器扩展" 如题&#xff0c;vs.net 2003在FAT32格式的系统中安装时提示缺少组件"FrontPage服务器扩展"&#xff0c;但我在IIS中已经安装了FrotPage扩展&#xff0c;后来Google了一下&#xff…

编写数据库操作类,使ASP.NET中的数据库操作变得简单

1ASP.NET中一般都是使用SQL Server作为后台数据库。一般的ASP.NET数据库操作示例程序都是使用单独的数据访问&#xff0c;就是说每个页面都写连接到数据库&#xff0c;存取数据&#xff0c;关闭数据库的代码。这种方式带来了一些弊端&#xff0c;一个就是如果你的数据库改变了&…

VMware7安装Fedora12的问题

Vmware一直是业内公认的专业虚拟机产品&#xff0c;它的许多功能&#xff0c;比如克隆、快照让我们程序员大大缩短了安装、调试OS的时间&#xff0c;一些喜欢冒险、从事危险实验的极客们也不用担心会对本地文件系统造成的损坏。网上有介绍说Vmware7增加了对Windows7的支持&…

Remoting學習(二)----用Reomoting 實現信息發送功能的代碼實現

昨天的那篇隨筆﹐全部是使用配置文件來實現的。那么根據配置文件﹐如何生成代碼訪問模式?1﹑首先將RemoteServer 和RemoteClient中的App.Config文件移除專案﹐注意是移除﹐不是刪除﹐要不﹐你以后要想再使用配置文件話﹐直接包含進來就可以啦。2﹑在frmServer的建構改為﹕pub…

VM7.0虚拟机安装Fodera12后上网设置(局域网上网)

首先在windows XP 中&#xff0c;查看所有的网络连接&#xff0c;你应该发现除了原有的网卡之外&#xff0c;又多了Vmnet1和Vmnet8。如果你看了一下说明书应该知道&#xff0c;vmnet1是hostonly的接口&#xff0c;而Vmnet8是使用NAT的网络接口。在这里我们既不想用VMWARE自带的…