[thelist] ASP.NET: String or Control

Casey Crookston casey at thecrookstons.com
Mon Dec 13 13:37:39 CST 2004

How can I create a placeholder which is either a string or a control.  If
re-edit is true then I just need to hold a string.  If it's false then it
needs to contain a URL.



<script runat="server">
   Sub Page_Load(Src As Object, E As EventArgs)
   dim reedit as string = Request.Form("reedit")
   Dim userControl As Control
   If reedit="true" then
        pageToEdit = Request.Form("inpContent")
         userControl = Page.LoadControl("content/" &
Request.QueryString("page") & ".ascx")
  End If
end sub


 <asp:PlaceHolder id="pageToEdit" runat="server"/>

More information about the thelist mailing list