 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
 | This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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
|
|
|
|
|

November 9th, 2007, 05:16 AM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the whole mail works creat i can bcc it and all.
but in Outlook Express the table is formatted nice.
Only the body has the standard font of the mailprogram.
How can i set this to always be 1 font?
isnt; that in the statistext file:
Body style"font=Tahoma" or something like that?
|
|

November 10th, 2007, 06:31 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
HTML mail is always a little tricky to format, as you can't really use external style sheets as you would with ASPX pages.
However, in-line styles would work fine:
<table>
<tr>
<td style="font-family: Arial">Some Text</td>
</tr>
</table>
In this example, the style is applied to a td, but you can of course also apply it to other elements like the <table>
For the benefit of the archive of this forum, would you mind posting your final code?
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
|
|

November 13th, 2007, 03:53 AM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey imar offcourse i will post my codes wich ones do you want here?
Everything now works the only thing is when i publish it through visual studio i get these errors :S (really weard becouse it works in local mode)
Error 1 C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\Betaal.aspx(57): error BC30554: 'ShoppingCartView' is ambiguous. C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\Shop\Default.aspx 1
Error 2 'ShoppingCartView' is ambiguous. C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\Betaal.aspx 57
Error 3 'ShoppingCartView' is ambiguous. C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\shopc.aspx 10
And when i give them all diffrent names he still sas that from other pages really weard :S
|
|

November 13th, 2007, 04:23 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Take a look in the code behind. You should see something like _Default Inherits System.Web.UI.Page
Maybe you have multiple _Default classes? If you change that, make sure you also change the ASPX file which contains a reference the same class.
Re code: whatever you ended up with to send mail, so future visitors to this forum know how you fixed it.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

November 13th, 2007, 04:47 AM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No i don;t have multiple Default classes or other classes
But when i change for example Wrox:ShoppingCartView to My:ShopView It works doesn;t give an error on that page but on the page wich links from it does give an error :S
But aint it strange that it works on local and not on a publisher
|
|

November 13th, 2007, 04:59 AM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oke i just uploaded it using filezilla that atleast justs uploads it.
But i get a Configuration Error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 20: </connectionStrings>
Line 21: <system.web>
Line 22: <authentication mode="Forms">
Line 23: <forms loginUrl="~/Registreer.aspx"/>
Line 24: </authentication>
Source File: \webshop\web.config Line: 22
|
|

November 13th, 2007, 05:04 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yeah, very strange indeed. Sounds like a configuration problem, or maybe there are files missing, or extra files with a different name? Try clearing the remote folder first and then do a clean upload.
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

November 13th, 2007, 07:45 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
A quick Google search should give you plenty of results on this error. Basically, the folder this application resides in must be marked as a virtual directory (under IIS) or you should move it to the root of the site.
Can you please start new threads for new topics? This is in no way related to "Mail function" anymore, making things a bit more difficult and confusing.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

November 14th, 2007, 05:54 AM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oh jeah sorry i forgot
But here is the code for the mail function:
The statictext is cleared dind't changed much just deleted the html and body tags.
Helpers class:
Quote:
|
quote: Public Shared Sub SendConfirmationMessage( _
|
Quote:
ByVal theShoppingCart As ShoppingCart, ByVal orderId As Integer, _
ByVal emailAddress As String)
Try
Dim myGridView As GridView = CreateGridView()
myGridView.DataSource = theShoppingCart.Items
myGridView.DataBind()
If myGridView.Rows.Count > 0 Then
myGridView.FooterRow.Cells(0).Text = "Totaal:"
myGridView.FooterRow.Cells(3).Text = _
String.Format("{0:c}", theShoppingCart.Total)
Dim theSubject As String = "Je bestelling bij Itasc"
Dim theMessage As String = My.Computer.FileSystem.ReadAllText _
(AppConfiguration.ConfirmationMessageLocation)
Dim mySmtpClient As New System.Net.Mail.SmtpClient
theMessage = theMessage.Replace("##ShoppingCart##", _
GetHtmlFromControl(myGridView))
theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
Dim myMessage As MailMessage = New MailMessage("[email protected]", emailAddress, theSubject, theMessage)
myMessage.IsBodyHtml = True
myMessage.Bcc.Add("[email protected]")
'myMessage.Bcc.Add("[email protected]")
'myMessage.Bcc.Add("[email protected]")
mySmtpClient.Send(myMessage)
End If
'Public Shared Sub SendConfirmationMessage( _
' ByVal theShoppingCart As ShoppingCart, ByVal orderId As Integer, _
' ByVal emailAddress As String)
' Try
' Dim myGridView As GridView = CreateGridView()
' myGridView.DataSource = theShoppingCart.Items
' myGridView.DataBind()
' If myGridView.Rows.Count > 0 Then
' myGridView.FooterRow.Cells(0).Text = "Totals:"
' myGridView.FooterRow.Cells(3).Text = _
' String.Format("{0:c}", theShoppingCart.Total)
' Dim theSubject As String = "Your order at Wrox WebShop"
' Dim theMessage As String = My.Computer.FileSystem.ReadAllText _
' (AppConfiguration.ConfirmationMessageLocation)
' 'Dim myMailMessage As New System.Net.Mail.MailMessage
' 'myMailMessage.IsBodyHtml = True
' 'theMessage = theMessage.Replace("##ShoppingCart##", _
' ' GetHtmlFromControl(myGridView))
' 'theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
' 'Dim myClient As New System.Net.Mail.SmtpClient
' 'myClient.Host = "itascsrv01"
' 'myClient.Send(myMailMessage)
' Dim mySmtpClient As New System.Net.Mail.MailMessage
' mySmtpClient.IsBodyHtml = True
' theMessage = theMessage.Replace("##ShoppingCart##", _
' GetHtmlFromControl(myGridView))
' theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
' Dim mClient As New System.Net.Mail.SmtpClient
' mClient.Host = "itascsrv01"
' mClient.Send("[email protected]", emailAddress, theSubject, theMessage)
' End If
Catch ex As Exception
End Try
End Sub
End Class
|
And all the other files i dind't change anything that made it working or not ;)
I hope it will help other people ;)
|
|

November 14th, 2007, 06:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great. Thanks for the follow up.
BTW: did you know that [quote] is to quote someone, while [code] is to represent code in these messages? Using [code] you get a fixed width font which makes things easier to read.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|
 |