Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
  #1 (permalink)  
Old July 11th, 2010, 06:51 AM
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending Mail from ContactForm

Hi!

This is related to Chapter 9, page 307 and onwards. I am trying to create a ContactForm so that an e-mail can be sent to the user with the information he/she has typed in.

The thing is, my TextBoxes are in FormViews, and my Code Behind says the TextBoxes are not declared, which they are (they all have ID's).

I have created a ContactForm.txt file in my App_Data folder, but I don't have a ContactForm.ascx file, is that really necessary? Can't I just include the ContactForm CodeBehind code in my aspx Code Behind file?

What do I need to do?

Help would be much appreciated!

Cheers
Peter
  #2 (permalink)  
Old July 12th, 2010, 03:04 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Peter,

Controls in a FormView are not available direcly to outside code. Instead, you need to use FindControl to find your text box controls in the FormView:

http://www.google.com/#hl=en&source=...132dca8f7438ee

Do you really need the FormView? It makes things morre difficult in this case.

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
Sending Mail from ContactForm User Control debscan ASP.NET 3.5 Basics 3 March 18th, 2010 01:35 AM
Sending mail from ContactForm: how to include a file? vilcene BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 September 23rd, 2009 12:18 PM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
Sending e-mail to different mail box! Calibus Classic ASP Databases 4 September 3rd, 2004 05:48 PM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





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