Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 34 of 34

Thread: Signin.aspx? redirect

  1. #1
    cheesenips is offline Junior Member
    Join Date
    Mar 2008
    Location
    Phoenix Arizona
    Posts
    8

    Question Signin.aspx? redirect

    Can anyone tell me what the info is that I need to add to a link so that it will redirect the person clicking on it to a certain page. I am trying to send out an email with links to products to a customer but the customer is set to a customer level pricing structure so for the client to see the the correct pricing they need to be logged in. So I am wanting for the link to take them to the login page and as soon at they are logged in to direct them to a desired page. I know this is possible I just can't remember what the information is that I need to place into it. I thought is was http://www.mydomain.com/signin.aspx?...siredpage.aspx but that doesn't work.

    Any help would be awesome thanks guys.

  2. #2
    FunkySky is offline Junior Member
    Join Date
    Feb 2008
    Posts
    6

    Smile

    If your page is already properly protected with server-side ASP.net authentication you just need to give them the link to the page. The server will redirect them to the login page

    FunkySky

  3. #3
    Arcane001100 is offline Junior Member
    Join Date
    Mar 2008
    Location
    A T L A N T A | U S A
    Posts
    22

    Default

    I think I am looking for the same thing right now...that is if I understand correctly.

    What is wanted is for a user (already mapped to Customer Level) to be redirected to a page that lists specific products and Customer Level appropriate pricing upon login.

    If it's not correct, this is what I am looking for and this is a similar thread. :-D

  4. #4
    cheesenips is offline Junior Member
    Join Date
    Mar 2008
    Location
    Phoenix Arizona
    Posts
    8

    Thumbs up Answer

    Ok I have figured it out.

    What you need to do is add the ?returnURL=(whatever your Desired direction page is .aspx)

    So The fill link would be http://www.yourdomain.com/signin.asp...siredpage.aspx

    This will direct the user to the login page then after they hit the login button it will direct them to the page that you filled into the URL

  5. #5
    Arcane001100 is offline Junior Member
    Join Date
    Mar 2008
    Location
    A T L A N T A | U S A
    Posts
    22

    Talking

    A grand public thank you is in order.

    Thank you.

  6. #6
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default Redirect

    Hi!

    Is there a way to redirect customers to a desired page after login? If so, how do I do that? I need to redirect them to one of the categories page instead of the default.aspx

    Thanks.

  7. #7
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    Pass a "ReturnURL" parameter in the URL:

    www.mysite.com/signin.aspx?ReturnURL=c-1-.aspx

    ... would jump to www.mysite.com/c-1-.aspx after successful signin.
    Jon Wolthuis

  8. #8
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default

    where should I pass the parameter? I don't see the URL at all! It's for the signin.aspx page.

  9. #9
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    To change the "default" redirect (used in cases like this, where you aren't generating a hyperlink), you can open \web\signin.aspx.cs (or .vb) in Windows Notepad. Find the three occurrences of "default.aspx" (it's in three places, because there are three situations that would return you there), and replace them with "c-1-.aspx". Save the file, and you should be all set.
    Jon Wolthuis

  10. #10
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default

    That's what I did but it still goes to default.aspx.

  11. #11
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    Ok, my bad. I sent you to the wrong file. Try opening signin.aspx using windows notepad, search for "default.aspx", and replace it with "c-1-.aspx".
    Jon Wolthuis

  12. #12
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default

    Sorry but still no! It keeps going to the default.aspx.

  13. #13
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    I apologize for the runaround. I thought it was a simple mod; apparently your mods are being overrulled by another methods' ReturnURL command. It's more complicated than I thought.
    Jon Wolthuis

  14. #14
    bajjame is offline Member
    Join Date
    Feb 2008
    Location
    Houston, TX
    Posts
    90

    Unhappy

    Could it be stored in a cookie? I am having a similar problem in that I am trying to redirect to a topic. I have based a second login page based upon signin.aspx and am unable to find any more references to default.aspx, yet that is where it goes no matter what I have tried.

    I have changed in signin2.aspx:
    Code:
    <%@ Page Language="c#" Inherits="AspDotNetStorefront.signin2" CodeFile="signin2.aspx.cs" %>
    and
    Code:
    <form runat="Server" method="POST" action="signin2.aspx" id="Signin2Form" name="Signin2Form">
    in signin2.aspx.cs:
    Code:
    public partial class signin2: SkinBase
    and in lines 52, 324, and 640:
    Code:
    ReturnURL.Text = "t-topic-title.aspx";
    and in line 316:
    Code:
    if (sReturnURL.Length == 0 || sReturnURL == "signin2.aspx")
    What does this line do?
    Code:
    string sReturnURL = FormsAuthentication.GetRedirectUrl(CustomerGUID, PersistLogin.Checked);
         FormsAuthentication.SetAuthCookie(CustomerGUID, PersistLogin.Checked);
    Does it affect anything here?

    Any help would be much appreciated.

  15. #15
    bajjame is offline Member
    Join Date
    Feb 2008
    Location
    Houston, TX
    Posts
    90

    Exclamation

    Hi again. This is something my boss wants in 3-4 days for one of our customers. Any ideas out there? This is really important. Thanks for your help.

  16. #16
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    Code:
    string sReturnURL = FormsAuthentication.GetRedirectUrl(CustomerGUID, PersistLogin.Checked); FormsAuthentication.SetAuthCookie(CustomerGUID, PersistLogin.Checked);
    Most certainly affects the entire operation. It's setting the redirectURL based on whatever is stored in the cookie. I'll have our Dev team look into this and see if they can't give you a definite answer.

  17. #17
    bajjame is offline Member
    Join Date
    Feb 2008
    Location
    Houston, TX
    Posts
    90

    Default

    Thank you very much.

  18. #18
    thehpguru is offline Junior Member
    Join Date
    Jul 2008
    Posts
    5

    Unhappy Signin.aspx? redirect

    Did anyone ever come up with a solution to this problem of redirecting to default.aspx? This is my particular situation: I am designing customized carts for different clients with different customer levels and extended pricing on ver.7.0.2.5ML. I'm currently creating these custom carts in the Sections/Departments menu. What I want to do is not publish those carts and provide a "quick order form" button that redirects the client to something like s-3-Nabisco-custom-cart.aspx. However, the only way I can get the link to work is by publishing the cart, which allows everyone to see it. Obviously, I only want to let that particular client see the customized cart. Further, I would also like the custom button to appear only when that client, or (group of emails) of that client to see the button after they log in. Currently, none of this is possible as I can't get past this issue. Any help would be appreciated.

  19. #19
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    While I cannot see where any of that is being "Stopped" by redirecting to default after a successful login, I can say that you can simply alter the signin.aspx codebehind:
    Code:
    If CommonLogic.QueryStringBool("checkout") Then
    ReturnURL.Text = "shoppingcart.aspx?checkout=true"
    Else
    ReturnURL.Text = "default.aspx"
    EndIf
    
    There's your redirection logic.

  20. #20
    thehpguru is offline Junior Member
    Join Date
    Jul 2008
    Posts
    5

    Default Automatic redirect to default.aspx

    Jesse,
    Thank you for the quick response. I apologize for my lack of explaining the actual problem(s) in detail. My project is currently on a dev server, not live. I'm building custom carts and putting them in section sub-cat (Path is departments /customized-shopping-carts/nabisco-custom-cart). If I create this path and Publish=No, then in the URL type: http://localhost:1366/Web/signin.asp...stom-cart.aspx, after I login succesfully, it automatically returns me to the default.aspx page. At this point, I try to go directly to the page by typing in ~/Web/s-3-nabisco-custom-cart.aspx, I still can't see the page, as it takes me right back to the default.aspx page. However, if I publish the page in admin/departments and reset cache, then go to the above path, login, and it works(takes me directly to the s-3-nabisco-custom-cart.aspx page. I can also view it directly at ~/Web/s-3-nabisco-custom-cart.aspx. The problem is, I do not want to publish it for everyone to see. I only want the Nabisco clients to be able to see that page. Same goes for the "Quick Order Form" button (It should only be visible to the Nabisco clients after they successfully login). Originally, that is why I posted in this thread, as the other clients here are having the same exact problem. What am I doing wrong?

  21. #21
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    You are not setting your page permissions in the web.config. If you did, you can set customer levels that are permitted to view the custom cart pages and not have to worry about publishing them. A good article on it can be found here.

  22. #22
    thehpguru is offline Junior Member
    Join Date
    Jul 2008
    Posts
    5

    Default

    I tried that using <location path="s-3-nabisco.aspx"> and <deny users="*"> and <allow users="thehpguru@nabisco.com">. I still can't view the page unless it is published(after login process). Did I set the location path incorrectly because it is a subcat of a cat of the entity departments? Should I make the path /sections/nabisco/s-3-nabisco.aspx instead? If I put this page under the root (Web) instead of in a section, it would probably work, but I'd like to keep the addtocart functionality along with the entity.tableexpanded2.xml.config display package. Also, instead of using emails separated by commas, should I be using the CustomerLevelID instead (nabisco)? I know it should be simple, but I'm really lost.

  23. #23
    thehpguru is offline Junior Member
    Join Date
    Jul 2008
    Posts
    5

    Default

    If I have an login email address of thehpguru@nabisco.com and a customer level named nabisco, is it the same as:
    <allow users="[thehpguru@nabisco.com]"
    allowRoles="[nabisco]"/> in the web.config file?

  24. #24
    thehpguru is offline Junior Member
    Join Date
    Jul 2008
    Posts
    5

    Default Upon further investigation...

    Web.config file has nothing to do with this problem! How can it. It has not been touched, which means it is wide open - allow users="*". If I publish the page, I can see it. If I don't publish the page, I can't, no matter how I try to view it, no matter what URL I type. After studying the XML v2.1 manual for the 10th time, the only logical explanation I can come up with is @publishedonly=1 for the entity.tableexpanded2.xml.config form that I am using to view the page. Even when I change that value to 0, I noticed that this value=1 is also being reinserted into the code under System Defined Dataset, and then again in the Runtime Dataset, which I can't see. Am I on the right track? If so, can you tell me how to change the value in system.web so that it also give a value=0?

  25. #25
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    However, the only way I can get the link to work is by publishing the cart, which allows everyone to see it. Obviously, I only want to let that particular client see the customized cart.
    If you have it working this way, let it work this way. And then explicitly define the cart as deny="*" in the web.config. Underneath the deny node, allow your user group that is permitted to see it.

  26. #26
    psharma is offline Junior Member
    Join Date
    Jun 2010
    Posts
    18

    Default Signin.aspx

    Was this issue ever resolved???? I do not see any reply from the dev team. I ahve versin 9. Trying to make changes in signin.ascx.cs. But nothing is happening.

  27. #27
    parameswaranit is offline Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Default

    I am also having the same problem of redirecting signin.aspx? to default page after login.

    What is the solution for this.

    Can you please let me know asap?

  28. #28
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    I have need to redirect to a page other than default.aspx also for v9 any solution?
    MSX

  29. #29
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Like was said in the earlier posts, just create a link to signing.aspx?ReturnURL=BlahBlah and when you click on it and login, you'll be taken to BlahBlah. I do this all the time and it requires absolutely no code modification.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  30. #30
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    I am aware of that method, I actually posted the same method on another post, however in V9 I cant see where I can add that.

    this is the code that generated the login link

    ID="ltrSignInOutText" runat="server" Text='<%$ Tokens:SignInOut_Text %>' /></a>
    MSX

  31. #31
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    What I did is create an entirely separate link:

    Code:
    <a href="signin.aspx?ReturnURL=BlahBlah">Sign In</a>
    However, if you wanted to modify the code that generates that link automatically look in Tokens.vb under the functions SignInOutLinkParser and SignInOutTextParser.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  32. #32
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    Here is what I did V9 with Source Code

    Create appconfig parameter
    name: welcome
    description: Directs user to specified page after log in
    value: t-welcome-page.aspx

    in token.cs changed
    HTML Code:
    return AppLogic.ResolveUrl(CommonLogic.IIF(!ThisCustomer.IsRegistered, "~/signin.aspx", "~/signout.aspx"));
    to
    HTML Code:
    return AppLogic.ResolveUrl(CommonLogic.IIF(!ThisCustomer.IsRegistered, "~/signin.aspx?ReturnURL=/" + AppLogic.AppConfig("Welcome"), "~/signout.aspx"));
    MSX

  33. #33
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default Login Redirect by Customer Level

    Hi,

    I am no programmer, but I found what seems to work. I used a separate .master page template for our homepage. By default when you login to the website it goes to the default.aspx page. So in the skin .master file I added the following code which simply redirects the user to whatever page based on whatever customer level you enter.

    HTML Code:
    <%
    if (ThisCustomer.CustomerLevelID == 3)
    Response.Redirect("/c-354-cristinas.aspx");%>

  34. #34
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Are you by chance using the VB.Net version and experiencing the ReturnURL problem?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM