Optionally provide private feedback to help us improve this article...

Thank you for your feedback!


Redirect To Your Login & Register Pages

For single sign on scenarios where you wish to handle user registration and login on your main web site it's often a good idea to point all requests for the InstantForum login or register pages to your main web sites login or register pages.

To achieve this you can add a snippet of code to the MasterPage.Master file provided with InstantForum. As this code is included within the MasterPage.Master file the code will execute for every front-end forum page.

1. Open your Skins/{SkinName}/MasterPage.Master file in NotePad or Visual Studio

2. Add the following script into the MasterPage.Master file. Depending on the version of InstantForum you are using you may already see a place holder Page_Load event you can use.

<script runat="server" language="c#">

public void Page_Load(Object sender, EventArgs e) {

if (Request.RawUrl.ToString().ToLower().IndexOf("logon.aspx") >= 0 ||
Request.RawUrl.ToString().ToLower().IndexOf("register.aspx") >= 0)
{
string returnURL = Request["ReturnURL"];
string url = "https://yourwebsite.com/Register.aspx";
if (!string.IsNullOrEmpty(returnURL))
{
url += "?ReturnURL=" + Server.UrlEncode(returnURL);
}
Response.Redirect(url);
}

base.Page_Load(sender,e);

}

</script>

This code will redirect all requests for the Logon.aspx or Register.aspx within InstantForum tohttps://yourwebsite.com/Register.aspx. You will obviously want to replace this with your real user.

You'll also notice we pass a return URL query string parameter to the redirect URL you specify allowing you to return the user tot he originally requested page within InstantForum after they complete the registration or login on your main web site.