插入< BR />标签编程(VB.NET) [英] Insert a <br /> tag programmatically (VB.NET)

查看:251
本文介绍了插入< BR />标签编程(VB.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图动态此显示增加的结果,我只是希望把休息标签的标签后,开始把信息放在下一行。出于某种原因,使用文字是不是为我工作。有没有更好的办法做到这一点,或者我应该只使用表?

I'm trying to dynamically add results to this display and I simply want to put a break tag after a label to start putting information on the next line. For some reason, Using a literal isn't working for me. Is there a better way to do this or should I just use tables?

Dim break As LiteralControl
break = New LiteralControl("<br />")
divListenerInfo.Controls.Add(break)

这是的code,我正在试图使用的部分。


让我澄清一下我说的:

That's part of the code that I'm attempting to use.


Let me clarify what I said:

这不工作作为换行符没有显示在网页上。它的编译很好,没有什么不对的code。它只是没有在HTML的一些奇怪的原因显示出来。

It's not working as in the line break isn't showing up on the webpage. It's compiling fine and there is nothing wrong with the code. It just doesn't show up in the html for some odd reason.

推荐答案

适当控制使用的是<一个href="http://msdn.microsoft.com/en-us/library/7512d0d0%28VS.71%29.aspx"><$c$c>HtmlGenericControl.

The proper control to use is the HtmlGenericControl.

Dim br As New HtmlGenericControl("br")

您可以使用 HtmlGenericControl 来呈现你想要的任何HTML元素,简单地传递元素的标记名称作为一个参数的构造函数。

You can use the HtmlGenericControl to render any HTML element you wish, simply pass the element's tag name as a single argument to the constructor.

这篇关于插入&LT; BR /&GT;标签编程(VB.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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