Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ian Grainger 71 posts 135 karma points
    Mar 12, 2015 @ 12:28
    Ian Grainger
    0

    Upgrade 4.11.10 to Umbraco v6.2.5 - Unable to set correct <form action=""> for rewritten URL

    I have just performed an upgrade from 4 to 6 (still using WebForms) and got most things working again - but I'm unable to set the HTML form action correctly on a page with a usercontrol on a page which has a rewritten URL. The nice URL is like /developer-job-in-london-J12345 and the rewritten URL is /jobs/details.aspx?JobRef=J12345.

    On v4 I just set the Request.Page.Form.Action to the Page.Request.RawUrl in the UserControl code, but running the same code in v6 seems to work fine - but looking in the HTML output, it's still using the rewritten URL as the action (/jobs/details.aspx). Which means you're sent to a different URL on postback and a new entry is added in your history.

    I can check Page.Form.Action and it looks correct from the control Page_Load and the master pages (actually tried all the events I could think of), but as I say, the final HTML is always incorrect.

    Has something changed in v6 relating to this? Is there anything I can do to avoid having to fix this in JavaScript!? :(

    New assembly version is: 1.0.5529.18434 if that matters.

    Thanks!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 15, 2015 @ 10:03
    Jan Skovgaard
    0

    Hi Ian

    How did you handle the rewrite on v4? Sounds like you may have been using the /config/UrlRewriting.config file? If my assumption is correct have you then remembered to merge this file so the rule is intact? If I'm wrong...how did you then handle it before?

    /Jan

  • Ian Grainger 71 posts 135 karma points
    Mar 16, 2015 @ 10:12
    Ian Grainger
    0

    Hi Jan, thanks for the reply. I didn't merge the UrlRewriting file - I overwrote it. Has something changed in the way this works? If I hadn't carried across my change then it wouldn't have a page at all at the correct address - but as I say it all works fine except when I use the postback.

    In a strange twist it actually works on my CI server - just not on my dev machine. The CI server has IIS and uses a real domain - whereas locally I use IIS Express and a port on localhost - I wonder if it's a bug related to that?

    ---

    By the way I have another (pretty unrelated TBH) question about my upgrade - I used just the membership parts for a mobile version of the site - but I couldn't get this to work unless I installed the whole on UmbracoCms - I'd love to get it working with just UmbracoCms.Core - I don't suppose you happen to know anything about that? https://our.umbraco.org/forum/developers/api-questions/63161-Use-Umbraco-membership-(and-profile)-provider-in-non-Umbraco-ASPNET-web-forms-site

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 16, 2015 @ 18:54
    Jan Skovgaard
    0

    Hi Ian

    I don't think anything has changed in that config so overwriting it should work just fine.

    Perhaps there could be an issue using IIS express - Have you tried setting up a regular IIS site instead and see if that works?

    I'm not sure about the other issue unfortunately :)

    /Jan

  • Ian Grainger 71 posts 135 karma points
    Mar 17, 2015 @ 10:08
    Ian Grainger
    0

    Yes the CI server site is IIS - sorry I didn't mention that. So seems like it is an IIS Express issue, then? :(

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 17, 2015 @ 11:27
    Jan Skovgaard
    0

    Hi Ian

    Yeah could be - But is it a big deal for you to setup an IIS site locally instead? :)

    /Jan

  • Ian Grainger 71 posts 135 karma points
    Mar 17, 2015 @ 11:55
    Ian Grainger
    0

    Yes - then any developer would need to install IIS on their machine. If there's something you could suggest trying on the IIS machine to work out what it might be I can do that?

    Shall I try moving to ASP.NET rewriting instead of the UrlRewriting module?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 17, 2015 @ 17:01
    Jan Skovgaard
    0

    Hi Ian

    I'm not sure what to try out to be honest - But you can try doing that and see if it makes any difference.

    But if they're doing web development I can't see why installing IIS would be a major problem? To me that's just a given thing :)

    /Jan

  • Ian Grainger 71 posts 135 karma points
    Mar 17, 2015 @ 17:08
    Ian Grainger
    0

    Heh - I've loved not having to install IIS ever since IIS Express came along! It's SO much easier to just have it run the server as and when it's needed.

    I suppose I'll try stopping using the UrlRewriter then and see if that makes a difference. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft