Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2009, 12:18 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default Articles comments show email account

I wanted to change something:

When a user comments on one of the articles, the project allows his email address to be accessed by clicking on the member's name which is allowed to link to outlook mail. I want to disable that or at least add an option in their profile, for the user to check to allow or disallow his email to be visible.

I was looking in the BLL , comment.cs file but I'm not sure which line to look at or how to modify it.

Has anyone else changed this or can anyone tell me how to do this?

Rachel
 
Old February 23rd, 2009, 05:01 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Rachel,

The most straightfwd place to make the change to not show thew email address would be in the ShowArticle.aspx page. The section below shows the hyperlink section (lnkAddedBy) that exposes the email link. Just make that into a literal representing the username and you're done. Here's the actual section as is:

<b>Comment posted by
<asp:HyperLink ID="lnkAddedBy" runat="server" Text='<%# Eval("AddedBy") %>' NavigateUrl='<%# "mailto:" + Eval("AddedByEmail") %>' />
on
<asp:Literal ID="lblAddedDate" runat="server" Text='<%# Eval("AddedDate", "{0:f}") %>' />
</b>

Good luck...
__________________
jimi

http://www.originaltalent.com
The Following User Says Thank You to jimibt For This Useful Post:
Rachel (February 23rd, 2009)
 
Old February 23rd, 2009, 10:41 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Thanks again for your help Jimi. After I posted that, I saw that the ShowArticle.aspx page was probably where the change should be done but was still unsure how to proceed.

I will try this. There are two spots where it refers to "mailto"

Thank you,
Rachel
 
Old February 23rd, 2009, 05:45 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

R - i think you'll manage it just fine.

good luck on the final stages of your implementation, this can be the most difficult stage (the 80/20 rule - i.e. 80 of your effort is concentrated in the last 20% of the project - yikes!!)

cheers for now...
__________________
jimi

http://www.originaltalent.com
 
Old February 23rd, 2009, 10:37 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jimibt View Post
R - i think you'll manage it just fine.

good luck on the final stages of your implementation, this can be the most difficult stage (the 80/20 rule - i.e. 80 of your effort is concentrated in the last 20% of the project - yikes!!)

cheers for now...
Oh no! ..
Yes, I'm finding the last chapter on deploying the project a little confusing but I'll get there.

I'm back tracking with this other issue right now so put that on hold a bit longer.

I found that if I do this:

<asp:HyperLink ID="lnkAddedBy" runat="server" Text='<%# Eval("AddedBy") %>'
NavigateUrl='<%# "mailto:" + Eval("AddedBy") %>' />
on <asp:Literal ID="lblAddedDate" runat="server" Text='<%# Eval("AddedDate", "{0:f}") %>' />

(instead of "AddedByEmail" ) then if you click on the user's name which is a hyperlink, it still opens up the outlook e-mail but shows no email address. So that's cool.

But I'd like to allow people to choose whether to allow their email addresses to be accessed if they don't mind. So this is what I'm trying to figure how to do but so far haven't figured it out. This is left over from the little bit of visual basic I learned some years ago which does me no good these days
:

protected void ckEmailOk_CheckedChanged(object sender, EventArgs e)
{
if (ckEmailOk.Checked == true)
{

<asp:HyperLink ID="lnkAddedBy" runat="server" Text='<%# Eval("AddedBy") %>'
NavigateUrl='<%# "mailto:" + Eval("AddedByEmail") %>' />
on <asp:Literal ID="lblAddedDate" runat="server" Text='<%# Eval("AddedDate", "{0:f}") %>' />
}
else

{

<asp:HyperLink ID="lnkAddedBy" runat="server" Text='<%# Eval("AddedBy") %>'
NavigateUrl='<%# "mailto:" + Eval("AddedBy") %>' />
on <asp:Literal ID="lblAddedDate" runat="server" Text='<%# Eval("AddedDate", "{0:f}") %>' />
}
}

Any suggestions would be appreciated! (I still have a hard time figuring how to work the code behind with the aspx page)
Rachel
 
Old February 24th, 2009, 11:14 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 119
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Someone suggested I write it this way in the aspx page:

NavigateUrl='<%# ckEmailOk.Checked?"mailto:" + Eval("AddedByEmail"):"mailto:" + Eval("AddedBy") %>'

But that puts the url in the form instead of the name w/link. Is there a way to modify this to do it?

Rachel





Similar Threads
Thread Thread Starter Forum Replies Last Post
check if email account exists collie ASP.NET 2.0 Basics 2 September 13th, 2007 07:02 PM
Show articles in report that are not in form Odeh Naber Access 1 August 6th, 2007 11:21 AM
Regarding email to yahoo account harshaghanta ASP.NET 2.0 Professional 0 June 1st, 2006 12:15 AM
Creating account using email-activation BaNSHee Classic ASP Basics 1 December 17th, 2004 01:17 PM
Email subscription and Overall Comments apd8x Forum and Wrox.com Feedback 4 June 13th, 2003 06:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.