Linq to XML problem
HejNår jeg fyre følgende kode af, så får jeg Compilation Error fra Surftown.. det virker lokalt, og synes ikke jeg kan se nogle fejl.
Fejl:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1002: ; expected
Source Error:
Line 19: XDocument XML = XDocument.Load(Server.MapPath("~/XML/WebSettings.XML"));
Line 20:
Line 21: var Email = from Email_ in XML.Descendants("ContactEmail") select Email_.Value;
Line 22:
Line 23: foreach(var b in Email)
Kode:
XDocument XML = XDocument.Load(Server.MapPath("~/XML/WebSettings.XML"));
var Email = from Email_ in XML.Descendants("ContactEmail") select Email_.Value;
foreach(var b in Email)
{
ToEmail = b.ToString();
}
Mail.SendMail(ToEmail, tbEmail.Text , tbMessage.Text, tbSubject.Text, tbName.Text);