title: How to set the value of a server control using javascript?
body: <p>Can i set a value of a server control if i pass the ClientID of that server control to the javascript?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function FillTextFromPopup(text) {
          alert(text);
          var myID = '&lt;%= Session["myID"].ToString() %&gt;';
          alert(myID);
  
              document.getElementById(myID).value = 'abc';
  
      }
  &lt;/script&gt;
  
  
  protected void LinkButton1_Click(object sender, EventArgs e)
      {
             GridViewRow gvRow = (GridViewRow)(sender as Control).Parent.Parent;
              int index = gvRow.RowIndex;
              LinkButton lnk = (LinkButton)gvRow.FindControl("LinkButton1");
              string id = lnk.ClientID;
              Session["myID"] = id;
              string myScript;
              myScript = "&lt;script&gt;window.open('PopUpTest1.aspx?',null,'height=750, width=1024,status= no,resizable= no, scrollbars=yes,toolbar=no,location=no,menubar=no'); &lt;/script&gt;";
              ScriptManager.RegisterStartupScript(this, this.GetType(), "pop", myScript, false);
  
      }
  </code></pre>