Platinum Partner

Generate Client Id In Javascript

// description of your code here

// calling code: GenerateClientIDVariables(txtCountryCode, txtStateCode, txtPhoneNo);


private void GenerateClientIDVariables(params Control[] controlArray)
        {
            if (!this.Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), this.GetType().FullName))
            {
                var clientIDs = new StringBuilder();
                var declaration = "var {0}='{1}';";

                foreach (Control ctrl in controlArray)
                {
                    if (ctrl.ClientID != null && ctrl.ID != null && ctrl.Visible)
                    {
                        clientIDs.AppendFormat(declaration, ctrl.ID, ctrl.ClientID);
                    }
                }

                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), this.GetType().FullName, clientIDs.ToString(), true);
            }
        }
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}