Click here to Skip to main content
15,914,500 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Serializing as Key Value pairs Pin
Matt U.8-Jul-11 11:51
Matt U.8-Jul-11 11:51 
QuestionProblem wirh Response.End() while exporting Datatable results to Excel file. Pin
madhubabu7-Jul-11 7:52
madhubabu7-Jul-11 7:52 
AnswerRe: Problem wirh Response.End() while exporting Datatable results to Excel file. Pin
Not Active7-Jul-11 8:52
mentorNot Active7-Jul-11 8:52 
QuestionTime Out. Pin
berba7-Jul-11 2:51
berba7-Jul-11 2:51 
AnswerRe: Time Out. Pin
#realJSOP7-Jul-11 7:45
professional#realJSOP7-Jul-11 7:45 
QuestionChange Precedence of Click and OnClientClick for <asp:Button.. Pin
Ravi Sant7-Jul-11 1:44
Ravi Sant7-Jul-11 1:44 
AnswerRe: Change Precedence of Click and OnClientClick for <asp:Button.. Pin
berba7-Jul-11 2:57
berba7-Jul-11 2:57 
Questionnull string returned for domain and username (Windows auth) Pin
anarayan7-Jul-11 0:43
anarayan7-Jul-11 0:43 
I'm trying to capture the username (and domain) of the user accessing the web application (web server on the same domain for starters). I have modifed the IIS settings to use Windows authentication and added stuff to web.config and use the following code below to capture this information - and it works as long as the web server is the localhost i.e it works only if the web app is accessed via a browser on the web server. Otherwise it returns a null string, what do I need to do? (currently buidling on .NET 2.0)

Snippet of code in VB.NET (objGenericIdentity.Name contains null string when web app is accessed outside of web server):

Dim formsAuthTicket As FormsAuthenticationTicket
Dim httpCook As HttpCookie
Dim objGenericIdentity As GenericIdentity
Dim objMyAppPrincipal As securityPrincipal
Dim strRoles As String()
httpCook = Context.Request.Cookies.Get("authCookie")
formsAuthTicket = FormsAuthentication.Decrypt(httpCook.Value)
objGenericIdentity = New GenericIdentity(formsAuthTicket.Name)
strRoles = formsAuthTicket.UserData.Split("|")
objMyAppPrincipal = New securityPrincipal(objGenericIdentity, strRoles)
HttpContext.Current.User = objMyAppPrincipal

web.config contains this:
authentication mode="Windows"
identity impersonate="true"

(I'm not using anything related to formsauthentication in the web.config file, do I need to?).

And finally, what would I need to do to get this info when web app is accessed from a different domain?

arvind
AnswerRe: null string returned for domain and username (Windows auth) Pin
Parwej Ahamad7-Jul-11 7:08
professionalParwej Ahamad7-Jul-11 7:08 
Questionurl rewrite Pin
Sneha Bisht6-Jul-11 23:54
Sneha Bisht6-Jul-11 23:54 
AnswerRe: url rewrite Pin
Dalek Dave7-Jul-11 3:04
professionalDalek Dave7-Jul-11 3:04 
AnswerRe: url rewrite Pin
Parwej Ahamad7-Jul-11 7:04
professionalParwej Ahamad7-Jul-11 7:04 
QuestionASP.NET Auto-logout Pin
Aaron Hartley6-Jul-11 11:26
Aaron Hartley6-Jul-11 11:26 
AnswerRe: ASP.NET Auto-logout Pin
Not Active6-Jul-11 12:12
mentorNot Active6-Jul-11 12:12 
JokeRe: ASP.NET Auto-logout Pin
AspDotNetDev6-Jul-11 12:25
protectorAspDotNetDev6-Jul-11 12:25 
GeneralRe: ASP.NET Auto-logout Pin
Not Active6-Jul-11 12:58
mentorNot Active6-Jul-11 12:58 
QuestionSave webpage content in a PDF Pin
berba6-Jul-11 3:20
berba6-Jul-11 3:20 
AnswerRe: Save webpage content in a PDF Pin
#realJSOP6-Jul-11 8:39
professional#realJSOP6-Jul-11 8:39 
AnswerRe: Save webpage content in a PDF Pin
AspDotNetDev6-Jul-11 13:13
protectorAspDotNetDev6-Jul-11 13:13 
AnswerRe: Save webpage content in a PDF Pin
Member 80703982-Sep-11 21:00
Member 80703982-Sep-11 21:00 
GeneralRe: Save webpage content in a PDF Pin
berba3-Sep-11 3:43
berba3-Sep-11 3:43 
QuestionGridView Column Width resizing with Mouse Darging Pin
vishnukamath5-Jul-11 23:02
vishnukamath5-Jul-11 23:02 
AnswerRe: GridView Column Width resizing with Mouse Darging Pin
Shahriar Iqbal Chowdhury/Galib6-Jul-11 1:06
professionalShahriar Iqbal Chowdhury/Galib6-Jul-11 1:06 
AnswerRe: GridView Column Width resizing with Mouse Darging Pin
Marikani P7-Jul-11 4:16
Marikani P7-Jul-11 4:16 
QuestionRegular Expression Pin
jashimu5-Jul-11 10:12
jashimu5-Jul-11 10:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.