我要簡單的形式添加到ASP:佔位符如何html表單添加到ASP:佔位符(缺少表單標籤)
<form action="https://www...." method="post" target="_top">
<input type="hidden"...
<input type="hidden"...
<input type="image" ...name="submit">
</form>
在PageLoad()
我說:
data = "<form action=...."
this.myPlaceHolder.Controls.Add(new LiteralControl(data));
當頁面呈現頁面的源代碼是:
<input type="hidden"...
<input type="hidden"...
<input type="image"...name="submit"...
<img alt=""...
正如你可以看到沒有表單標籤? 但我確定data
變量包含「<form ...
」。 有沒有其他的方式來添加表格到placeholder
也許我使用錯誤的方法?
你不能編輯.aspx文件嗎? – Curt 2013-04-22 11:30:44
不,我必須添加這個表單動態 – 1110 2013-04-22 11:31:15
直接使用Literal來添加表單,以及其餘的數據。 – Aristos 2013-04-22 11:35:06