JQuery Reverse each loop.
Full Stack Software Developer | Web Developer | Software Developer | Software Development | Angular - Tech-Coder.com | Tech Coder
Nov 26, 2012
Nov 3, 2012
How to call child page function from parent page using JavaScript.
It's very simple using JavaScript with one line code.
document.getElementById('iFrameId').contentWindow.targetFunction();
Hope you enjoy it.
Aug 23, 2012
In Asp.net, how do I embed images in an email?
static void EmbedImages()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");
//set the content
mail.Subject = "This is an email";
//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");
//then we create the Html part
//to embed images, we need to use the prefix 'cid' in the img src value
//the cid value will map to the Content-Id of a Linked resource.
//thus <img src='cid:companylogo'> will map to a LinkedResource with a ContentId of 'companylogo'
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is an embedded image.<img src=cid:companylogo >", null, "text/html");
//create the LinkedResource (embedded image)
LinkedResource logo = new LinkedResource( "c:\\temp\\logo.gif" );
logo.ContentId = "companylogo";
//add the LinkedResource to the appropriate view
htmlView.LinkedResources.Add(logo);
//add the views
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
smtp.Send(mail);
}
Aug 8, 2012
How Parse XML Using Regular Expressions in Asp.net with C#
Hello Friends,
I got good solution for XML element value find from XML string.
Need to just call this function with parameters XML string, XML element name and default value if value not find into XML string.
private String ExtractContentFromXml(String xml, String element, String defaultValue)
{
String RegExpression = String.Format(@"(?<={0}>)[\S\s]*?(?=\<\/{0})", element);
Match ThisMatch = Regex.Match(xml, RegExpression);
if (ThisMatch.Success)
return ThisMatch.Value;
else
return defaultValue;
}
I hope you will enjoy this solution...