amberouter
New Member
In asp I can do this...<BR><%if admin=1 then %><BR><input name=Box1 type=textbox><BR><%else%><BR><input name=Box1 type=dropdown><BR><%end if><BR><BR>Anyway to do it in ASP.NET???I assume you mean <BR><SELECT>, not <INPUT type=dropdown>? <= Does that really work?<BR><BR>Put an <asp
laceholder id=MyPlaceholder runat=server /><BR>on the page and use this code:<BR><BR>If admin = 1 Then<BR> objMyTextbox = New TextBox<BR> objMyTextbox.ID = "Box1"<BR> MyPlaceholder.Controls.Add(objMyTextbox)<BR>Else<BR> objDDL = New DropDownList<BR> objDDL.ID = "Box1"<BR> objDDL.Items.Add(New ListItem("First Item", "1"))<BR> objDDL.Items.Add(New ListItem("Second Item", "2"))<BR> objDDL.Items.Add(New ListItem("Third Item", "3"))<BR> MyPlaceholder.Controls.Add(objDDL)<BR>End If<BR><BR>
