Solved

.NET file include from variable

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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 …
Suggested Courses

624 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