Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 January 19th, 2013, 07:00 PM
Authorized User
 
Join Date: Oct 2012
Posts: 27
Thanks: 4
Thanked 2 Times in 2 Posts
Default Adding data into SignUpConfirmation.txt - ch.16, page 593

I created a new textbox, (ID)=Points, on the SignUp page, and I'd like to put its content, ex "123", in the SignUpConfirmation.txt, for the user to get it along with its user name and password.
I tried this:
--------------------------------------------------
User name: <% UserName %>
Your password: <% Password %>
Points: <%# Points.text %>
--------------------------------------------------

The Points expression does not work: it appears as is this in the email.

Could someone help me with that?
 
Old January 19th, 2013, 07:20 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Only UserName and Password are available on these templates. For other fields you need to replace your own values as is done with the ContactForm. You can use the MailSending event to access the MailMessage and then modify the body text.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 20th, 2013, 12:11 PM
Authorized User
 
Join Date: Oct 2012
Posts: 27
Thanks: 4
Thanked 2 Times in 2 Posts
Default Success

Thank you Imar,
Your suggestion was of great help.
By the way, the Thanks button was not available on the reply to use it.

In fact, I used SendingMail event, entering the following code:
Code:
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e)
    {
      e.Message.IsBodyHtml = false;
      e.Message.Body = e.Message.Body.Replace("<% Points %>", Points.Text);
     }
I the SignUpConfirmation.txt, the text to replace is entered as: <% Points %>.
It worked OK.
I found that method be clicking F1 , then doing a search on "sendingmail event", then selecting from results: "CreateUserWizard.SendingMail". The topic contained a ready-to-use example.
 
Old January 25th, 2013, 04:03 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Thanks for posting the update. Much appreciated....

>> By the way, the Thanks button was not available on the reply to use it.

You may have clicked the image in my signature, which is just an image. There's also a Thanks button below the actual post.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 26th, 2013, 01:18 AM
Authorized User
 
Join Date: Oct 2012
Posts: 27
Thanks: 4
Thanked 2 Times in 2 Posts
Default Thanks button not available

I still cannot find the Thanks button.
I definitely didn't click on the image in our signature, but looked for the <Thanks icon> similar to the one inserted in the text:

"Did this post help you? Click the <Thanks icon> button below this post to show your appreciation!"

What I understood from this indication is that if I want to thank you without even replying, because , for instance, I'm very pleased with your answer , but I have no more follow-up to post, it's enough to click the <Thanks icon>. However, there's no clickable<Thanks icon> in your reply.

The above is just an explanation and I really don't insist on this issue. I can thank you directly in my post, which I do most sincerely.
 
Old January 26th, 2013, 09:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
What I understood from this indication is that if I want to thank you without even replying, because , for instance, I'm very pleased with your answer , but I have no more follow-up to post, it's enough to click the <Thanks icon>.
Indeed.
Quote:
However, there's no clickable<Thanks icon> in your reply.
That's odd. Oh well, not that important.....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Try it out p.593 nge277 BOOK: Beginning ASP.NET 4 : in C# and VB 1 June 5th, 2012 06:05 AM
Ch 23 Page 488 Data Context in Global.asax? ken evans BOOK: Professional Visual Studio 2010 5 December 7th, 2010 01:50 PM
Search ch 13, ch 16 sporik BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 October 27th, 2009 04:44 PM
Adding Categories to Message board in Ch.16 PlaGuE BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 November 19th, 2005 08:24 PM





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