<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 22:08:52 +0000</lastBuildDate>
    <item>
      <title>(Objective C) iOS Show Full Screen - streamt</title>
      <link>https://snipplr.com/view/59663/ios-show-full-screen</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 12 Oct 2011 11:26:13 UTC</pubDate>
      <guid>https://snipplr.com/view/59663/ios-show-full-screen</guid>
    </item>
    <item>
      <title>(JavaScript) CheckUncheck all checkboxes on page - streamt</title>
      <link>https://snipplr.com/view/50602/checkuncheck-all-checkboxes-on-page</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 13 Mar 2011 09:50:20 UTC</pubDate>
      <guid>https://snipplr.com/view/50602/checkuncheck-all-checkboxes-on-page</guid>
    </item>
    <item>
      <title>(Objective C) Selector. Call Back. - streamt</title>
      <link>https://snipplr.com/view/50283/selector-call-back</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 08 Mar 2011 12:06:06 UTC</pubDate>
      <guid>https://snipplr.com/view/50283/selector-call-back</guid>
    </item>
    <item>
      <title>(Objective C) Create UITableView - streamt</title>
      <link>https://snipplr.com/view/50071/create-uitableview</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 05 Mar 2011 07:22:33 UTC</pubDate>
      <guid>https://snipplr.com/view/50071/create-uitableview</guid>
    </item>
    <item>
      <title>(Objective C) Show Modal Dialog - streamt</title>
      <link>https://snipplr.com/view/50070/show-modal-dialog</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 05 Mar 2011 07:18:37 UTC</pubDate>
      <guid>https://snipplr.com/view/50070/show-modal-dialog</guid>
    </item>
    <item>
      <title>(Objective C) Show UIPopoverController - streamt</title>
      <link>https://snipplr.com/view/50035/show-uipopovercontroller</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 04 Mar 2011 12:38:22 UTC</pubDate>
      <guid>https://snipplr.com/view/50035/show-uipopovercontroller</guid>
    </item>
    <item>
      <title>(CSS) iOS Web CSS/HTML Minimum - streamt</title>
      <link>https://snipplr.com/view/44909/ios-web-csshtml-minimum</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 26 Nov 2010 13:16:43 UTC</pubDate>
      <guid>https://snipplr.com/view/44909/ios-web-csshtml-minimum</guid>
    </item>
    <item>
      <title>(C#) Service Provider - streamt</title>
      <link>https://snipplr.com/view/29246/service-provider</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 03 Mar 2010 17:17:21 UTC</pubDate>
      <guid>https://snipplr.com/view/29246/service-provider</guid>
    </item>
    <item>
      <title>(JavaScript) Getting JavaScript and ASP.NET talking (outside of AJAX) - streamt</title>
      <link>https://snipplr.com/view/28310/getting-javascript-and-aspnet-talking-outside-of-ajax</link>
      <description>&lt;p&gt;Passing values between ASP.NET and JavaScript code is messy...&lt;/p&gt;</description>
      <pubDate>Sun, 14 Feb 2010 22:36:46 UTC</pubDate>
      <guid>https://snipplr.com/view/28310/getting-javascript-and-aspnet-talking-outside-of-ajax</guid>
    </item>
    <item>
      <title>(JavaScript) Accessing javascript variable from code behind and accessing code behind variable from javascript - streamt</title>
      <link>https://snipplr.com/view/28309/accessing-javascript-variable-from-code-behind-and-accessing-code-behind-variable-from-javascript</link>
      <description>&lt;p&gt;Many times we face situation like when we need to access the code behind variables from javascript as well as accessing javascript variable from code behind.&#13;
&#13;
I can remember a practical scenario in my previous project.&#13;
&#13;
The requirement was to draw a organizational chart (What is Org chart?). On mouse hover on each node of the chart a window should get opened and all the information about the particular employee should be shown there without sny kind of postback(not even partial).&#13;
&#13;
So here all you have to do is, you have to get all the required values from the server in to your code behind variable and then access them from your javascript code.&#13;
&#13;
How to access code behind variable value from javascript?&#13;
&#13;
Step 1:  Define the variable in your code behind.&#13;
&#13;
Step 2:Access the variable using the '&lt;%=&gt;' syntax.&#13;
&#13;
  public/protected string codeBehindVariable = "Hello World";// Step 1&#13;
&#13;
 var javascriptVar='&lt;%=&gt;';// Step 2&#13;
&#13;
Point to be noted: Remember! The code behind variable that we are accessing from the javascript that must be a class level variable to a method/function lavel variable.&#13;
&#13;
public partial class _Default : System.Web.UI.Page &#13;
{&#13;
    private string codeBehindVariable = "Hello World";// class elvel variable not method level&#13;
&#13;
    protected void Page_Load(object sender, EventArgs e)&#13;
&#13;
   {&#13;
&#13;
    }&#13;
&#13;
}&#13;
&#13;
The variavle access modifier muct not be private or you will the the compilation error,&#13;
&#13;
Error 2 '_Default.codeBehindVariable' is inaccessible due to its protection level &#13;
&#13;
How can we access javascript variable value from the code behind?&#13;
&#13;
Step 1:  Put a HiddenField control in your html.&#13;
&#13;
Step 2: Get the hiddenfield element id using document.GetElementByID() method and set the value property to any javascript variable.&#13;
&#13;
Step 3: Access the hidden field variable from the code behind to access the value(the value of the javascript variable).&#13;
&#13;
&lt;asp:Label&gt;&lt;/asp:Label&gt;&#13;
        &lt;asp:HiddenField&gt;  // Step 1&#13;
&#13;
 &#13;
&#13;
&lt;script&gt;&#13;
    var valToPass='Joydeep Sen';&#13;
   &#13;
      onload=function(){&#13;
        document.getElementById ('&lt;%=&gt;').value=valToPass;// Step 2&#13;
        &#13;
    }&#13;
    &lt;/script&gt;&#13;
&#13;
 &#13;
&#13;
 label1.Text = hiddenfield1.Value;// Step 3&#13;
&#13;
 I think these approaches are quite simple and straightforward.&lt;/p&gt;</description>
      <pubDate>Sun, 14 Feb 2010 22:32:04 UTC</pubDate>
      <guid>https://snipplr.com/view/28309/accessing-javascript-variable-from-code-behind-and-accessing-code-behind-variable-from-javascript</guid>
    </item>
    <item>
      <title>(C#) Get URL Parameters using LINQ - streamt</title>
      <link>https://snipplr.com/view/27185/get-url-parameters-using-linq</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 27 Jan 2010 12:28:00 UTC</pubDate>
      <guid>https://snipplr.com/view/27185/get-url-parameters-using-linq</guid>
    </item>
    <item>
      <title>(C#) ASP.NET Pages Config - streamt</title>
      <link>https://snipplr.com/view/26564/aspnet-pages-config</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 16 Jan 2010 13:59:54 UTC</pubDate>
      <guid>https://snipplr.com/view/26564/aspnet-pages-config</guid>
    </item>
  </channel>
</rss>
