Usercontrols src folder is virtual and undesired.

E

Edwin Knoppert

I generate code, want to set the SRC in a more dynamic way but it's not
allowed to insert server side commands.
Reason is that i have problems on different servers where the app's
rootfolder differs.

<%@ register TagPrefix="forms" TagName="form1_" Src="~/forms/form1.ascx" %>

Is there a solution like registering from within the .vb file instead?

I don't want to use the web.config for this matter.
 
K

Karl Seguin [MVP]

dim c as control = Page.LoadControl("~/forms/whatever.ascx")
SomePlaceHolderOnYourPage.Controls.Add(c)

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top