473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to include a webpage?

I need to include some webpages and am doing this in my index page:

<%@ Register TagPrefix="mysite" TagName="section1"
Src="/sub/section1.ascx" %>
<%@ Register TagPrefix="mysite" TagName="section2"
Src="/sub/section2.ascx" %>
<%@ Register TagPrefix="mysite" TagName="section3"
Src="/sub/section3.ascx" %>

On my main page, I'd like to include pages via URL. For example:

index.aspx?p=section1
index.aspx?p=section2
index.aspx?p=section3

I use this to bring in the selected page.

<p><mysite:%p%runat="server" /></p>

but how do I have it dynamically use the "p" variable? Of course the
above doesn't work.

Also, how do I set a default "p" value.

Thanks,
Brett

Jan 2 '06 #1
2 1287
By the time any code actually runs, ASP.NET has already created the object
model.

How about using a placeholder and using LoadControl in the code to load the
controls dynamically?

"brett" <ac*****@cygen.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I need to include some webpages and am doing this in my index page:

<%@ Register TagPrefix="mysite" TagName="section1"
Src="/sub/section1.ascx" %>
<%@ Register TagPrefix="mysite" TagName="section2"
Src="/sub/section2.ascx" %>
<%@ Register TagPrefix="mysite" TagName="section3"
Src="/sub/section3.ascx" %>

On my main page, I'd like to include pages via URL. For example:

index.aspx?p=section1
index.aspx?p=section2
index.aspx?p=section3

I use this to bring in the selected page.

<p><mysite:%p%runat="server" /></p>

but how do I have it dynamically use the "p" variable? Of course the
above doesn't work.

Also, how do I set a default "p" value.

Thanks,
Brett

Jan 2 '06 #2
Thanks. That's what I'm doing now.

I'm having another problem related to file names for the user controls.
If I have
index.ascx
sub/index.ascx

I'll get an error that index_aspx is defined in multiple places. If I
rename sub/index.ascx to sub/indexsub.ascx, all is fine. Both ASCX
files have different class names. Am I doing something wrong that it
won't let me have the same file name in different folders?

Thanks,
Brett

Jan 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Recoura Tim | last post by:
Hello, I'm writing a shoppingcart program in PHP. The website of our suplliers webpage i written in ASP. He has very detailed info about his products, that I want to include in my PHP page, I...
8
by: Christopher Brandsdal | last post by:
If I want to include a file to my webpage that is not placed in the same folder asd the application, but in another folder on the same disk... I found out that this is not going to work:...
5
by: Tiraman | last post by:
Hi , can I use an asp (not aspx) file as include in my aspx files ? lets say that I have a regular asp file that hold few functions , params (dim x etc ....) and cost's and i don't want to...
0
by: Sarav | last post by:
Hello Everybody, I had developed a Client side ActiveX control in VB6. I want that to include in my ASP.Net webPage. How can I include that ocx in my webpage? How can I call/set the control's...
3
by: indessen | last post by:
Hi, got the following problem: I need to include an HTML file that sits on another server B in an HTML file that sits on server A, and I need to include this at a particular place in the file....
4
by: Giorgio | last post by:
hi, how can i include a webpage from another server with ASP? (Without frames) i tried XMLHTTP, but i loose the stylesheet, images src and relative links of the included page. See...
3
by: =?Utf-8?B?QnJhbmRvbg==?= | last post by:
Hi, I have an aspx page that has the "include" code in it which includes another page that displays information. I also have an upload page that allows users to upload a simple html document...
1
by: escort | last post by:
I am trying to include a file in my existing asp file. I am using business vista and I am getting following error This error (HTTP 500 Internal Server Error) means that the website you are...
4
by: sales | last post by:
I have used Include pages for a menu bar within a webpage - See below. <!--webbot bot="Include" U-Include="menu-categories.htm" TAG="BODY" -- It works fine when the page is htm format, but when...
2
by: shanmugamit | last post by:
hi, i want to include some flash file in webpage.but i don't no how to include flash file in webpage.please any one help for me....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.