Solved

.NET file include from variable

Posted on 2004-10-21
3
149 Views
Last Modified: 2013-11-18
hi,

I have a problem.
I want to make a page that shows different content on extensions.
e.g.
when address is default.aspx it shows the main page
when address is default.aspx?do=register then it shows the registering form
etc..

in php and that was quite easy
if request("do") = "register" then
inc_filename = "register.inc.asp"
else
inc_filename = "main.inc.asp"
end if

in .net I found an article where it explains that You have to use
<%@ Register TagPrefix="controlname" TagName="tagname" Src="file.ascx" %>
tag and control in the body.. but in this case it's not possible to change the source..

looking forward to Your help and guidence

R.
0
Comment
Question by:reesus
3 Comments
 
LVL 8

Accepted Solution

by:
razo earned 125 total points
ID: 12368344
what u can do is have different user controls
and then load the usercontrol to the webform based on the request value
to add a control dynamically u can use a place holder
 Dim c1 As UserControl = LoadControl("controlname.ascx")
        c1.ID = "id"

      placeholder1.Controls.Add(c1)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Open form in the top right hand corner of screen 5 36
Help with converting data format in xml file using VB.NET 11 54
vb.net 2 37
Help with Query not working in client's PC 1 35
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now