Knowledge Base

Snippets

06

public string get_image(string product_ID)
{
 string functionReturnValue = null;
 HttpWebRequest req = default(HttpWebRequest);
 req = WebRequest.Create("http://www.yoursite.com/Images/products/" + product_ID + "_thumb.jpg");
 HttpWebResponse resp = default(HttpWebResponse);
 try {
  resp = req.GetResponse();
  functionReturnValue = "<a href='http://www.yoursite.com/Images/products/" + product_ID.Trim() + ".jpg' target='_blank'><IMG border=0 src='http://www.yoursite.com/upl_data/products/" + product_ID.Trim() + "_thumb.jpg' /></a>";
 } catch (Exception ex) {
  functionReturnValue = "<IMG border=0 src='images/noimage.jpg' />";
 }
 return functionReturnValue;
 //return functionReturnValue;

 

Post Rating

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.