title: how to pass session value to external js file
body: <p>i got two pages upl.aspx and datalist.aspx</p>
  
  <p>i have got iframe in upl.aspx page which loads datalist.aspx</p>
  
  <p>now i am creating a session on radiobutton click whiich is inside datalist
  i want to pass this session value to external js file so that
  now i have a function Hidee() in uploo.aspx page which can show its value</p>
  
  <p>HOW TO DO THIS??</p>
  
  <p>here is my code for up1.aspx</p>
  
  <pre><code>&lt;a onclick="Hidee();" style="cursor: pointer"&gt;close&lt;/a&gt;&lt;/div&gt;
  
  &lt;iframe id="frame1" frameborder="0" name="frame1" src="datalist.aspx"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>this is from datalist.aspx in which i have my datalist</p>
  
  <pre><code>&lt;td align="center" &gt; 
  
  
                  &lt;asp:RadioButton ID="rdb" runat="server"     CssClass="radio" AutoPostBack="True" OnCheckedChanged="rdb_click" /&gt; 
  
  
                  &lt;asp:HiddenField ID="HiddenField1" runat="server" Value = '&lt;%#Eval("FileName")%&gt;' /&gt; 
                  &lt;/td&gt;
                  &lt;/tr&gt;  
  </code></pre>
  
  <p>here is codebehind  datalist.cs</p>
  
  <pre><code>public void rdb_click(object sender, EventArgs e)
      {
          string value = "";
          for (int i = 0; i &lt; DataList1.Items.Count; i++)
          {
              RadioButton rdb1;
              rdb1 = (RadioButton)DataList1.Items[i].FindControl("rdb");
              if (rdb1 != null)
              {
                  if (rdb1.Checked)
                  {
                      HiddenField hf = (HiddenField)DataList1.Items[i].FindControl("HiddenField1");
                      value = hf.Value.ToString();
                  }
              }
          }
          Session["Background1"] = value;
          Label2.Text = value;
  
      }
  </code></pre>
  
  <p>and in my external javascript  i have function Hidee();</p>
  
  <pre><code>function Hidee()
  {
  var div2 = document.getElementById( "divframe1" ); 
  div2.style.display = "none";
  var div3 = document.getElementById( "aa" );
  div3.style.display = "block";
  var session ='&lt;%= Session["Background1"] %&gt;';
  alert("you have selected" + session);
  }
  </code></pre>