Wednesday, September 16, 2009

How To Set Background Image For Canvas

            <ImageBrush  ImageSource="images/dashboard.jpg" Stretch="Fill"  />

See Also...
Strech Property

Sunday, September 13, 2009

How To Send Mail With Attachment In Asp.Net

have to Include The following Namespace,

using System.Net;
using System.Net.Mail; // For Mailing Purpose
using System.IO;  // To Check File existence in Server
using System.Text; // For Encoding.UTF8

            MailMessage objMailMsg = new MailMessage(txtFrom.Text.Trim(), txtTo.Text.Trim());
            Attachment MailAttachment;

            objMailMsg.BodyEncoding = Encoding.UTF8;
            if (txtCc.Text.Trim().Length > 0)
            if (txtBcc.Text.Trim().Length > 0)
            objMailMsg.Subject = "Testing Mail";
            objMailMsg.Body = txtMessage.Text.Trim();
            if (fuMailAtt.HasFile)
                if (!File.Exists(Server.MapPath(@"Attach\" + fuMailAtt.FileName)))
                    fuMailAtt.SaveAs(Server.MapPath(@"Attach\" + fuMailAtt.FileName));
                    MailAttachment = new Attachment(Server.MapPath(@"Attach\" + fuMailAtt.FileName));
                    MailAttachment = new Attachment(Server.MapPath(@"Attach\" + fuMailAtt.FileName));
            objMailMsg.Priority = MailPriority.High;
            objMailMsg.IsBodyHtml = true;

            SmtpClient objSMTPClient = new SmtpClient("", 587);
            objSMTPClient.Credentials = new NetworkCredential("YourYahooId", "Your Yahoo Password");
            Response.Write("Mail Send");
        catch (Exception ex)
            Response.Write("Mail Not Send " + ex.Message);

Controls Name

From Address        txtFrom
To Address            txtTo
Cc Address           
Bcc Address          txtBcc
FileUpload             fuMailAtt
Message                txtMessage
Send Button           btnSend

Download SourceCode

Thursday, September 10, 2009

How To Remove Border In Silverlight HyperlinkButton


Thursday, September 3, 2009

How To Get Time Part From datetime Sql Server

select convert(varchar,getdate(),8) AS Time

Tuesday, September 1, 2009

The type or namespace name 'AspNetCompatibilityRequirements' coul

If Getting The type or namespace name 'AspNetCompatibilityRequirements' could not be found, then have to include the following namespace in class,

Using System.ServiceModel.Activation // C#
Imports System.ServiceModel.Activation // VB

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.