Bannars Have Standards…Cool :)


This morning, I was checking my old emails then I found a useful email from a Web Designer colleague about so interesting topic Bannar Standards .Here is the Email


Most of us may not imagine that a thing as little as banners has standards when it comes to width and height and their place in content, i admit, i myself never imagined, not until I became a web designer :). what make this fact more interesting, is that these standards are based on studies in marketing, visual communication and usability, which make it an art and practice more than . Let me not talk so much, first link for the standard sizes,

The second about banner advertising history

Third, for an e-business specialized only in banners, try to change options of order, especially frames to see how much does it cost πŸ˜‰

Thanks a lot my colleague, it is very nice article

Eliminate Captcha Boring


Here is a better idea to eliminate Captcha boring which used in Twitter, it is as following
You can hide the Captcha control for first time and second time then if the user try to post again it will disappear to disallow the automation πŸ™‚

Validate a DropDown List Using Custom Validator


To do this Add a custom validator to your drop down like that

<asp:DropDownList ID="_districtDropDownList" runat="server" ></asp:DropDownList>
<asp:CustomValidator ID="_districtCustomValidator" runat="server"  
ErrorMessage="error message" ControlToValidate="_districtDropDownList"  

function SelectTypeValidator(sender, args)
   if (args.Value == "-1")  
         args.IsValid = false;   
  else args.IsValid = true;

Custom validation method doesn’t fired if it used with textbox control and its value is empty


​To avoid using of the ValidatorEnable method to disable required field validator at some cases on textbox control I decided to use custom validator as a required field just like the following:

<asp:CustomValidator ID="_examDateCustomValidator" runat="server" Text="*"
 ClientValidationFunction="CustomValidateDDL" ControlToValidate="_textbox">

And here is the javascript validation method

function CustomValidateDDL(sender, args)
  if (args.Value == "")
      args.IsValid = false;
       args.IsValid = true;

unfortunatily I found that this method is working well if I compare the value with any other value except empty text

Execute $(Document).Ready After UpdatePanel PostBack


Add the following code following code to your page and replace the commented line with your code

function EndRequestHandler(sender, args)
  if (args.get_error() == undefined)
    //Add the method which must run after postback here

Be Careful When Using (IN) Keyword


In a some tasks you have to write a SQL statment has a condition like x must be one of the following values {1,2,3, …..}. you can do this by using (in) keyword, and it will give you a good results, However if this values is calculated dynamically your statment may fail in unexpect case.

There is a limitation on this list of values and if these values exceed this limit of values, your statment will fails and may cause a disaster at the production level

This is exactly happened with me in a service which get a data from the database and sends an SMSs according to this data, because we were execute the database operation as a bulk update statement to get a better performance than update each record individually. Under high load this statements fails because of its long length. This cause a SMS which represented by a record in a database still has a status (not sent) and sends again and again

SharePoint Webpart Pages Maintainance URL


If you are working on customize a webpart page and because of an exception occured in one of the webparts which were added to the page, you won’t be able to open it untill you remove this webpart
The problem is how to remove this webpart while you can’t open this page in the edit mode
The solution is so simple use webpart pages maintainance URL as following


javascript copy to clipboard


Use the following function to copy a string to the clipboard in most types of the browsers

function copyToClipboard(txt) 
  if (window.clipboardData) 
     window.clipboardData.setData("Text", txt); 
  else if (navigator.userAgent.indexOf("Opera") != -1) 
     window.location = txt; 
  else if (window.netscape) 
     catch (e) { return false; } 
     var clip = Components.classes[';1'].
                     createInstance (Components.interfaces.nsIClipboard);
     if (!clip) return; 
     var trans = Components.classes[';1'].
                     createInstance (Components.interfaces.nsITransferable); 
     if (!trans) return; 
     var str = new Object(); 
     var len = new Object(); 
     var str = Components.classes[";1"].
                     createInstance (Components.interfaces.nsISupportsString); 
     var copytext = txt; = copytext;
     trans.setTransferData("text/unicode", str, copytext.length * 2);
     var clipid = Components.interfaces.nsIClipboard; 
     if (!clip) return false; 
     clip.setData(trans, null, clipid.kGlobalClipboard);