Inhalte aufrufen

Profilbild

Linking user name


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
8 Antworten zu diesem Thema

#1 acousticelectric

acousticelectric

    Benutzer

  • Members
  • 25 Beiträge

Geschrieben: 28 January 2015 - 09:19

I have a subdomain and im trying to pass the current logged in user name to the page, the subdomain has aspx pages in it, I can request querystring when it gets to the subdomain. In the accountdopdown.cshtml I am adding a option, and would like to if possible do something like <a href"www.somepage.aspx"+User.identity.name> Is this possible, how would I attatch a username to the end of a url I want to navigate to?



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 28 January 2015 - 14:30

<a href="www.somepage.aspx?userName=@(HttpUtility.UrlEncode(User.Identity.Name))">my hyperlink</a>

Marcus Gesing

Smartstore AG


#3 acousticelectric

acousticelectric

    Benutzer

  • Members
  • 25 Beiträge

Geschrieben: 28 January 2015 - 17:32

Perfect, Thank you!!!



#4 acousticelectric

acousticelectric

    Benutzer

  • Members
  • 25 Beiträge

Geschrieben: 28 January 2015 - 20:11

it rks perfect, but just out of curiosity, would you know how to carry authentication(login) information over to a subdomain? It would be easier to do then use the username such as I am



#5 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 28 January 2015 - 22:09

HTTP cookie.


Marcus Gesing

Smartstore AG


#6 acousticelectric

acousticelectric

    Benutzer

  • Members
  • 25 Beiträge

Geschrieben: 28 January 2015 - 23:20

an example perhaps? I don't really know anything about MVC, im n aspx guy :) lol



#7 acousticelectric

acousticelectric

    Benutzer

  • Members
  • 25 Beiträge

Geschrieben: 29 January 2015 - 05:58

I am using the username passed in a query string to the aspx site, then storing that user name in a session variable, not very effective though, would be better if I could use the original information



#8 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 29 January 2015 - 13:16

See Services.Authentication.FormsAuthenticationService::SignIn


Marcus Gesing

Smartstore AG


#9 acousticelectric

acousticelectric

    Benutzer

  • Members
  • 25 Beiträge

Geschrieben: 29 January 2015 - 23:30

ok perfect, thank you