Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
How to get the email address for the current logged in user
Old 03-07-2010, 06:09 AM How to get the email address for the current logged in user
Skilled Talker

Posts: 51
Name: N
Trades: 0
Hi,

I have a members contact support page so that when the page loads it loads the current user name into a label control.

Now I would like another label control which gets the email address of the current logged in user and displays it as a label.

Here is my entire contact page and VB code behind:

Contact page:

Code:
<%@PageTitle=""Language="VB"MasterPageFile="~/Members/MasterMembers.master"AutoEventWireup="false"CodeFile="MembersCustomerSupport.aspx.vb"Inherits="Contact_Us_MembersCustomerSupport"%>
<%@Registerassembly="AjaxControlToolkit"namespace="AjaxControlToolkit"tagprefix="cc1" %>
<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">
<divclass="alldivs">
<cc1:ToolkitScriptManagerID="ToolkitScriptManager1"runat="server">
</cc1:ToolkitScriptManager>
<h1>Members Customer Support</h1>
<asp:LoginViewID="LoginView1"runat="server">
<AnonymousTemplate>
<p>You must be logged in to view this page. Please login and return back to this 
page.</p>
</AnonymousTemplate>
<LoggedInTemplate>

<asp:PanelID="Panel1"runat="server">
<asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>
<tablestyle="width: 100%">
<tr>
<tdstyle="width: 128px">
<p>
Username</p>
</td>
<td>
&nbsp;<asp:LabelID="username"runat="server"onload="username_text"></asp:Label>
</td>
</tr>
<tr>
<tdstyle="width: 128px">
<p>
Email address</p>
</td>
<td>
<asp:LabelID="email"runat="server"></asp:Label>
</td>
</tr>
<tr>
<tdstyle="width: 128px; height: 26px">
<p>
Message</p>
</td>
<tdstyle="height: 26px">
<asp:TextBoxID="message"runat="server"Height="110px"TextMode="MultiLine"
Width="223px"></asp:TextBox>
<asp:RequiredFieldValidatorID="messageValidator"runat="server"
ControlToValidate="message"Display="Dynamic"
ErrorMessage="A message is required">*</asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtenderID="messageValidator_ValidatorCalloutExtender"
runat="server"Enabled="True"TargetControlID="messageValidator">
</cc1:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<tdcolspan="2">
<inputID="submit"causesvalidation="true"type="submit"value="Submit"/>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel></form>
</LoggedInTemplate>
</asp:LoginView>

 
 
 
</div>
</asp:Content>
Here is my VB code behind script:

Code:

PartialClass Contact_Us_MembersCustomerSupport
Inherits System.Web.UI.Page
ProtectedSub username_Text()
Dim getname AsString = Page.User.Identity.Name
username.Text = getname
EndSub
EndClass
I know there is a simple solution please could somebody help me solve it.

Thanks
njccbeach9 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-07-2010, 05:06 PM Re: How to get the email address for the current logged in user
Defies a Status

Posts: 1,606
Trades: 0
This is just my opinion.

I would not share it with you even if I knew the answer.

It is sites like you want to make that cause me to block all scripts on a page.

Invading your user's privacy is a short term term thing.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 03-08-2010, 02:53 PM Re: How to get the email address for the current logged in user
Skilled Talker

Posts: 51
Name: N
Trades: 0
I don't plan to invade anybody's privacy. The reason I want to be able to retrieve the email address associated with the current logged on user is because they obviously have a problem and have filled out the required fields on the page stating their issue. If you deliberately contacted a company about an issue you don't think twice about giving them your contacting details because you want a response and preferably a solution.

I need their address in order for me to get back to them about the problem.
njccbeach9 is offline
Reply With Quote
View Public Profile
 
Old 03-13-2010, 06:51 AM Re: How to get the email address for the current logged in user
Skilled Talker

Posts: 51
Name: N
Trades: 0
Hi,

Does anybody have any more suggestions?

Thanks
njccbeach9 is offline
Reply With Quote
View Public Profile
 
Old 03-15-2010, 12:56 PM Re: How to get the email address for the current logged in user
Extreme Talker

Posts: 246
Trades: 0
From what I can tell you should really learn .Net rather than trying to hack together this thing. Goto 4guysfromrolla.com and learn at the very least how to store and retrieve information from a database. Please, please, please try to learn before asking for us to build the entire thing for you piece by piece.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Old 03-15-2010, 03:32 PM Re: How to get the email address for the current logged in user
Skilled Talker

Posts: 51
Name: N
Trades: 0
Ok thanks for the links.
I am learning, but some of the tutorials teach you how to do impratical functions like looping numbers which has nothing to do with retrieving data from a database.

Anyway, I'll continue to learn but any more suggestions or pointers which can narrow down my search into resolving this answer would be most appreciated.

Thanks
njccbeach9 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to get the email address for the current logged in user
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31831 seconds with 12 queries