由网友(不够优秀何以拥有)分享简介:这是我的ASP:按钮code这是不渲染字体真棒图标,而是显示HTML,因为它是:This is my asp:button code which is not rendering font awesome's icon but instead shows the HTML as it is:这是我的ASP:按钮code这是不渲染字体真棒图标,而是显示HTML,因为它是:
This is my asp:button code which is not rendering font awesome's icon but instead shows the HTML as it is:
<asp:Button runat="server" ID="btnRun" Text="<i class='icon-camera-retro'></i> Search" ValidationGroup="edt" OnClick="btnRun_Click" CssClass="greenButton"/>
任何想法,我怎么能解决这个问题呢?
Any idea how can I solve this issue?
推荐答案
您不能使用默认asp.net按钮,您将需要使用一个HTML按钮,并给它RUNAT =服务器属性:
You can't with the default asp.net button you will need to use a HTML button and give it runat=server attribute:
<button runat="server" id="btnRun" class="btn btn-mini" title="Search">
<i class="icon-camera-retro"></i> Search
</button>
因此,与此背后使用code添加:
So use code behind with this you add:
onserverclick="functionName"
要的按钮,然后在C#做的:
To the button, then in your C# do:
protected void functionName(object sender, EventArgs e)
{
Response.Write("Hello World!!!");
}
所以,最后的按钮看起来像:
So final button looks like:
<button runat="server" id="btnRun" onserverclick="functionName" class="btn btn-mini" title="Search">
<i class="icon-camera-retro"></i> Search
</button>
相关推荐
最新文章