如何根据不同条件输入不同控件
以下代碼在Asp中是可以的,但在asp.net 中不行,請問有什么辦法嗎?
<form id="form1" runat="server">
<div />
<%string aaa;
aaa = "2";
if (aaa == "1")
{
%>
<asp:TextBox ID="TextBox1" Text="1" runat="server"></asp:TextBox>
<%}
%>
<%
else
{
%>
<asp:TextBox ID="TextBox1" Text="2" runat="server"></asp:TextBox>
<%
}
%>
</form>