<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Fundamental Provocation &#187; ASP.Net</title> <atom:link href="http://www.ajaymatharu.com/tag/aspnet/feed/" rel="self" type="application/rss+xml" /><link>http://www.ajaymatharu.com</link> <description>Blog by Ajay Matharu</description> <lastBuildDate>Sun, 06 Nov 2011 15:09:39 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Server Application Unavailable</title><link>http://www.ajaymatharu.com/server-application-unavailable/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=server-application-unavailable</link> <comments>http://www.ajaymatharu.com/server-application-unavailable/#comments</comments> <pubDate>Thu, 22 Apr 2010 04:15:51 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[asp.net 1.1]]></category> <category><![CDATA[asp.net 1.1 server error]]></category> <category><![CDATA[IIS]]></category> <category><![CDATA[server unavailable]]></category> <category><![CDATA[Virtual Directory Error]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=458</guid> <description><![CDATA[Many a time while developing a web application you may come accross &#8220;Server application unavailable&#8221; When you get this error in Windows XP make sure you have given ASPNET user sufficient rights on your physical application folder, it mainly requires read permission. When you get this error in Windows 2003 server you can right click [...]]]></description> <content:encoded><![CDATA[<p>Many a time while developing a web application you may come accross &#8220;Server application unavailable&#8221;</p><p><a href="http://ajaymatharu.files.wordpress.com/2008/11/unavailable2.jpg"><img class="aligncenter size-full wp-image-463" title="unavailable2" src="http://ajaymatharu.files.wordpress.com/2008/11/unavailable2.jpg" alt="unavailable2" width="500" height="284" /></a></p><p>When you get this error in Windows XP make sure you have given ASPNET user sufficient rights on your physical application folder, it mainly requires read permission.</p><p>When you get this error in Windows 2003 server you can right click your virtual directory &#8211; permission &#8211; grant aspnet user sufficient rights there.</p><p>If the above solution doesn&#8217;t work here is another alternative,</p><p>You could try editing the Machine.config (located in<br /> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFI G\).</p><p>Look for a key userName=&#8221;machine&#8221;. If you set it to &#8220;SYSTEM&#8221;<br /> instead the aspnet_wp.exe runs with a different user (with<br /> higher privileges).</p><p>Hope this helps</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/server-application-unavailable/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Cannot create/shadow copy when that file already exists</title><link>http://www.ajaymatharu.com/cannot-createshadow-copy-when-that-file-already-exists/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cannot-createshadow-copy-when-that-file-already-exists</link> <comments>http://www.ajaymatharu.com/cannot-createshadow-copy-when-that-file-already-exists/#comments</comments> <pubDate>Fri, 09 Oct 2009 06:49:21 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Cache]]></category> <category><![CDATA[Hosting Environment]]></category> <category><![CDATA[Shadow Copy]]></category> <category><![CDATA[web.config]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1593</guid> <description><![CDATA[The .Net Framework has a feature called Shadow Copy. Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location. But this may create problem sometimes.]]></description> <content:encoded><![CDATA[<p>The .Net Framework has a feature called <span style="font-weight: bold;">Shadow Copy</span>.</p><p>Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location.</p><pre class="xml" name="code">
<hostingenvironment shadowcopybinassemblies="false">
</hostingenvironment>
</pre><p>But this may create <a title="Side effects of shadow copy bin assemblies" href="http://www.ajaymatharu.com/side-effect-of-shadowcopybinassemblies/" target="_blank">problem</a> sometimes.</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/cannot-createshadow-copy-when-that-file-already-exists/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Error catching in Global.asax</title><link>http://www.ajaymatharu.com/error-catching-in-global-asax/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-catching-in-global-asax</link> <comments>http://www.ajaymatharu.com/error-catching-in-global-asax/#comments</comments> <pubDate>Mon, 07 Sep 2009 03:53:22 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[code snippet]]></category> <category><![CDATA[custom error]]></category> <category><![CDATA[Dot Net]]></category> <category><![CDATA[error handling]]></category> <category><![CDATA[global.asax]]></category> <category><![CDATA[httpcontext]]></category> <category><![CDATA[visual studio.net]]></category> <category><![CDATA[web.config]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1635</guid> <description><![CDATA[The following code snippet will help you to catch an error in the global.asax file, Turn off the custom error mode in web.config file first, &#60;customErrors mode="Off"&#62; And add this code in your global.asax file to catch the error, void Application_Error(object sender, EventArgs e) { HttpContext context = ((HttpApplication)sender).Context; if (context.Error != null) { Exception [...]]]></description> <content:encoded><![CDATA[<p>The following code snippet will help you to catch an error in the global.asax file,</p><p>Turn off the custom error mode in web.config file first,</p><pre name="code" class="xml">&lt;customErrors mode="Off"&gt;</pre><p>And add this code in your global.asax file to catch the error,</p><pre name="code" class="c#">void Application_Error(object sender, EventArgs e)
 {
 HttpContext context = ((HttpApplication)sender).Context;
 if (context.Error != null)
 {
 Exception ex = context.Error;
 string msg = string.Empty;

 while (ex != null)
 {
 if (!string.IsNullOrEmpty(ex.Message))
 msg += ex.ToString() + "&lt;br /&gt;&lt;br /&gt;";
 ex = ex.InnerException;
 }
 context.Response.Clear();
 context.Response.Write(msg);
 context.Response.End();
 }
 } </pre><p>Hope this helps <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/error-catching-in-global-asax/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Add another application as child of BlogEngine.net</title><link>http://www.ajaymatharu.com/add-another-application-as-child-of-blogengine-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-another-application-as-child-of-blogengine-net</link> <comments>http://www.ajaymatharu.com/add-another-application-as-child-of-blogengine-net/#comments</comments> <pubDate>Fri, 28 Aug 2009 17:48:52 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[BE]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[Blog Engine]]></category> <category><![CDATA[blogengine]]></category> <category><![CDATA[blogengine.net]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[VS]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1632</guid> <description><![CDATA[I have been getting good response for my post Integrating blog engine into existing site. One of the guy asked me this question on how can we do the opposite? He had a BlogEngine as parent site and needed some other site to be child of BlogEngine. So He posted on that and this is [...]]]></description> <content:encoded><![CDATA[<p>I have been getting good response for my post <a href="http://www.ajaymatharu.com/integrating-blogengine-into-an-existing-site/" target="_blank">Integrating blog engine into existing site</a>. One of the guy asked me this question on how can we do the opposite? He had a BlogEngine as parent site and needed some other site to be child of BlogEngine. So He posted on that and this is the answer he got for his question.</p><p>You need to make this change in your web.config file. If you want to have a website as child of BlogEngine</p><pre name="code" class="xml"><strong>&lt;location path="." inheritInChildApplications="false"&gt;</strong>
 &lt;system.web&gt;
 ..... existing content .....
 &lt;/system.web&gt;
<strong>&lt;/location&gt;</strong>

<strong>&lt;location path="." inheritInChildApplications="false"&gt;</strong>
 &lt;system.webServer&gt;
 ..... existing content .....
 &lt;/system.webServer&gt;
<strong>&lt;/location&gt;</strong></pre>]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/add-another-application-as-child-of-blogengine-net/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Set Item level permission in sharepoint through coding</title><link>http://www.ajaymatharu.com/set-item-level-permission-in-sharepoint-through-coding/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=set-item-level-permission-in-sharepoint-through-coding</link> <comments>http://www.ajaymatharu.com/set-item-level-permission-in-sharepoint-through-coding/#comments</comments> <pubDate>Sat, 25 Jul 2009 06:03:31 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Sharepoint]]></category> <category><![CDATA[Technical]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[Permissions]]></category> <category><![CDATA[Sharepoint Permission]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=417</guid> <description><![CDATA[Here is the way we can add item level permission for a user on an item, SPRoleDefinition oUserRole; SPRoleAssignment oUserRoleAssignment; SPListItem itm; SPSite site = null; SPWeb web = null; string siteUrl = Request.Url.ToString(); site = new SPSite(siteUrl); web = site.OpenWeb(); SPGroup grp = web.Groups[groupname]; itm=web.Lists["Shared Documents"].Items[0]; oUserRole = web.RoleDefinitions.GetByType(SPRoleType.Administrator); oUserRoleAssignment = new SPRoleAssignment(loginName, emailId, [...]]]></description> <content:encoded><![CDATA[<p>Here is the way we can add item level permission for a user on an item,<br /> SPRoleDefinition oUserRole;<br /> SPRoleAssignment oUserRoleAssignment;<br /> SPListItem itm;<br /> SPSite site = null;<br /> SPWeb web = null;<br /> string siteUrl = Request.Url.ToString();</p><p>site = new SPSite(siteUrl);<br /> web = site.OpenWeb();<br /> SPGroup grp = web.Groups[groupname];</p><p>itm=web.Lists["Shared Documents"].Items[0];</p><p>oUserRole = web.RoleDefinitions.GetByType(SPRoleType.Administrator);</p><p>oUserRoleAssignment = new SPRoleAssignment(loginName, emailId, userDisplayName, notes);//for user<br /> or<br /> oUserRoleAssignment = new SPRoleAssignment(grp);//for group</p><p>oUserRoleAssignment.RoleDefinitionBindings.Add(oUserRole);<br /> itm.RoleAssignments.Add(oUserRoleAssignment);<br /> web.AllowUnsafeUpdates = true;<br /> itm.Update();<br /> web.Update();<br /> web.AllowUnsafeUpdates = false;</p><p>This is useful for setting item level permission via code.</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/set-item-level-permission-in-sharepoint-through-coding/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Numeric Format Strings</title><link>http://www.ajaymatharu.com/numeric-format-strings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=numeric-format-strings</link> <comments>http://www.ajaymatharu.com/numeric-format-strings/#comments</comments> <pubDate>Sat, 25 Jul 2009 06:03:29 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[C#.Net]]></category> <category><![CDATA[format specifier]]></category> <category><![CDATA[format string]]></category> <category><![CDATA[numeric Format]]></category> <category><![CDATA[numeric format strings]]></category> <category><![CDATA[numeric types]]></category> <category><![CDATA[Objects]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1276</guid> <description><![CDATA[Standard numeric format strings are used to return string equivalents of numeric types in predefined patterns. When used with ToString, a standard numeric format string parameter takes the form. object.ToString ( "Fn" ); where F is a single alphabetic character called the format specifier, and n can be one or more digits called the precision [...]]]></description> <content:encoded><![CDATA[<p>Standard numeric format strings are used to return string equivalents of numeric types in predefined patterns. When used with ToString, a standard numeric format string parameter takes the form.</p><pre class="c-sharp">object.ToString ( "Fn" );</pre><p>where F is a single alphabetic character called the format specifier, and n can be one or more digits called the precision specifier.</p><p>The following table describes the standard numeric format strings. Note that the patterns produced by these format specifiers are influenced by the settings in the Regional Options control panel. Computers using different cultures or different currency settings will display different patterns.</p><table class="data" border="0" cellspacing="1" width="95%" align="center"><col width="20%"></col><col width="25%"></col><col width="55%"></col><tbody><tr><th>Format specifier</th><th>Name</th><th>Description</th></tr><tr><td>C or c</td><td>Currency</td><td>The number is converted to a string that represents a currency amount. The conversion is controlled by the currency format information of the <a href="http://www.ajaymatharu.com/aspxtreme/sys/Globalization/NumberFormatInfoClass.aspx">NumberFormatInfo</a> object used to format the number. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default currency precision given by the <strong>NumberFormatInfo</strong> is used.</td></tr><tr><td>D or d</td><td>Decimal</td><td>This format is supported for integral types only. The number is converted to a string of decimal digits ( 0-9 ), prefixed by a minus sign if the number is negative. The precision specifier indicates the minimum number of digits desired in the resulting string. If required, the number is padded with zeros to its left to produce the number of digits given by the precision specifier.</td></tr><tr><td>E or e</td><td>Scientific ( exponential )</td><td>The number is converted to a string of the form &#8220;-d.ddd�E+ddd&#8221; or &#8220;-d.ddd�e+ddd&#8221;, where each &#8216;d&#8217; indicates a digit ( 0-9 ). The string starts with a minus sign if the number is negative. One digit always precedes the decimal point. The precision specifier indicates the desired number of digits after the decimal point. If the precision specifier is omitted, a default of six digits after the decimal point is used. The case of the format specifier indicates whether to prefix the exponent with an &#8216;E&#8217; or an &#8216;e&#8217;. The exponent always consists of a plus or minus sign and a minimum of three digits. The exponent is padded with zeros to meet this minimum, if required.</td></tr><tr><td>F or f</td><td>Fixed-point</td><td>The number is converted to a string of the form &#8220;-ddd.ddd�&#8221; where each &#8216;d&#8217; indicates a digit ( 0-9 ). The string starts with a minus sign if the number is negative. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default numeric precision given by the <strong>NumberFormatInfo</strong> is used.</td></tr><tr><td>G or g</td><td>General</td><td>The number is converted to the most compact decimal form, using fixed or scientific notation. The precision specifier determines the number of significant digits in the resulting string. If the precision specifier is omitted, the number of significant digits is determined by the type of number being converted:</p><ul><li><strong>Int16</strong> or <strong>UInt16</strong>: 5 digits</li><li><strong>Int32</strong> or <strong>UInt32</strong>: 10 digits</li><li><strong>Int64</strong> or <strong>UInt64</strong>: 19 digits</li><li><strong>Single</strong>: 7 digits</li><li><strong>Double</strong>: 15 digits</li><li><strong>Decimal</strong>: 29 digits</li></ul><p>Trailing zeros after the decimal point are removed, and the resulting string contains a decimal point only if required.</p><p>The resulting string uses fixed-point format if the exponent of the number ( as produced by the &#8216;E&#8217; format ) is less than the number of significant digits, and greater than or equal to –4. Otherwise, the resulting string uses scientific format, and the case of the format specifier controls whether the format is prefixed with an &#8216;E&#8217; or an &#8216;e&#8217;.</td></tr><tr><td>N or n</td><td>Number</td><td>The number is converted to a string of the form &#8220;-d,ddd,ddd.ddd�&#8221;, where each &#8216;d&#8217; indicates a digit ( 0-9 ). The string starts with a minus sign if the number is negative. Thousand separators are inserted between each group of three digits to the left of the decimal point. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default numeric precision given by the <strong>NumberFormatInfo</strong> is used.</td></tr><tr><td>P or p</td><td>Percent</td><td>The number is converted to a string that represents a percent as defined by the <a href="http://www.ajaymatharu.com/aspxtreme/sys/Globalization/NumberFormatInfoClassPercentNegativePattern.aspx">NumberFormatInfo.PercentNegativePattern</a> property or the <a href="http://www.ajaymatharu.com/aspxtreme/sys/Globalization/NumberFormatInfoClassPercentPositivePattern.aspx">NumberFormatInfo.PercentPositivePattern</a> property. If the number is negative, the string produced is defined by the <strong>PercentNegativePattern</strong> and starts with a minus sign. The converted number is multiplied by 100 in order to be presented as a percentage. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default numeric precision given by <strong>NumberFormatInfo</strong> is used.</td></tr><tr><td>R or r</td><td>Round-trip</td><td>The round-trip specifier guarantees that a numeric value converted to a string will be parsed back into the same numeric value. When a numeric value is formatted using this specifier, it is first tested using the general format, with 15 spaces of precision for a <strong>Double</strong> and 7 spaces of precision for a <strong>Single</strong>. If the value is successfully parsed back to the same numeric value, then it is formatted using the general format specifer. However, if the value is not successfully parsed back to the same numeric value, then the value is formatted using 17 digits of precision for a <strong>Double</strong> and 9 digits of precision for a <strong>Single</strong>. Although a precision specifier can be appended to the round-trip format specifier, it is ignored. Round trips are given precedence over precision when using this specifier. This format is supported by floating-point types only.</td></tr><tr><td>X or x</td><td>Hexadecimal</td><td>The number is converted to a string of hexadecimal digits. The case of the format specifier indicates whether to use uppercase or lowercase characters for the hexadecimal digits greater than 9. For example, use &#8216;X&#8217; to produce &#8216;ABCDEF&#8217;, and &#8216;x&#8217; to produce &#8216;abcdef&#8217;. The precision specifier indicates the minimum number of digits desired in the resulting string. If required, the number is padded with zeros to its left to produce the number of digits given by the precision specifier. This format is supported for integral types only.</td></tr></tbody></table> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/numeric-format-strings/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>control does not exists in current context</title><link>http://www.ajaymatharu.com/control-does-not-exists-in-current-context/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=control-does-not-exists-in-current-context</link> <comments>http://www.ajaymatharu.com/control-does-not-exists-in-current-context/#comments</comments> <pubDate>Wed, 22 Jul 2009 17:24:49 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[.net controls]]></category> <category><![CDATA[C#]]></category> <category><![CDATA[C#.Net]]></category> <category><![CDATA[context]]></category> <category><![CDATA[Dot Net]]></category> <category><![CDATA[VB]]></category> <category><![CDATA[vb.net]]></category> <category><![CDATA[visual studio.net]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=665</guid> <description><![CDATA[Another one of those problems that can stump you for a while. I often make backups of files as I progress and sometimes leave them in the website folder, this was fine with classic ASP but as I have found with ASP.Net can cause all sorts of problems.One issue I was having was trying to [...]]]></description> <content:encoded><![CDATA[<p><span style="font-size:85%;">Another one of those problems that can stump you for a while. I often make backups of files as I progress and sometimes leave them in the website folder, this was fine with classic ASP but as I have found with ASP.Net can cause all sorts of problems.</span><span style="font-size:85%;">One issue I was having was trying to reference a component in my aspx page from the codebehind page and seeing the following error when trying to reference a label control:</span></p><blockquote><p><span style="font-size:85%;">“Label2 does not exist in the current context”</span></p></blockquote><p><span style="font-size:85%;">So I found that the problem was even though I renamed one of my old files it still contained the class that my codebehind was referencing (i.e. the class names were still the same) &#8211; and therefore was not seeing the newly added Label control to my new code.</span><span style="font-size:85%;">Shame the compiler doesn’t realise the duplication and give some indication.</span></p><p>Lesson: Remove any backed up files from the web folder and/or build directory to avoid pain <img class="wp-smiley" src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/control-does-not-exists-in-current-context/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using JSON to send objects across pages</title><link>http://www.ajaymatharu.com/using-json-to-send-objects-across-pages/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-json-to-send-objects-across-pages</link> <comments>http://www.ajaymatharu.com/using-json-to-send-objects-across-pages/#comments</comments> <pubDate>Wed, 15 Jul 2009 15:20:17 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Arraylist]]></category> <category><![CDATA[C#]]></category> <category><![CDATA[DeSerialize]]></category> <category><![CDATA[HttpRequest]]></category> <category><![CDATA[JSON]]></category> <category><![CDATA[Microsoft .Net]]></category> <category><![CDATA[Request Object]]></category> <category><![CDATA[Serialize]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1489</guid> <description><![CDATA[Recently our team came across a situation where our job was to retrieve ArrayList in a page requested by flex application using HttpService.Which are accessed using Request[keyName] Request objects always returns data in string format, so there was no point in trying that solution, so we were looking for some reliable and optimal solution. Googling [...]]]></description> <content:encoded><![CDATA[<p>Recently our team came across a situation where our job was to retrieve ArrayList in a page requested by flex application using HttpService.Which are accessed using <strong>Request[keyName]<br /> </strong><br /> Request objects always returns data in string format, so there was no point in trying that solution, so we were looking for some reliable and optimal solution. Googling around I came across JSON (Javascript Object Notation).JSON can be used in various languages, you can find the list of langauges and the resources requied to use <a href="http://json.org/">JSON</a> over here.</p><p>JSON allows us to serialize a object and send across a page in string format.All we need to do is to perform Deserialization on the requested page.</p><p>This is the sample code which demonstrates the use of JSON to send arraylist to another page.</p><p>The code below contains 2 arraylist which need to be send on another page.The arraylist are serialized and sent to different page with the help of querystring.</p><pre name="code" class="c#">
ArrayList list = new ArrayList();
ArrayList list1 = new ArrayList();
list1.Add("one-one");
list1.Add("one-two");
list1.Add("one-three");
list1.Add("one-four");
list.Add(list1);
list.Add("two");
list.Add("three");
string arrayList = JavaScriptConvert.SerializeObject(list);
Response.Redirect("Process.aspx?list="+arrayList);
</pre><p>The code below Deserialize and typecast the object to JavaScriptArray.</p><pre name="code" class="c#">
string arrayList = Request["list"];
JavaScriptArray list = (JavaScriptArray)JavaScriptConvert.DeserializeObject(arrayList);
</pre><p>You can download sample code from <a href="http://www.box.net/shared/g0nahe7979">here</a>.</p><p>Enjoy Coding <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/using-json-to-send-objects-across-pages/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Disable Cut, Copy &amp; Paste in ASP.Net textbox</title><link>http://www.ajaymatharu.com/disable-cut-copy-paste-in-asp-net-textbox/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=disable-cut-copy-paste-in-asp-net-textbox</link> <comments>http://www.ajaymatharu.com/disable-cut-copy-paste-in-asp-net-textbox/#comments</comments> <pubDate>Wed, 08 Jul 2009 18:57:44 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Tip of Week]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[asp textbox]]></category> <category><![CDATA[ASP.Net textbox]]></category> <category><![CDATA[Copy]]></category> <category><![CDATA[copy paste]]></category> <category><![CDATA[Cut]]></category> <category><![CDATA[Disable Cut]]></category> <category><![CDATA[Disable Cut Copy Paste]]></category> <category><![CDATA[Paste]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1473</guid> <description><![CDATA[You can disable cut, copy &#38; paste in ASP.Net textbox in very simple way, here is how you can disable the cut, copy, paste, &#60;asp:TextBox ID=”TextBox1″ runat=”server” oncopy=”return false” onpaste=”return false” oncut=”return false”&#62;&#60;/asp:TextBox&#62;]]></description> <content:encoded><![CDATA[<p>You can disable cut, copy &amp; paste in ASP.Net textbox in very simple way,</p><p>here is how you can disable the cut, copy, paste,</p><pre class="html" name="code">&lt;asp:TextBox ID=”TextBox1″ runat=”server” oncopy=”return false” onpaste=”return false” oncut=”return false”&gt;&lt;/asp:TextBox&gt;</pre>]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/disable-cut-copy-paste-in-asp-net-textbox/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Zipping in asp.net</title><link>http://www.ajaymatharu.com/zipping-in-asp-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zipping-in-asp-net</link> <comments>http://www.ajaymatharu.com/zipping-in-asp-net/#comments</comments> <pubDate>Sat, 20 Jun 2009 07:42:44 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Tip of Week]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1363</guid> <description><![CDATA[Zipping was never so easy in .Net. Check out this project on codeplex, http://dotnetzip.codeplex.com/ Here are the features of the DotNetZip Library, DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Create and read zip files in VB, C#, or any .NET language, [...]]]></description> <content:encoded><![CDATA[<p>Zipping was never so easy in .Net. Check out this project on codeplex, http://dotnetzip.codeplex.com/</p><p>Here are the features of the DotNetZip Library,<br /> DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Create and read zip files in VB, C#, or any .NET language, or any scripting environment. DotNetZip supports these scenarios:<br /> - an ASP.NET app that dynamically creates ZIP files and allows a browser to download them<br /> - a Windows Service that periodically zips up a directory for backup and archival purposes<br /> - a WPF program that modifyies an existing archive &#8211; renaming entries, removing entries from an archive, or adding new entries to an archive<br /> - a Windows Forms app that creates AES-encrypted zip archives for privacy of archived content.<br /> - An administrative script in PowerShell or VBScript that performs backup and archival.<br /> - a WCF service that receives a zip file as an attachment, and dynamically unpacks the zip to a stream for analysis<br /> - creating zip files from stream content, saving to a stream, extracting to a stream, reading from a stream<br /> - creation of self-extracting archives.</p><p>Njoy coding <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/zipping-in-asp-net/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
