Copied to clipboard

Flag this post as spam?

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


  • Elad Lachmi 112 posts 144 karma points
    Apr 05, 2011 @ 19:35
    Elad Lachmi
    0

    query string access

    Hi,

    I'm using a query string when redirecting a user to the login page so I can let them know why they were redirected there.

    For example: if they get the password wrong I will add /login?msg=wrong and set a label to "Wrong username and/or password. Please try again"

    if he tries to access a restricted page, I redirect with /login?msg=nouser, etc.

    Now I'm guessing this is caused by the extensionless urls, but have no idea what to do about it.

    Help me :)

    Thank you!

    -Elad

  • Pasang Tamang 258 posts 458 karma points
    Apr 05, 2011 @ 20:43
    Pasang Tamang
    0

    Hi

    Are you talking about removing extension from url, like login.aspx to login only? If so you can change it by setting umbracoUseDirectoryUrls value true in web.config file.

    Thanks

    Pnima

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 05, 2011 @ 21:53
    Jan Skovgaard
    0

    Hi Elad

    If you want to go extensionless then what Pnima writes above should solve your issue.

    But I'm a bit curious about why you're checking it this way? Why don't you take advantage of Umbraco being based on the standard ASP.NET mebership provider? When you create a membertype and assign it to a membergroup you can then set access restrictions on the nodes in Umbraco by using "public access". Then you can select that it should be based on groups and then select your login page and your error page.

    /Jan

  • Elad Lachmi 112 posts 144 karma points
    Apr 06, 2011 @ 06:55
    Elad Lachmi
    0

    @Jan - You are right. My issue is not with going extensionless, I'm already using that.

    My issue is with extensionless and query strings, but I also resolved that on my own.

    On the other hand, I was thinking about your other comment and implemented the same behavior with the "public access" options.

    My issue is that the login page does not display a message like "You need to log in to access the requested page"

    or something like that. Is there any way to display a proper error message in the login control?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 06, 2011 @ 07:33
    Jan Skovgaard
    0

    Hi Elad

    How have you made your login setup? Normally it should be possible to enter that message in a rich text editor on the login page for instance and then place the login box in the rte by inserting a macro for instance.

    Does it make sense?

    /Jan

  • Elad Lachmi 112 posts 144 karma points
    Apr 06, 2011 @ 07:49
    Elad Lachmi
    1

    I found the solution.

    I added the login control in the template (master page) for the login page already. I found that you can handle the onloginerror event

    and display whatever error you want. This is exactly what I was looking to do.

    http://www.aspnettutorials.com/tutorials/controls/howto-errors-login-asp4-csharp.aspx

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 06, 2011 @ 08:56
    Jan Skovgaard
    0

    Hi Elad

    Ah, obviously I misunderstood what you were saying. Did not get that you needed to display a custom error message. Good to see you figured it out.

    /Jan

  • Lajja 4 posts 24 karma points
    Feb 02, 2012 @ 14:00
    Lajja
    0

    Please give me suggestion that how can I achive extentionless with querystring url.

    e.g : http://localhost/default.aspx?p=1.1

    I want to display this url as http://localhost/default/p/1.1

     

    Thanks in advance.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 02, 2012 @ 19:20
    Jan Skovgaard
    0

    Hi Laijla

    You should be able to do some url rewriting to achieve the above.

    Try going to the config folder and open the urlrewriting.config file - it contains an example on how to do the above. Must admit that I'm not a wizard in url rewriting myself though - but try having a look at it and see if it makes sense :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft