Posts

Showing posts from April, 2011

Protect image from being copied

Image
Hello Friends, Many times I am asked to protect some copyrighted images over web, so finally I have found a better way to protect from being copied. There are some cases by which we can copy the image Here I have taken care of following cases Right click on image and Save the Image Save the Entire page and all images displayed on page will be downloaded to its Data Folder in mozila Firefox, We can save the media files by following steps Right click on Page, select “View Page Info” It will open a window, Select “Media” tab, here a list of all files will be available select particular file and click on “Save As” button to save the media Now Let’s Start our main topic,that is protect image from being copied There is a concept called Data URI scheme . Generally to display any image on page, we use Relative_URL and if we display image using this, the images can be easily copied. Here we will save image in database and retrieve the same To Create table CR...

Fetch Data from Control Without Loop- Best Use of LINQ

Hi friends…. Many times I need to generate collection type Data from GridView or Repeater or any other control.. and in that case I used to loop through each rowitem of particular control.. here each row of repeater is listitem of LINQ query. same way you can perform for all DataBound Controls like GridView, Repeater, DataList, DropDownlist, CheckboxList, Radiobuttonlist etc… but after using LINQ , I am able to do that very easily here is sample of Repeater control to Get List of data List ctrls = (from item in rptctrlList.Items.Cast () where ((CheckBox)item.FindControl("chkctrl")).Checked select new ctrlInfo() { ctrlId = Convert.ToInt32(((HiddenField)item.FindControl("hdnctrlId")).Value), UserctrlId = Convert.ToInt64(((HiddenField)item.FindControl("hdnUserctrlId")).Valu...

Apply Frame to Image with CSS

Image
Hello Many times we need to display image like profile image or advertisements and at that time we need to decorate it within frame…   Here we have a simplest way to apply frame which will help to set frame to any size image and unique for all.. here I have a sample code for it <html> <head> <style> img { background: url("shadow.gif") no-repeat scroll right bottom transparent; border-color: #EEEEEE -moz-use-text-color -moz-use-text-color #EEEEEE; border-right: medium none; border-style: solid none none solid; border-width: 1px medium medium 1px; padding: 4px 10px 10px 4px;} </style> </head> <body> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxKSyD46sNlLs8yYLBFMz_YGOiYANzbKSUPo5YT5f2K34QvZgGOWTWF_s_aWPoe4zuVafRytM6346dkW7bkjptRImMMCLWyaCxtGgAjPD97wa7HWZ_l94H2uWxlU8V2UKIJPgvyj7sTO5x/s220/Sandeep.JPG'> </body> </html> and the you can have any kind of frame imag...