Wednesday, October 17, 2012

WCF : Binding: General method to create service client


public static TClient GetServiceClient(string url) 
            where TClient : class
            where TInterface:class
        {
            var binding = new BasicHttpBinding { MaxReceivedMessageSize = 50000000 }; //50 MB
            var endPoint = new EndpointAddress(url);
         
            var result = Activator.CreateInstance(typeof(TClient), binding, endPoint) as TClient;
            var client = result as ClientBase;

           //AttachSecurityInfo(binding, client.ChannelFactory.Credentials);
            return result;
        }




Thursday, May 31, 2012

Moving drop down list (option) value to another option

Moving drop down list (option) value to another option



function copyItems(ddlIdSource, ddlIdTarget) {
        jQuery('#' + ddlIdTarget +' > option').remove();
        jQuery('#' +ddlIdSource +' > option').each(function () {
            alert(this.text + '   ' + this.value);
            jQuery("#" + ddlIdTarget).append(this);
        });
    }