Solved

.NET file include from variable

Posted on 2004-10-21
3
148 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

23 Experts available now in Live!

Get 1:1 Help Now