Solved 3.5 login control error with url rewrite

Posted on 2011-10-15
Last Modified: 2012-05-12

I am using a rewrite rule for my 3.5 website hosted on iis7 and the main public pages are all based on one master page that contains a login control.  The url rewrite removes the "www.", ".aspx" and adds a trainling slash "/" to each page


the login control works on all pages that have the domain "",but the home page "" the login control does not work.  The login control is in the master page so the code does not change, but I cannot figure out why this will not work on the default page.

what makes this more difficult is that there is no error message and I have custom error handling, no error is being thrown, it does not log the user in, it just posts back to the main page with no change, no redirect to login destination page.

here is my login control:
<asp:Login ID="logRegent" runat="server" CssClass="LogControl" 
                                        PasswordRecoveryUrl="~/password.aspx" TitleText="E-REQUEST Login" 
                                        UserNameLabelText="User:" PasswordRecoveryText="Forgot Password" 
                                    MembershipProvider="RGT_MembershipProvider" >
                                    <CheckBoxStyle CssClass="LogRemember" />
                                    <TextBoxStyle Width="110px" />
                                    <InstructionTextStyle CssClass="LogLable" />
                                    <LabelStyle CssClass="LogLable" />
                                    <FailureTextStyle CssClass="LogError" />
                                    <TitleTextStyle CssClass="LogTitle" />
                                    <HyperLinkStyle CssClass="LogLink" />                            

Open in new window

any help would be appreciated.
Question by:jordanking
    LVL 1

    Author Comment

    i have found some references online that extensionless root urls break the form submit from the master page because the form gets its action attribute from the content page of the masterpage.

      So i am trying to set the action attribute of the containing form on the master page from the content page, but am having trouble.
    LVL 1

    Accepted Solution

    half a day later and i figured it out.  I was right bout the previous post, in so much as I had a feeling the form action was not being set properly due to the url rewrite removing the default.aspx.  I tried dozens of ways of setting the form action and differnt settings for the action attribute itself.  Here is what i finally came up with, and it works on all pages:

    i put this in the page load of the master page

    Dim Context As HttpContext
            Context = HttpContext.Current
            If Context.Request.RawUrl = "/default.aspx" Then
                frmRegent.Action = "/default/" ''in accordance with the rewrite rules i set up
            End If

    Open in new window


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now