0
我試圖在文本框的值初始化爲以下內容的UI上顯示文本框。無法使用iframe標記設置文本框
這是我的代碼。
...
<asp:TextBox ID="txtTest" runat="server" Visible="true" />
...
protected void Page_Load(object sender, EventArgs e)
{
txtTest.Text = "<iframe width=\"100%\" height=\"300\" src=\"//jsfiddle.net/vhyseni/rj0tv76x/embedded/\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\"></iframe>"
}
但是,在加載頁面時文本框爲空。如果我拼錯iframe或使用其他文本(即使例如「hello」),則文本框被正確初始化。是否有一些問題與asp文本框,使此字符串無效?
你可以得到一個[MCVE]之前,你的HTML編碼? –
它填充文本框就好了(在我把';'放在最後) – VDWWD