Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 3rd, 2006, 03:12 AM
Authorized User
 
Join Date: Aug 2005
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.net many pages on one page?

How can I do that it would look on my page that all pages would be on same page.

EX. Login page would see on address bar ..../default.aspx?page=login
    Main page would see on address bar ..../default.aspx?page=main
    pictures page would see on address bar .../default.aspx?page=gallery
All pages have same layout.

pls Help

 
Old February 3rd, 2006, 07:23 AM
Registered User
 
Join Date: Dec 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to munnu Send a message via Yahoo to munnu
Default

Hi Lofa,

Use of Panels will give u the required output.
example.. You design the LoginPage in one panel say panel1, MainPage in another panel say panel2, and Picture page in another panel say panel3.

In ur code behind page... try like this..
        If Request.QueryString("Page") = "login" Then
            panel1.visible = True
            panel2.visible = False
            panel3.visible = False
        ElseIf Request.QueryString("Page") = "main" Then
            panel1.visible = False
            panel2.visible = True
            panel3.visible = False
        ElseIf Request.QueryString("Page") = "gallery" Then
            panel1.visible = False
            panel2.visible = False
            panel3.visible = True
        End If

I think this way u can avoid the number of pages.

Mail me back if this doesn't help u.

regards,
Munavvar

 
Old February 3rd, 2006, 12:51 PM
Authorized User
 
Join Date: Aug 2005
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That would be much coding if I have like 10 pages. Is there not a easyer solution?
I use a SQL Database where I have a menu structure that loads on the pages.

 
Old February 10th, 2006, 07:42 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you want to use ASP.NET 2.0 you can use masterpages.

Or for ASP.NET 1.1:
http://www.geekdork.com/WebSkeleton/

-Peter
 
Old February 12th, 2006, 12:51 PM
Authorized User
 
Join Date: Aug 2005
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did get this script from a another forum

I .aspx.vb file write this
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs)

       Dim strload As String

        If Request.QueryString("Page") = "" Then
            strload = "/home.net/home.ascx"
        Else
            strload = "/home.net/" & Request.QueryString("Page") & ".ascx"
        End If

        Dim ctrl1 As Control = CType(Page.LoadControl(strload), Control)
        PH1.Controls.Add(ctrl1)

    End Sub
and then in the aspx file where you want the page load this:
<asp:placeholder ID="PH1" runat="server"></asp:placeholder>

Then You can have pages in .ascx and you don't need html tags in ascx


 
Old February 13th, 2006, 12:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

When you do that, do you get the state management to work in the same way? Also, don't you have to load it on every page load?


Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading HTML pages into an ASP.NET page Dsypher ASP.NET 2.0 Basics 4 May 17th, 2007 07:21 AM
opening asp.net pages naidukap ASP.NET 1.0 and 1.1 Basics 0 October 17th, 2005 11:48 PM
How windows NET authentication done in ASP pages lakshmy_raj Classic ASP Basics 1 October 20th, 2004 02:28 AM
Varibles between asp.net and Asp Pages koneruvijay VS.NET 2002/2003 1 February 23rd, 2004 04:32 AM
Shall i use ASP page and ASPX pages in in .net prj bvrao VS.NET 2002/2003 4 January 5th, 2004 04:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.