Solved

.NET file include from variable

Posted on 2004-10-21
3
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

749 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