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?
Printable View
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?
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.
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:
<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:
Private Sub Page_Load(sender as object, e as eventargs) Handles MyBase.Load Response.Redirect(Session("defaultpage")) End Sub
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.