Change The Landing Page

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
5/15/2009 4:13:26 PM
Gravatar
Total Posts 16

Change The Landing Page

Is there any way to make the landing page different from the first link in the page menu? Say for instance I have a home link at the first position that actually points to a URL on another site, and I would like visitors to my portal to land on the About Us page which is lower on the list. Is this possible?

 

Thanks,

Nick

5/16/2009 4:22:47 AM
Gravatar
Total Posts 18439

Re: Change The Landing Page

Hi Nick,

The menu is just links so it won't do any automatic redirect.

I think the way I would do it is to create a page named index.aspx and make it redirect to whatever page you want and then add it as a default document in IIS putting it higher in the list than Default.aspx

Implementation of the index.aspx redirector page would be like this, create a text file and paste in the code below, then edit the url where it redirects  to what you want. Drop it in the root and configure it as a higher priority default document.

Hope it helps,

Joe

Code example:

<%@ Page Language="C#" ClassName="Index.aspx" Inherits="System.Web.UI.Page" %>

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
Response.Redirect("http://www.google.com"):

}

</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Index</title>
</head>
<body>
<form id="form1" runat="server">

</form>
</body>
</html> 

5/16/2009 8:49:29 AM
Gravatar
Total Posts 16

Re: Change The Landing Page

Thanks for the reply Joe.

 

I tried this but I'm getting redirected to an error page with the url "http://company.uspresswire.com/Error.htm?aspxerrorpath=/Index.aspx". It seems like the index.aspx file is not being found. I placed the index.aspx in the wwwroot. Any ideas?

 

Thanks,

Nick

5/16/2009 8:53:22 AM
Gravatar
Total Posts 16

Re: Change The Landing Page

I just tried browsing the index.aspx directly from the web server. There I recieve a compilation error

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1002: ; expected

Source Error:

 

Line 5: protected void Page_Load(object sender, EventArgs e)
Line 6: {
Line 7: Response.Redirect("http://company.uspresswire.com/about.aspx"):
Line 8:
Line 9: }

Source File: c:\inetpub\USPW-Company\Index.aspx Line: 7

What am I missing here?

 

Nick

5/16/2009 8:59:20 AM
Gravatar
Total Posts 18439

Re: Change The Landing Page

Oops, I didn't actually test the code. There is a typo, change the colon at the end of this line to a semi colon:

Response.Redirect("http://company.uspresswire.com/about.aspx");

5/17/2009 9:40:22 AM
Gravatar
Total Posts 16

Re: Change The Landing Page

Thanks, Joe. That fixed it.

You must sign in to post in the forums. This thread is closed to new posts.