将webcontrols.table添加到aspx - 不渲染 [英] Adding webcontrols.table to aspx - not rendering

查看:46
本文介绍了将webcontrols.table添加到aspx - 不渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在代码隐藏页面上:

(以编程方式为每个元素设置的属性)

linkbutton添加到tablecell

文本框添加到tablecell

tablecells添加到tablerow

tablerow添加到表(table.ID是TestTable)

On .aspx页面:

< HeaderTemplate>

< asp:Table ID =" TestTable" RUNAT = QUOT;服务器" />

< / HeaderTemplate>


浏览器中.aspx页面上的源代码显示表格,它的控件是

正确创建并放置。 Linkbutton和Textbox的控件不会在浏览器中显示
。我怀疑它与

runat =" server"有关。链接按钮或文本框的属性我不能找到我可以设置的属性(例如linkbutton.runat =" server")。关于如何展示这些元素的任何想法




tia,

Sue W.

On code-behind page:
(attributes set programatically for each of these elements)
linkbutton added to tablecell
textbox added to tablecell
tablecells added to tablerow
tablerow added to table (table.ID is TestTable)
On .aspx page:
<HeaderTemplate>
<asp:Table ID="TestTable" runat="Server" />
</HeaderTemplate>

Source code on .aspx page in browser shows the table and it''s controls are
correctly created and placed. Controls for the Linkbutton and Textbox do
not display in browser. I suspect it has something to do with the
runat="server" attribute for the linkbutton or textbox for which I do not
find an attribute I can set (e.g. linkbutton.runat = "server"). Any ideas
on how I can get these elements to display?

tia,
Sue W.

推荐答案

你好,


以下代码片段不会出现此问题。它是否适用于你身边的

?如果是这样,你可能想告诉我你身边的代码片段,所以

我可以测试它。谢谢。


private void Page_Load(object sender,System.EventArgs e)

{

int numrows = 3;

int numcells = 2;

for(int j = 0; j< numrows; j ++)

{

TableRow r = new TableRow();

for(int i = 0; i< numcells; i ++)

{

TableCell c = new TableCell ();

LinkBut​​ton lb = new LinkBut​​ton();


lb.Text = i.ToString();

if (i == 0)c.Controls.Add(lb);

else c.Controls.Add(new TextBox());

r.Cells.Add( c);

}

Table1.Rows.Add(r);

}

}


最好的问候,

Lewis Wang

支持专业


发布的帖子按原样没有保证,也没有权利。

--------------------

| MIME版本:1.0

| X-MIMETrack:在2011年7月23日在Susan L WILLIS / MUL / OJD上发布Notes客户端序列(发布

6.0.1 |二月

| 07,2003)上午11:45:57,

|序列化完成时间为07/23/2003 11:45:57 AM,

|由Susan L WILLIS / MUL / OJD上的Notes客户端序列化(发布

6.0.1 |二月

| 07,2003)于07/23/2003 11:46: 02 AM,

|序列化完成于07/23/2003 11:46:02 AM

|来自: Su *@ojd.state.or.us

|主题:将webcontrols.table添加到aspx - 不呈现

| X-Newsreader:Lotus Notes Release 6.0.1 2003年2月7日

|内容类型:text / plain; charset =" US-ASCII"

|消息ID:< #T ************** @ TK2MSFTNGP09.phx.gbl>

|新闻组:microsoft.public.dotnet.general

|日期:2003年7月23日星期三11:46:03 -0700

| NNTP-Posting-Host:159.121.96.200

|行数:1

|路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl

|外翻:cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:102197

| X-Tomcat-NG:microsoft.public.dotnet.general

|

|在代码隐藏页面:

| (以编程方式为每个元素设置属性)

| linkbutton添加到tablecell

|文本框添加到tablecell

| tablecells添加到tablerow

| tablerow添加到表中(table.ID是TestTable)

|在.aspx页面上:

| < HeaderTemplate>

| < asp:Table ID =" TestTable" RUNAT = QUOT;服务器" />

| < / HeaderTemplate>

|

|浏览器中.aspx页面上的源代码显示表格及其控件



|正确创建和放置。 Linkbutton和Textbox的控件执行

|不在浏览器中显示。我怀疑它与

|有关RUNAT = QUOT;服务器"我没有链接按钮或文本框的属性

|找到我可以设置的属性(例如linkbutton.runat =" server")。任何想法

|如何才能显示这些元素?

|

| tia,

| Sue W.

|

|

Hi Sue,

This problem doesn''t occur to the following code snippet. Does it work on
your side? If so, you may want to show me the code snippet on your side so
that I can test it. Thanks.

private void Page_Load(object sender, System.EventArgs e)
{
int numrows = 3;
int numcells = 2;
for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
for (int i=0; i<numcells; i++)
{
TableCell c = new TableCell();
LinkButton lb=new LinkButton ();

lb.Text=i.ToString();
if(i==0)c.Controls.Add(lb);
else c.Controls.Add(new TextBox());
r.Cells.Add(c);
}
Table1.Rows.Add(r);
}
}

Best Regards,
Lewis Wang
Support Professional

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| MIME-Version: 1.0
| X-MIMETrack: Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:45:57 AM,
| Serialize complete at 07/23/2003 11:45:57 AM,
| Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:46:02 AM,
| Serialize complete at 07/23/2003 11:46:02 AM
| From: Su*@ojd.state.or.us
| Subject: Adding webcontrols.table to aspx - not rendering
| X-Newsreader: Lotus Notes Release 6.0.1 February 07, 2003
| Content-Type: text/plain; charset="US-ASCII"
| Message-ID: <#T**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| Date: Wed, 23 Jul 2003 11:46:03 -0700
| NNTP-Posting-Host: 159.121.96.200
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:102197
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| On code-behind page:
| (attributes set programatically for each of these elements)
| linkbutton added to tablecell
| textbox added to tablecell
| tablecells added to tablerow
| tablerow added to table (table.ID is TestTable)
| On .aspx page:
| <HeaderTemplate>
| <asp:Table ID="TestTable" runat="Server" />
| </HeaderTemplate>
|
| Source code on .aspx page in browser shows the table and it''s controls
are
| correctly created and placed. Controls for the Linkbutton and Textbox do
| not display in browser. I suspect it has something to do with the
| runat="server" attribute for the linkbutton or textbox for which I do not
| find an attribute I can set (e.g. linkbutton.runat = "server"). Any ideas
| on how I can get these elements to display?
|
| tia,
| Sue W.
|
|


Hi Sue,

以下代码段不会出现此问题。它是否适用于你身边的

?如果是这样,你可能想告诉我你身边的代码片段,所以

我可以测试它。谢谢。


private void Page_Load(object sender,System.EventArgs e)

{

int numrows = 3;

int numcells = 2;

for(int j = 0; j< numrows; j ++)

{

TableRow r = new TableRow();

for(int i = 0; i< numcells; i ++)

{

TableCell c = new TableCell ();

LinkBut​​ton lb = new LinkBut​​ton();


lb.Text = i.ToString();

if (i == 0)c.Controls.Add(lb);

else c.Controls.Add(new TextBox());

r.Cells.Add( c);

}

Table1.Rows.Add(r);

}

}


最好的问候,

Lewis Wang

支持专业


发布的帖子按原样没有保证,也没有权利。

--------------------

| MIME版本:1.0

| X-MIMETrack:在2011年7月23日在Susan L WILLIS / MUL / OJD上发布Notes客户端序列(发布

6.0.1 |二月

| 07,2003)上午11:45:57,

|序列化完成时间为07/23/2003 11:45:57 AM,

|由Susan L WILLIS / MUL / OJD上的Notes客户端序列化(发布

6.0.1 |二月

| 07,2003)于07/23/2003 11:46: 02 AM,

|序列化完成于07/23/2003 11:46:02 AM

|来自: Su *@ojd.state.or.us

|主题:将webcontrols.table添加到aspx - 不呈现

| X-Newsreader:Lotus Notes Release 6.0.1 2003年2月7日

|内容类型:text / plain; charset =" US-ASCII"

|消息ID:< #T ************** @ TK2MSFTNGP09.phx.gbl>

|新闻组:microsoft.public.dotnet.general

|日期:2003年7月23日星期三11:46:03 -0700

| NNTP-Posting-Host:159.121.96.200

|行数:1

|路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl

|外翻:cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:102197

| X-Tomcat-NG:microsoft.public.dotnet.general

|

|在代码隐藏页面:

| (以编程方式为每个元素设置属性)

| linkbutton添加到tablecell

|文本框添加到tablecell

| tablecells添加到tablerow

| tablerow添加到表中(table.ID是TestTable)

|在.aspx页面上:

| < HeaderTemplate>

| < asp:Table ID =" TestTable" RUNAT = QUOT;服务器" />

| < / HeaderTemplate>

|

|浏览器中.aspx页面上的源代码显示表格及其控件



|正确创建和放置。 Linkbutton和Textbox的控件执行

|不在浏览器中显示。我怀疑它与

|有关RUNAT = QUOT;服务器"我没有链接按钮或文本框的属性

|找到我可以设置的属性(例如linkbutton.runat =" server")。任何想法

|如何才能显示这些元素?

|

| tia,

| Sue W.

|

|

Hi Sue,

This problem doesn''t occur to the following code snippet. Does it work on
your side? If so, you may want to show me the code snippet on your side so
that I can test it. Thanks.

private void Page_Load(object sender, System.EventArgs e)
{
int numrows = 3;
int numcells = 2;
for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
for (int i=0; i<numcells; i++)
{
TableCell c = new TableCell();
LinkButton lb=new LinkButton ();

lb.Text=i.ToString();
if(i==0)c.Controls.Add(lb);
else c.Controls.Add(new TextBox());
r.Cells.Add(c);
}
Table1.Rows.Add(r);
}
}

Best Regards,
Lewis Wang
Support Professional

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| MIME-Version: 1.0
| X-MIMETrack: Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:45:57 AM,
| Serialize complete at 07/23/2003 11:45:57 AM,
| Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:46:02 AM,
| Serialize complete at 07/23/2003 11:46:02 AM
| From: Su*@ojd.state.or.us
| Subject: Adding webcontrols.table to aspx - not rendering
| X-Newsreader: Lotus Notes Release 6.0.1 February 07, 2003
| Content-Type: text/plain; charset="US-ASCII"
| Message-ID: <#T**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| Date: Wed, 23 Jul 2003 11:46:03 -0700
| NNTP-Posting-Host: 159.121.96.200
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:102197
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| On code-behind page:
| (attributes set programatically for each of these elements)
| linkbutton added to tablecell
| textbox added to tablecell
| tablecells added to tablerow
| tablerow added to table (table.ID is TestTable)
| On .aspx page:
| <HeaderTemplate>
| <asp:Table ID="TestTable" runat="Server" />
| </HeaderTemplate>
|
| Source code on .aspx page in browser shows the table and it''s controls
are
| correctly created and placed. Controls for the Linkbutton and Textbox do
| not display in browser. I suspect it has something to do with the
| runat="server" attribute for the linkbutton or textbox for which I do not
| find an attribute I can set (e.g. linkbutton.runat = "server"). Any ideas
| on how I can get these elements to display?
|
| tia,
| Sue W.
|
|


Hi Sue,

以下代码段不会出现此问题。它是否适用于你身边的

?如果是这样,你可能想告诉我你身边的代码片段,所以

我可以测试它。谢谢。


private void Page_Load(object sender,System.EventArgs e)

{

int numrows = 3;

int numcells = 2;

for(int j = 0; j< numrows; j ++)

{

TableRow r = new TableRow();

for(int i = 0; i< numcells; i ++)

{

TableCell c = new TableCell ();

LinkBut​​ton lb = new LinkBut​​ton();


lb.Text = i.ToString();

if (i == 0)c.Controls.Add(lb);

else c.Controls.Add(new TextBox());

r.Cells.Add( c);

}

Table1.Rows.Add(r);

}

}


最好的问候,

Lewis Wang

支持专业


发布的帖子按原样没有保证,也没有权利。

--------------------

| MIME版本:1.0

| X-MIMETrack:在2011年7月23日在Susan L WILLIS / MUL / OJD上发布Notes客户端序列(发布

6.0.1 |二月

| 07,2003)上午11:45:57,

|序列化完成时间为07/23/2003 11:45:57 AM,

|由Susan L WILLIS / MUL / OJD上的Notes客户端序列化(发布

6.0.1 |二月

| 07,2003)于07/23/2003 11:46: 02 AM,

|序列化完成于07/23/2003 11:46:02 AM

|来自: Su *@ojd.state.or.us

|主题:将webcontrols.table添加到aspx - 不呈现

| X-Newsreader:Lotus Notes Release 6.0.1 2003年2月7日

|内容类型:text / plain; charset =" US-ASCII"

|消息ID:< #T ************** @ TK2MSFTNGP09.phx.gbl>

|新闻组:microsoft.public.dotnet.general

|日期:2003年7月23日星期三11:46:03 -0700

| NNTP-Posting-Host:159.121.96.200

|行数:1

|路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl

|外翻:cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:102197

| X-Tomcat-NG:microsoft.public.dotnet.general

|

|在代码隐藏页面:

| (以编程方式为每个元素设置属性)

| linkbutton添加到tablecell

|文本框添加到tablecell

| tablecells添加到tablerow

| tablerow添加到表中(table.ID是TestTable)

|在.aspx页面上:

| < HeaderTemplate>

| < asp:Table ID =" TestTable" RUNAT = QUOT;服务器" />

| < / HeaderTemplate>

|

|浏览器中.aspx页面上的源代码显示表格及其控件



|正确创建和放置。 Linkbutton和Textbox的控件执行

|不在浏览器中显示。我怀疑它与

|有关RUNAT = QUOT;服务器"我没有链接按钮或文本框的属性

|找到我可以设置的属性(例如linkbutton.runat =" server")。任何想法

|如何才能显示这些元素?

|

| tia,

| Sue W.

|

|

Hi Sue,

This problem doesn''t occur to the following code snippet. Does it work on
your side? If so, you may want to show me the code snippet on your side so
that I can test it. Thanks.

private void Page_Load(object sender, System.EventArgs e)
{
int numrows = 3;
int numcells = 2;
for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
for (int i=0; i<numcells; i++)
{
TableCell c = new TableCell();
LinkButton lb=new LinkButton ();

lb.Text=i.ToString();
if(i==0)c.Controls.Add(lb);
else c.Controls.Add(new TextBox());
r.Cells.Add(c);
}
Table1.Rows.Add(r);
}
}

Best Regards,
Lewis Wang
Support Professional

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| MIME-Version: 1.0
| X-MIMETrack: Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:45:57 AM,
| Serialize complete at 07/23/2003 11:45:57 AM,
| Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:46:02 AM,
| Serialize complete at 07/23/2003 11:46:02 AM
| From: Su*@ojd.state.or.us
| Subject: Adding webcontrols.table to aspx - not rendering
| X-Newsreader: Lotus Notes Release 6.0.1 February 07, 2003
| Content-Type: text/plain; charset="US-ASCII"
| Message-ID: <#T**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.general
| Date: Wed, 23 Jul 2003 11:46:03 -0700
| NNTP-Posting-Host: 159.121.96.200
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:102197
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| On code-behind page:
| (attributes set programatically for each of these elements)
| linkbutton added to tablecell
| textbox added to tablecell
| tablecells added to tablerow
| tablerow added to table (table.ID is TestTable)
| On .aspx page:
| <HeaderTemplate>
| <asp:Table ID="TestTable" runat="Server" />
| </HeaderTemplate>
|
| Source code on .aspx page in browser shows the table and it''s controls
are
| correctly created and placed. Controls for the Linkbutton and Textbox do
| not display in browser. I suspect it has something to do with the
| runat="server" attribute for the linkbutton or textbox for which I do not
| find an attribute I can set (e.g. linkbutton.runat = "server"). Any ideas
| on how I can get these elements to display?
|
| tia,
| Sue W.
|
|


这篇关于将webcontrols.table添加到aspx - 不渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆