Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[5302] Url Rewriting with Regex for ASP.NET 2.0

Last post 05-02-2007 9:40 PM by idrivediesel2006. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [5302] Url Rewriting with Regex for ASP.NET 2.0

    This thread is for discussions of Url Rewriting with Regex for ASP.NET 2.0.

    • Post Points: 25
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 04-29-2006 9:35 PM In reply to

    Re: [5302] Url Rewriting with Regex for ASP.NET 2.0

    Hi..

    Thanks for the tutorial..

    But, when one of my controls makes an postback event, the url changes ex:

    from:
    http://localhost:1310/Modeltypes/Login.aspx
    to:
    http://localhost:1310/Modeltypes/Default.aspx?ModuleName=Login

    And then the rewrite method sends moduleName=Default back, and sends the user to another page, "default"..

    Am i doing something wrong?

    sorry my poor english :), thanks in advance

    Jacob Jensen




















    • Post Points: 5
  • 04-30-2006 1:09 PM In reply to

    Re: [5302] Url Rewriting with Regex for ASP.NET 2.0

    I figured out that removing the action attribute of the form fixed the problem:

    heres an example:
        public class Form : System.Web.UI.HtmlControls.HtmlForm
        {

            protected override void RenderAttributes(HtmlTextWriter writer)
            {

                writer.WriteAttribute(
                "name", this.Name);

                base.Attributes.Remove("name");

                writer.WriteAttribute(
                "method", this.Method);

                base.Attributes.Remove("method");

                this.Attributes.Render(writer);

                base.Attributes.Remove("action");

                if (base.ID != null)

                    writer.WriteAttribute(
                    "id", base.ClientID);

            }

        }

    But there is another bug, i cant seem to google out..

    My stylesheets and images isent shown, is there eny one who got the same problem? or is it something i am doing wrong ?



































    • Post Points: 5
  • 06-05-2006 3:40 PM In reply to

    • koFFiii
    • Not Ranked
    • Joined on 06-05-2006
    • Sweden
    • New Member
    • Points 5

    Re: [5302] Url Rewriting with Regex for ASP.NET 2.0

    Hello!

    I've tested the sample code but it doesn't work. When i run the code i get 404 - The resource cannot be found. Have I done anything wrong?



    • Post Points: 5
  • 01-08-2007 1:11 PM In reply to

    Re: [5302] Url Rewriting with Regex for ASP.NET 2.0

    I have the same problem it is not seeing mine js files and css files have anyone found the solution for this

    • Post Points: 10
  • 04-03-2007 7:41 AM In reply to

    • Maggi
    • Not Ranked
    • Joined on 04-03-2007
    • India
    • New Member
    • Points 30

    Help

    hi,
        I am using your example and am in a bit of a problem. the thing is I am getting redirected but if I am writing a url like so http://www.econn/page.aspx?id=10 & cat=20 how can i convert it to http://www.econn/page.aspx/id=10/cat=20 so that the parameters passed can be used on destination url

    Plz help me with this




    • Post Points: 5
  • 05-02-2007 9:40 PM In reply to

    Re: [5302] Url Rewriting with Regex for ASP.NET 2.0

    ernestomodena wrote:
    I have the same problem it is not seeing mine js files and css files have anyone found the solution for this

    I hunted for two days to get this resolved...  Here it is:

    app.context.rewritepath(destinationurl, false);

    the false tells the application not to reset the virtual path - otherwise the new url becomes the new virtual path which in turn give ~/default.aspx another meaning

    • Post Points: 5
Page 1 of 1 (7 items)