;
43 </div>
44 <div>
45 <div id="itemPlaceholder" runat="server"></div>
46 </div>
47 </div>
48 </LayoutTemplate>
49 </asp:ListView>
50 </div>
ii.
朔岬?
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.UI;
6 using System.Web.UI.WebControls;
7
8 namespace WebAppForCustomControlTest
9 {
10 public partial class WebUserControlFir : System.Web.UI.UserControl
11 {
12 public delegate void ReturnEventHandler(object source, ReturnClass rc);
13 public event ReturnEventHandler ReturnContent;
14
15 public string HideScript { set; get; }
16 public string PopUpScript { set; get; }
17
18 protected void Page_Load(object sender, EventArgs e)
19 {
20 List<PersonClass> Persons = new List<PersonClass>();
21 for (int i = 0; i < 8; i++)
22 {
23 PersonClass p = new PersonClass() { Name = "User", Address = "Beijing", Phone = "01000000000" };
24 Persons.Add(p);
25 }
26
27 livData.DataSource = Persons;
28 livData.DataBind();
29 }
30
31 protected void OnClick_btnClose(object sender, EventArgs e)
32 {
33 labProcResult.Text = "Great, you''ve send the string you input to the main page!";
34 string InputStr = txtInput.Text;
35 if (!string.IsNullOrEmpty(InputStr))
36 {
37 ReturnClass rc = new ReturnClass();
38 rc.Name = txtInput.ID;
39 rc.Value = InputStr;
40 ReturnContent(this, rc);
41 ScriptManager.RegisterStartupScript(labProcResult, labProcResult.GetType(), "ReturnAndClose", HideScript, true);
42 }
43 }
44
45 protected void OnClick_btnChangeContent(object sender, EventArgs e)
46 {
47 List<PersonClass> Persons = new List<PersonClass>();
48 for (int i = 0; i < 70; i++)
49 {
50 PersonClass p =
|