Results 1 to 4 of 4

Thread: dynamicaly setting Startup page?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    95

    dynamicaly setting Startup page?

    hello,

    im developing an Application in asp.net and I want to set the statup page dynamically by reading the database. Is this is possible in asp.net. Yes means, how can i do it?

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    You can't change the startup page. But, you could have the start page a frame set with a footer frame set to be 1 pixel and load you main frames page based on a query to the database.

    Another option would be to simply redirect to the desired page in the load event of default.aspx or what ever page.

    Hope that helps.
    Magiaus

    If I helped give me some points.

  3. #3
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494

    Re: dynamicaly setting Startup page?

    Reviving this old thread because I came across it whilst looking for something else, I have a dynamic start page that works on the config file.

    In the config file, I add a setting like this:
    VB Code:
    1. <add key ="defaultpage" value ="allclients.aspx"/>

    In the global.asax I then add code to the session start to retrieve the value from the config file and store it in the session object.

    Finally in my default page which is always default.aspx, I have a single line of code to redirect to the page that I retrieved from the config file. Assuming that the value from the config file was stored in the session object the code in default.aspx would be something like this:

    VB Code:
    1. Private Sub Page_Load(sender as object, e as eventargs) Handles MyBase.Load
    2.     Response.Redirect(Session("defaultpage"))
    3. End Sub
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  4. #4
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Re: dynamicaly setting Startup page?

    Maybe you can put in some code in the session_onstart event in the Global.asax file and redirect the users to the required page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width