lblmessage在当前上下文中不存在

编程入门 行业动态 更新时间:2024-10-26 02:32:12
本文介绍了lblmessage在当前上下文中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请帮帮我.. 标签在UI中有id ..但在代码后面如果我使用标签的id ...它是显示错误说lblmessage在当前上下文中不存在..

please help me out.. The label has id in the UI.. but in code behind if i use the id of label...it is showing error saying lblmessage doesn''t exist in the current context..

<asp:Label runat="server" ID="lblMessage" Text="" class="multi">

如果我在后面的代码中使用上面的id我得到错误

if i use the above id in code behind am getting error

lblMessage.Text += fileName + "Uploaded";

推荐答案

您可能缺少结束标记:你有没有删除结尾的斜杠? Probably, you are missing the closing tag: Have you deleted the slash from the end? <asp:Label runat="server" ID="lblMessage" Text="" class="multi">

成为

Becomes

<asp:Label runat="server" ID="lblMessage" Text="" class="multi"/>

如果您没有错过结束标签检查是否啦bel具有与您尝试在.cs文件中使用的相同ID。 否则删除此添加新标签给它一个不同的名称'''并构建解决方案,之后使用它。 cs文件 if you are not missing the closing tag check if label has same id as you are trying to use in .cs file. otherwise delete this add a new label give it a different name '''' and build the solution and after that use it in .cs file

构建您的网站,然后在代码后面使用标签。有时它可以工作。 build your website once then use label in code behind. sometimes it works.

更多推荐

lblmessage在当前上下文中不存在

本文发布于:2023-11-09 15:11:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572695.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上下文   中不   lblmessage

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!