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 September 22nd, 2009, 04:27 AM
Registered User
 
Join Date: Aug 2009
Location: Netherlands
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending mail from ContactForm: how to include a file?

Hi Imar,

Thanks for the great book! Since I am an absolute beginner, your book has helped me a lot!
Now I do have a question, I haven't been able to figure out on my own...
I am working on a website which includes a contact form with the option to include files (like CV, Application Letter, etc) to be sent via email.
I have been able to program all the text boxes and drop down list options, but I am totally lost as to how I can include the reference from FileUpload field that there is a file to be included as well...
Any help would be very welcome!

Thanks!
  #2 (permalink)  
Old September 22nd, 2009, 03:29 PM
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 vilcene,

You may want to take a look here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=412 This article shows you how to attach uploaded files directly to an e-mail.

In addition, check out Chapter 13, page 461 to learn more about using the FileUpload control.

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!
  #3 (permalink)  
Old September 23rd, 2009, 02:39 AM
Registered User
 
Join Date: Aug 2009
Location: Netherlands
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thank you very much for your reply!
Have a nice day!
  #4 (permalink)  
Old September 23rd, 2009, 12:07 PM
Friend of Wrox
Points: 752, Level: 10
Points: 752, Level: 10 Points: 752, Level: 10 Points: 752, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Default cursor persistent

hello Imar Sir,

U have posted a reply regarding my question about cursor persistent that leads me to a diff. page. There was the following statement and code

Quote:
When using ASP.Net AJAX to perform a postback from within a textbox input control, I found that the textbox loses focus after the postback. To overcome this, I added the following code:
Code:
ScriptManager.GetCurrent(Me.Page).SetFocus(MyTextBox)
Quote:
However, upon setting focus back to the textbox, the cursor lands at the beginning of the text in the control. To solve this, just add the following JavaScript on the page or within window.setTimeout:
Code:
var textInput = $get('MyTextBox');
if (textInput.createTextRange)
{
    var range = textInput.createTextRange();
        range.moveStart('character', (textInput.value.length));
        range.collapse();
        range.select();
    }
Now it was regarding about one simple text box but I tried it in my senariou that is actually suggested by you in your book, that recommends about user control. There is one page ContactForm.aspx and also the user control.
Now please tell me how I change the code accordingly and where that code goes?
  #5 (permalink)  
Old September 23rd, 2009, 12:18 PM
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 there,

Please post replies in your own threads. This thread has nothing to do with your replies / issues. It clutters up the thread and makes it difficult to follow for others.

That said, I don't know as a) I haven't tried it out and b) I don't know the exact structure of your site. It appears to me that you need to replace MyTextBox with the client ID of your text control....

This will be a tricky problem anyway. Your best bet is probably to disable the timer in these edit pages.

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
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM
sending mail Sona1883 Classic ASP Components 1 January 3rd, 2005 07:25 AM
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.