[thelist] ASP.NET: String or Control
David Mitchell
dave at dbmdata.com
Mon Dec 13 13:46:14 CST 2004
You could use a literal control and just load the URL into the literal,
or use a Hyperlink control and set the URL as the NavigateUrl property.
Casey Crookston wrote:
> 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.
>
> Thanks,
>
> Casey
>
> <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")
> Else
> userControl = Page.LoadControl("content/" &
> Request.QueryString("page") & ".ascx")
> pageToEdit.Controls.Add(userControl)
> End If
> end sub
> </script>
>
> ...
>
> <asp:PlaceHolder id="pageToEdit" runat="server"/>
>
>
>
>
>
>
More information about the thelist
mailing list