我怎样才能得到一个空格在“文本:”“”“内的一个asp.net标签
问题描述:
<asp:RadioButtonList ID="RadioButtonListGutscheinArt" Visible="true" runat="server">
<asp:ListItem ID="ListItemZugAbonnement" Text="Ich besitze bereits ein Zug-Abonnement oder bin bei Lehrbeginn noch nicht 16 Jahre alt." Value="1" Selected="True" />
<asp:ListItem ID="ListItemBestellungHalbtax" Text="Bestellung Halbtax" Value="2" />
</asp:RadioButtonList>
我在我的web应用程序中创建了这个单选按钮列表。我需要在Text =“”元素内部制作空格/制表符。我该怎么做 ? NBSP;不工作,我不能在文本元素内添加任何标签,这是有点sh * t我怎样才能得到一个空格在“文本:”“”“内的一个asp.net标签
答
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
foreach (ListItem item in RadioButtonListGutscheinArt.Items)
{
item.Text = item.Text.Replace(" ", " ");
}
}
}
+0
你能帮我把我的问题回复给我吗?我被禁止问问因为我不知道该怎么问,以及当我问这个问题时如何编程。你会真正帮助我的upvote
可能重复[Textarea添加空间到文本开头?](http://*.com/questions/2457275/textarea-adding-space-to-beginning-text) –