我如何显示,在标签中写消息 [英] How I Show Respose,Write Message In Label

查看:86
本文介绍了我如何显示,在标签中写消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何展示respose,在标签中写消息,我试过这个但是没有工作

 lblmessage.Text =(Convert.ToString(Response.Write( 已保存)))

解决方案

是的,你真的需要拿一本关于ASP.NET的书并完成它。你需要从头开始并正确地学习如何做到这一点的简单陈述有很多错误。你绝对不会通过实验和一堆论坛帖子来学习这些东西。



正确的代码是:

< pre lang =c#> lblmessage.Text = 已保存;



但是,假设代码的其他所有内容都是正确的。


除了解决方案1:



在标签中写下任何消息都是毫无意义的。此外,不安全(或至少令人困惑) )如果标签使用得当;它应该带有一些输入元素的用途的解释,并为该输入元素提供一个访问键,用于给它一个键盘焦点;如果没有此焦点,则无法通过键盘编辑元素。我在过去的答案中对此进行了解释:能否请你帮忙 [ ^ ]。



-SA


how i show respose,write message in label ,i tried this but not working

lblmessage.Text = (Convert.ToString(Response.Write("Saved")) )

解决方案

Yeah, you REALLY need to pickup a book on ASP.NET and work through it. There's so much wrong with that one simple statement you need to start at the very beginning and properly learn how to do this. You're definitely not going to learn this stuff through experimentation and a bunch of forum posts.

The correct code would be:

lblmessage.Text = "Saved";


But, this assumes everything else with your code is correct.


In addition to Solution 1:

It's pretty much pointless to write any message in a label. Also, it is unsafe (or at least confusing) if the label is used properly; it should carry the explanation of the purpose of some input element and provide an access key for that input element, which is used to give a keyboard focus to it; without this focus, the element cannot be edited via a keyboard. I explained it in my past answer: Can you please help[^].

—SA


这篇关于我如何显示,在标签中写消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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