从后面code添加文本传说 [英] adding text to legend from code behind

查看:112
本文介绍了从后面code添加文本传说的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何添加文本从code传奇背后

how can i add text to a legend from code behind

推荐答案

假设你正在谈论的 HTML标签传说并使用一个ASP.NET网站C#。你可以给它一个ID和一个=服务器,那么你可以从code。通过名称来访问它背后并更改其text属性。

Assuming you're talking about the HTML Legend Tag and using C# in an ASP.NET site. You can give it an ID and a runat="server" then you can access it from the code behind by name and change its text property.

<form id="form1" runat="server">
<fieldset>
<legend id="myLegend" runat="server">Personalia:</legend>
Name: <input type="text" size="30" /><br />
Email: <input type="text" size="30" /><br />
Date of birth: <input type="text" size="10" />
</fieldset>
</form>

然后在后面的code:

Then in the code behind:

myLegend.InnerText = "Foo";

这篇关于从后面code添加文本传说的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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