试图找到Web表单的ClientID - 更新 [英] Trying to find ClientID of web form - Update

查看:135
本文介绍了试图找到Web表单的ClientID - 更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这有效:


< form>

< asp:TextBox id =" name" />

<%= name.ClientID%>

< / form>


但这不是工作:


< form>

< datagrid id =" dg">

< asp:TextBox ID = QUOT;名称" />

<%= name.ClientID%>

< / datagrid>

< / form>


并抛出错误:

编译错误

编译器错误消息:BC30451:未声明名称''name''。 br />

任何ida为什么???


TIA

.... Geshel

-

************************************* *********** ********************

我的回复是一个自动监控的垃圾邮件蜜罐。除非你想被SpamCop列入黑名单,否则不要使用

。请以我的姓氏dot org回复我的第一个

名称。

********************* ***************************** ********************

This works:

<form>
<asp:TextBox id="name" />
<%= name.ClientID %>
</form>

But this DOES NOT work:

<form>
<datagrid id="dg">
<asp:TextBox id="name" />
<%= name.ClientID %>
</datagrid>
</form>

and throws an error of:
Compilation Error
Compiler Error Message: BC30451: Name ''name'' is not declared.

Any ida why???

TIA
....Geshel
--
************************************************** ********************
My reply-to is an automatically monitored spam honeypot. Do not use it
unless you want to be blacklisted by SpamCop. Please reply to my first
name at my last name dot org.
************************************************** ********************

推荐答案

我试图运行你的代码,但他们甚至缺乏runat = server。尝试在发布代码之前做出更好的

努力。


干杯,

Tom Pester
I tried to run your code but they even lack runat=server. Try to make a better
effort before posting code.

Cheers,
Tom Pester
这有效:

< form>
< asp:TextBox id =" name" />
<%= name.ClientID%>
< / form>
但这不起作用:

< form>
< datagrid id =" dg">
< asp:TextBox id =" name" />
<%= name.ClientID%>
< / datagrid>
< / form>
并抛出错误:
编译错误
编译器错误消息:BC30451:名称''name''未声明。
任何ida为什么???

TIA
... Geshel
This works:

<form>
<asp:TextBox id="name" />
<%= name.ClientID %>
</form>
But this DOES NOT work:

<form>
<datagrid id="dg">
<asp:TextBox id="name" />
<%= name.ClientID %>
</datagrid>
</form>
and throws an error of:
Compilation Error
Compiler Error Message: BC30451: Name ''name'' is not declared.
Any ida why???

TIA
...Geshel



这很好用:


< form runat =" server">

< datagrid id =" dg">

< asp:TextBox id =" name" RUNAT = QUOT;服务器" />

<%= name.ClientID%>

< / datagrid>

< / form>


Juan T. Llibre

ASP.NET MVP
http://asp.net.do/foros/

Foros de ASP.NET en Espa?ol

Ven ,y hablemos de ASP.NET ...

======================


Neo Geshel <去**** @ geshel.org>在消息中写道

新闻:O4 ************** @ tk2msftngp13.phx.gbl ...
This works fine :

<form runat="server">
<datagrid id="dg">
<asp:TextBox id="name" Runat="Server" />
<%=name.ClientID %>
</datagrid>
</form>

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
Ven, y hablemos de ASP.NET...
======================

"Neo Geshel" <go****@geshel.org> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...
这有效:

< form>
< asp:TextBox id =" name" />
<%= name.ClientID%>
< / form>

但这不起作用:

<表格>
< datagrid id =" dg">
< asp:TextBox id =" name" />
<%= name.ClientID%>
< / datagrid>
< / form>

并抛出错误:<编译错误
编译器错误消息:BC30451:名称''name''未声明。

任何ida为什么???

TIA
...... Geshel
-
********************************** **************** ********************
我的回复是一个自动监控的垃圾邮件蜜罐。不要使用
除非你想被SpamCop列入黑名单。请以我的姓氏dot org回复我的第一个姓名。
***************************** ********************* ********************
This works:

<form>
<asp:TextBox id="name" />
<%= name.ClientID %>
</form>

But this DOES NOT work:

<form>
<datagrid id="dg">
<asp:TextBox id="name" />
<%= name.ClientID %>
</datagrid>
</form>

and throws an error of:
Compilation Error
Compiler Error Message: BC30451: Name ''name'' is not declared.

Any ida why???

TIA
...Geshel
--
************************************************** ********************
My reply-to is an automatically monitored spam honeypot. Do not use it
unless you want to be blacklisted by SpamCop. Please reply to my first
name at my last name dot org.
************************************************** ********************



我刚刚意识到你正在尝试使用asp.net数据网格控件,

但是正在使用html< datagrid ...>语法。


你不能在数据网格中插入文本框,除非

你在代码中将它声明为ItemTemplate。


这就是为什么你没有宣布姓名'名称''的原因。错误。


试试这个,如果它适合你。


< form runat =" server">

< asp:datagrid id =" dg" runat =" server">

< / asp:DataGrid>

< asp:TextBox id =" name" RUNAT = QUOT;服务器" />

< br />

<%= name.ClientID%>

< / form>


如果你想在数据网格中插入一个文本框,

你会很好地学习Scott Mitchell的优秀数据网格教程:
< a rel =nofollowhref =http://aspnet.4guysfromrolla.com/articles/040502-1.aspxtarget =_ blank> http://aspnet.4guysfromrolla.com/articles/040502-1.aspx


教程的第9部分解释了如何做你想做的事:
http://aspnet.4guysfromrolla.com/articles/090902-1.aspx

< br $>
Juan T. Llibre

ASP.NET MVP
http://asp.net.do/foros/

Foros de ASP.NET en Espa?ol

Ven,y hablemos de ASP.NET ...

======================


Juan T. Llibre <无*********** @ nowhere.com>写在消息

新闻:Ox ************** @ TK2MSFTNGP15.phx.gbl ...
I just realized you are trying to use an asp.net datagrid control,
but are using html <datagrid...> syntax.

You can''t insert a textbox inside a datagrid unless
you declare it in code as an ItemTemplate.

That''s why you''re getting the "Name ''name'' is not declared." error.

Try this, if it suits you.

<form runat="server">
<asp:datagrid id="dg" runat="server">
</asp:DataGrid>
<asp:TextBox id="name" runat="Server" />
<br/>
<%=name.ClientID %>
</form>

If you want a textbox inserted inside a datagrid,
you''d do well to study Scott Mitchell''s excellent datagrid tutorial :
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

The 9th part of the tutorial explains how to do what you want to do:
http://aspnet.4guysfromrolla.com/articles/090902-1.aspx


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
Ven, y hablemos de ASP.NET...
======================

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Ox**************@TK2MSFTNGP15.phx.gbl...
这很好用:

< form runat =" server">
< datagrid id =" dg">
< asp:TextBox id =" name" RUNAT = QUOT;服务器" />
<%= name.ClientID%>
< / datagrid>
< / form>

Juan T. Llibre ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
Ven,y hablemos de ASP.NET ...
============== ========

Neo Geshel <去**** @ geshel.org>在消息中写道
新闻:O4 ************** @ tk2msftngp13.phx.gbl ...
This works fine :

<form runat="server">
<datagrid id="dg">
<asp:TextBox id="name" Runat="Server" />
<%=name.ClientID %>
</datagrid>
</form>

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
Ven, y hablemos de ASP.NET...
======================

"Neo Geshel" <go****@geshel.org> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...
这有效:

< form>
< asp:TextBox id =" name" />
<%= name.ClientID%>
< / form>

但这不起作用:

<表格>
< datagrid id =" dg">
< asp:TextBox id =" name" />
<%= name.ClientID%>
< / datagrid>
< / form>

并抛出错误:<编译错误
编译器错误消息:BC30451:名称''name''未声明。

任何ida为什么???

TIA
...... Geshel
-
********************************** **************** ********************
我的回复是一个自动监控的垃圾邮件蜜罐。不要使用
除非你想被SpamCop列入黑名单。请以我的姓氏dot org回复我的第一个姓名。
***************************** ********************* ********************
This works:

<form>
<asp:TextBox id="name" />
<%= name.ClientID %>
</form>

But this DOES NOT work:

<form>
<datagrid id="dg">
<asp:TextBox id="name" />
<%= name.ClientID %>
</datagrid>
</form>

and throws an error of:
Compilation Error
Compiler Error Message: BC30451: Name ''name'' is not declared.

Any ida why???

TIA
...Geshel
--
************************************************** ********************
My reply-to is an automatically monitored spam honeypot. Do not use it
unless you want to be blacklisted by SpamCop. Please reply to my first
name at my last name dot org.
************************************************** ********************




这篇关于试图找到Web表单的ClientID - 更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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