вот такой исходный текст
страница на которой отображается контролы, точнее доб-ся в плэйс холдер
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using BaseOfKnowledge.BusinessFacade;
using BaseOfKnowledge.Common;
using BaseOfKnowledge.DataAccess;
using BaseOfKnowledge.SystemFramework;
using BaseOfKnowledge.Web;
namespace BaseOfKnowledge.Web
{
/// <summary>
/// Summary description for mylecture.
/// </summary>
public class mycourse : PageBase
{
protected System.Web.UI.WebControls.Panel panel_usererror;
protected System.Web.UI.WebControls.PlaceHolder pl_courses;
protected BaseOfKnowledge.Web.SingleUserControlCourse[] suc_course;
private void MyInit()
{
if(logonStudent==null)
{
panel_usererror.Visible=true;
pl_courses.Visible=false;
}
else
{
int tmp_lecturerid = (int) logonStudent.Tables[StudentData.STUDENT_TABLE].Rows[ 0 ][StudentData.ID_FIELD];
int tmp_coursecount;
panel_usererror.Visible=false;
pl_courses.Visible=true;
CourseData courseData = (new CourseSystem()).GetCourses(tmp_lecturerid);
tmp_coursecount = courseData.Tables[CourseData.COURSE_TABLE].Rows.Count;
suc_course = new SingleUserControlCourse[tmp_coursecount];
for(int i= 0 ; i<tmp_coursecount;i++)
{
suc_course[i] = new SingleUserControlCourse();suc_course[i].CourseId=i;suc_course[i].CourseDataTable=courseData.Tables[ 1 ];
pl_courses.Controls.Add(suc_course[i]);
suc_course[i].Page=this;
// this.Controls.Add(suc_course[i]);
pl_courses.Controls.Add(new LiteralControl(" -!HELLO!- "));
}
}
}
private void Page_Load(object sender, System.EventArgs e)
{
this.DataBind();
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
MyInit();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
страница, представления
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
<%@ Register TagPrefix="uc" TagName="DownCapModule" Src="DownCapModule.ascx" %>
<%@ Register TagPrefix="uc" TagName="bokWebMenu" Src="WebMenu.ascx" %>
<%@ Register TagPrefix="uc" TagName="bokCapModule" Src="CapModule.ascx" %>
<%@ Register TagPrefix="uc" TagName="desktopswitcher" Src="desktopswitcher.ascx" %>
<%@ Page language="c#" Codebehind="mycourse.aspx.cs" AutoEventWireup="false" Inherits="BaseOfKnowledge.Web.mycourse" %>
<%@ Register TagPrefix="uc" TagName="SingleUserControlCourse" Src="suc_course.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Книга знаний: Рабочий стол : Мои учебные курсы</title>
<meta content="Microsoft Visual Studio 7.0" name=GENERATOR>
<meta content=C# name=CODE_LANGUAGE>
<meta content=JavaScript name=vs_defaultClientScript>
<meta content=http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema>
<meta content=bok.css name=StyleSheet><LINK href="bok.css" type=text/css rel=stylesheet >
</HEAD>
<body bottomMargin= 0 leftMargin= 0 topMargin= 0 rightMargin= 0 ><uc:bokcapmodule id=myCapModule runat="server"></uc:bokcapmodule>
<table height= 400 cellSpacing= 0 cellPadding= 0 >
<tr>
<!--меню-->
<td vAlign=top align=right width= 142 ><uc:bokwebmenu id=myWebMenu runat="server"></uc:bokwebmenu></td>
<!---->
<td width= 1 bgColor=#c9c9c9></td>
<!--текст-->
<td vAlign=top>
<table cellSpacing= 5 cellPadding= 10 >
<tr>
<td> <uc:desktopswitcher id=myDesktopswitcher runat="server"></uc:desktopswitcher> <br><br>
</td>
</tr>
<tr>
<td>
<br>
Добро пожаловать!
<asp:Panel id="panel_usererror" runat="server" Visible="false">Извините, но необходимо войти в систему, прежде чем вы сможите работать с вашими учебными курсами</asp:Panel>
<br><asp:PlaceHolder id="pl_courses" runat="server"></asp:PlaceHolder><br>
</td>
</tr>
</table>
</td>
<!--текст--></tr></table>
<uc:DownCapModule id=myDownCapModule runat="server"></uc:DownCapModule>
</body>
</HTML>
страница контрола представления
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="suc_course.ascx.cs" Inherits="BaseOfKnowledge.Web.SingleUserControlCourse" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<asp:DataGrid Runat="server" ID="dg_suc_course" AutoGenerateColumns="False" ShowHeader="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<TABLE id=Table1 cellSpacing= 1 cellPadding= 4 width= 630 border= 0 >
<TR>
<TD><b>№ курса: </b> <asp:Label ID="label_courseid" Runat="server"><%# DataBinder.Eval(courseDataTable, "[CourseId].id") %> </asp:Label></TD>
<TD><b>Итоговый контроль: </b> <%# DataBinder.Eval(courseDataTable, "[CourseId].name") %></TD></TR>
<TR>
<TD><b>Дисциплина: </b> <%# DataBinder.Eval(courseDataTable, "[CourseId].name") %></TD>
<TD><b>Лектор/Преподаватель: </b> <%# DataBinder.Eval(courseDataTable, "[CourseId].name") %></TD></TR>
<TR>
<TD><b>Название: </b> <br> <%# DataBinder.Eval(courseDataTable, "[CourseId].name") %></TD></TR>
<TR>
<TD><b>Примечание курса: </b> <br> <%# DataBinder.Eval(courseDataTable, "[CourseId].name") %></TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
страница кода контрола
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
namespace BaseOfKnowledge.Web
{
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using BaseOfKnowledge.Common;
/// <summary>
/// Summary description for suc_course.
/// </summary>
//public abstract class SingleUserControlCourse : ModuleBase
public class SingleUserControlCourse : ModuleBase
{
protected System.Web.UI.WebControls.DataGrid dg_suc_course;
protected Label label_courseid;
protected DataTable courseDataTable;
/* public SingleUserControlCourse(CourseData dataCourse,int courseid)
{
CourseId=courseid;
courseData = dataCourse;
label_courseid.Text=Convert.ToString(courseid);
dg_suc_course.DataSource=dataCourse;
this.DataBind();
}
1 */
public int CourseId
{
get
{
return Int32.Parse(label_courseid.Text);
}
set
{
if(label_courseid==null) label_courseid = new Label();
label_courseid.Text=Convert.ToString(value);
}
}
public DataTable CourseDataTable
{
get
{
return courseDataTable;
}
set
{
courseDataTable=value;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
if(logonStudent==null)
{
//nothing
this.Visible=false;
}
else
{
this.DataBind();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
так вот контролы создаются, добавляются, но на странице отображаются почему-то только литерал-контролы, а мои собственне почему-то нет
????????