Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Total Beginner Question.

Reply
Thread Tools

Total Beginner Question.

 
 
INTP56
Guest
Posts: n/a
 
      02-03-2009
I have a need to get the current logged on user and pass that value on to a
database. WHile ASP:LoginName displays the right value, I can't seem to
figure out how to use that value anywhere else. I've included some very basic
code, and I'm wondering if someone can show me how to get the login name into
a text box. I have figured out how to use a value in a textbox as a parameter
(If I just set it to a valid value).

TIA, Bob

Here is some code I've tried.

<%@ Page Language="C#" %>
<html dir="ltr">

<head runat="server">
<META name="WebPartPageExpansion" content="full">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled 1</title>
</head>

<body>

<form id="form1" runat="server">
LoginControl:
<asp:LoginName
runat="server"
id="LoginName1"/>
<br>
<br>
TextBox:
<asp:TextBox
runat="server"
id="TextBox1"
text="What do I put here to get the value of LoginName1?"
Width="378px">
</asp:TextBox>
<br>
TestBox1:
<asp:TextBox
runat="server"
id="TestBox1"
text=Request.ServerVariables("LOGON_USER")
Width="378px">
</asp:TextBox>
<br>
TestBox2:
<asp:TextBox
runat="server"
id="TestBox2"
text=User.Identity.Name
Width="378px">
</asp:TextBox>
<br>
TestBox3:
<asp:TextBox
runat="server"
id="TestBox3"
text=HttpContext.Current.User.Identity.Name
Width="378px">
</asp:TextBox>
<br>
TestBox4:
<asp:TextBox
runat="server"
id="TestBox4"
text='<%Session("Username")%>'
Width="378px">
</asp:TextBox>
<br>
</form>

</body>

</html>



 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-03-2009
=?Utf-8?B?SU5UUDU2?= wrote on 03 feb 2009 in
microsoft.public.inetserver.asp.general:

> I have a need to get the current logged on user and pass that value on
> to a database. WHile ASP:LoginName displays the right va


This is a classic asp group.

Dotnet questions should be asked in
<microsoft.public.dotnet.framework.aspnet>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Total Beginner Question INTP56 ASP .Net 7 02-05-2009 11:44 AM
Total beginner drops knitting and tries networking Suzy Wireless Networking 2 12-20-2007 12:49 AM
BT Total Broadband vs BT Business Total John Y UK VOIP 2 02-02-2007 09:27 AM
HELP!!! I am a TOTAL BEGINNER! =?Utf-8?B?Sm9obiBIYXllcw==?= MCSD 11 01-22-2004 10:44 PM
py2exe question from a total beginner sarmin Python 1 12-04-2003 01:43 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57