<?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"
	>

<channel>
	<title>Victor's Programming Aid</title>
	<atom:link href="http://www.victorchen.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.victorchen.info</link>
	<description>Weblog of programming articles by a college graduate from the UC Irvine</description>
	<pubDate>Wed, 16 Jul 2008 14:50:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Form Submit On Enter in Visual Studio 2008</title>
		<link>http://www.victorchen.info/form-submit-on-enter-in-visual-studio-2008/</link>
		<comments>http://www.victorchen.info/form-submit-on-enter-in-visual-studio-2008/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 14:46:01 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<category><![CDATA[button]]></category>

		<category><![CDATA[control]]></category>

		<category><![CDATA[enter]]></category>

		<category><![CDATA[key]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=65</guid>
		<description><![CDATA[Until recently, I had always used javascript to allow the enter key to submit a form (as seen in a previous posting called Submit Form On Enter Key Solution). Since then, I was queued into a GUImethod of controlling enter key form submissions in Visual Studio 2008 (and I&#8217;m sure this works in other versions [...]]]></description>
			<content:encoded><![CDATA[<p>Until recently, I had always used javascript to allow the enter key to submit a form (as seen in a previous posting called <a title="Submit Form On Enter Key Solution" href="http://www.victorchen.info/submit-form-on-enter-key-solution/">Submit Form On Enter Key Solution</a>). Since then, I was queued into a GUImethod of controlling enter key form submissions in Visual Studio 2008 (and I&#8217;m sure this works in other versions as well).</p>
<p><a href="http://www.victorchen.info/wp-content/uploads/2008/07/formdefaultbutton.png"><img class="alignleft size-medium wp-image-66" style="margin-right:5px;" title="Form Default Button - VS2008" src="http://www.victorchen.info/wp-content/uploads/2008/07/formdefaultbutton.png" alt="How to submit a form in Visual Studio 2008" width="206" height="190" /></a>To do this in the GUI style, click on the form of the page and then select the elements properties. Under the ASP.NET subheading, there is a form property called DefaultButton. Insert the button control id of the default button. This will essentially submit the form on enter (by performing the action on the specified button). The image to the left is an example of the form property section with a default button set to btnSetCookie. Note that for one reason or another, intellisense is not enabled on this property and you will have to manually type in the button control id.</p>
<p>Of course, you are not constrained to doing this in the GUI style. To submit a form on enter programmatically, simply find the form and insert the keyword defaultbutton=&#8221;BUTTON_CONTROL_ID_HERE&#8221;. Below is an example of how the above example would look programmatically.</p>
<blockquote><p><code>&lt;form id="frmTestForm" runat="server" defaultbutton="btnSetCookie"&gt;</code></p></blockquote>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6659317563060472";
/* 468x60, created 3/9/08 */
google_ad_slot = "3009013771";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/form-submit-on-enter-in-visual-studio-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Easily Get Query String Variables</title>
		<link>http://www.victorchen.info/php-easily-get-query-string-variables/</link>
		<comments>http://www.victorchen.info/php-easily-get-query-string-variables/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 14:35:22 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[common function]]></category>

		<category><![CDATA[get]]></category>

		<category><![CDATA[getUrlStringValue]]></category>

		<category><![CDATA[query]]></category>

		<category><![CDATA[query string]]></category>

		<category><![CDATA[string]]></category>

		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=62</guid>
		<description><![CDATA[One of my favorite and most heavily used PHP common functions retrieves variables from the query string. I found that without this function, I was inefficiently checking if the variable existed, and if not, I was then was manually setting a default value. The function takes in two string variables that handle the above problem. [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite and most heavily used PHP common functions retrieves variables from the query string. I found that without this function, I was inefficiently checking if the variable existed, and if not, I was then was manually setting a default value. The function takes in two string variables that handle the above problem. <code>$urlStringName</code> is the name of the variable as stated in the query string and <code>$returnIfNotSet</code> is the string that will be returned if the <code>$urlStringName</code> is not found. Check out the code snippet below:</p>
<blockquote>
<pre>function getUrlStringValue($urlStringName, $returnIfNotSet) {
  if(isset($_GET[$urlStringName]) &#038;&#038; $_GET[$urlStringName] != &#8220;&#8221;)
    return $_GET[$urlStringName];
  else
    return $returnIfNotSet;
}</pre>
</blockquote>
<p>Let&#8217;s run through an example of how this function works. Assume we have the following url:</p>
<blockquote>
<pre>http://www.victorchen.info/index.php?<span style="color: #ff6600;">firstName</span>=Victor&amp;<span style="color: #3366ff;">lastName</span>=Chen</pre>
</blockquote>
<p>If I am looking to find the string value of the first and last name, but return john or doe if the query variable <span style="color: #ff6600;">firstName </span>or <span style="color: #3366ff;">lastName </span>is not found, respectively. I would write the following:</p>
<blockquote>
<pre>$firstName = getUrlStringValue("<span style="color: #ff6600;">firstName</span>&#8220;, &#8220;john&#8221;);
$lastName = getUrlStringValue(&#8221;<span style="color: #3366ff;">lastName</span>&#8220;, &#8220;doe&#8221;);</pre>
</blockquote>
<p>In this example, we would expect to store <code>$firstName</code> to be &#8220;Victor&#8221; and <code>$lastName</code> to be &#8220;Chen&#8221;.</p>
<p>However, if the url arrives as (missing the <span style="color: #3366ff;">lastName </span>query string variable):</p>
<blockquote>
<pre>http://www.victorchen.info/index.php?<span style="color: #ff6600;">firstName</span>=Victor</pre>
</blockquote>
<p>We can expect to see <code>$firstName</code> as &#8220;Victor&#8221; and <code>$lastName</code> as &#8220;Doe&#8221;.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-6659317563060472";
/* 468x60, created 3/9/08 */
google_ad_slot = "3009013771";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/php-easily-get-query-string-variables/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CS0433: The type exists in both [dll1] and [dll2]</title>
		<link>http://www.victorchen.info/the-type-exists-in-both-dll1-and-dll2/</link>
		<comments>http://www.victorchen.info/the-type-exists-in-both-dll1-and-dll2/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 15:02:48 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[Visual Studio]]></category>

		<category><![CDATA[3rd party]]></category>

		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[bin]]></category>

		<category><![CDATA[dll]]></category>

		<category><![CDATA[exists]]></category>

		<category><![CDATA[folder]]></category>

		<category><![CDATA[temporary]]></category>

		<category><![CDATA[The type exists in both]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=61</guid>
		<description><![CDATA[While migrating an old application from Visual Studio 2003 to Visual Studio 2008, I came across what seemed to be a dll mismatch error. I had to remove the original dll from the references because of conflicts with the new 3.5 framework to a new version of the dll as found in the 3rd party [...]]]></description>
			<content:encoded><![CDATA[<p>While migrating an old application from Visual Studio 2003 to Visual Studio 2008, I came across what seemed to be a dll mismatch error. I had to remove the original dll from the references because of conflicts with the new 3.5 framework to a new version of the dll as found in the 3rd party clients default installation location (somewhere in C:\Program Files). After this change, visits to a page that utilizes the 3rd party dll would crash with this error (where dll1 was the temporary location of the original dll and dll2 was the temporary location of the new dll):</p>
<blockquote><p>CS0433: The type exists in both [dll1] and [dll2]</p></blockquote>
<p>The old dll temporary location was at C:\Windows\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files and the new dll temporary location was at C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. Note that these locations will vary depending on the Microsoft.NET framework version you are using.</p>
<p>My first thought was that the temporary location somehow got out of sync, so I decided to rebuild the solution, but this was unsuccessful. My next idea was the delete both temporary folders, but had problems because the folders were locked. <span style="color: #ff0000;">The last thing I tried was to manually add a copy of the dll to the Solution&#8217;s bin folder and reference that specific copy.</span> This fixed the problem!<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/the-type-exists-in-both-dll1-and-dll2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Export DataTable to CSV File Download in C#</title>
		<link>http://www.victorchen.info/export-datatable-to-csv-file-download-in-c/</link>
		<comments>http://www.victorchen.info/export-datatable-to-csv-file-download-in-c/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 14:36:10 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<category><![CDATA[csv]]></category>

		<category><![CDATA[datagrid]]></category>

		<category><![CDATA[datasource]]></category>

		<category><![CDATA[datatable]]></category>

		<category><![CDATA[download]]></category>

		<category><![CDATA[export]]></category>

		<category><![CDATA[file]]></category>

		<category><![CDATA[gridview]]></category>

		<category><![CDATA[postback]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=55</guid>
		<description><![CDATA[In C#, a common function in web pages containing data in a table is allowing the web user to export to excel. Through my experiences, I have uncovered that to export from a GridView (or DataGrid) to a Microsoft Excel (xls) file is messy and not easily customizable. Instead, I found that taking the underlying [...]]]></description>
			<content:encoded><![CDATA[<p>In C#, a common function in web pages containing data in a table is allowing the web user to export to excel. Through my experiences, I have uncovered that to export from a GridView (or DataGrid) to a Microsoft Excel (xls) file is messy and not easily customizable. Instead, I found that taking the underlying DataTable and instead exporting to a Microsoft Excel Comma Separated Value (CSV) file as a much better method. Below is the snippet of code for the function.</p>
<blockquote><p>private void <span style="color: #ff0000;">exportDataTableToCsv</span>(DataTable <span style="color: #3366ff;">formattedDataTable</span>, string filename)<br />
{<br />
DataTable toExcel = formattedDataTable.Copy();<br />
HttpContext context = HttpContext.Current;<br />
context.Response.Clear();</p>
<p>foreach (DataColumn column in toExcel.Columns)<br />
{<br />
context.Response.Write(column.ColumnName + &#8220;,&#8221;);<br />
}<br />
context.Response.Write(Environment.NewLine);<br />
foreach (DataRow row in toExcel.Rows)<br />
{<br />
for (int i = 0; i &lt; toExcel.Columns.Count; i++)<br />
{<br />
context.Response.Write(row[i].ToString().Replace(&#8221;,&#8221;, string.Empty) + &#8220;,&#8221;);<br />
}<br />
context.Response.Write(Environment.NewLine);<br />
}</p>
<p>context.Response.ContentType = &#8220;text/csv&#8221;;<br />
context.Response.AppendHeader(&#8221;Content-Disposition&#8221;, &#8220;attachment; filename=&#8221; + filename + &#8220;.csv&#8221;);<br />
context.Response.End();<br />
}</p></blockquote>
<p>To call this function, simple create a C# LinkButton or Button Web Control. In your aspx page, your control should look similar to:</p>
<blockquote><p>&lt;asp:LinkButton ID=&#8221;<span style="color: #339966;">lbToExcel</span>&#8221; runat=&#8221;server&#8221;&gt;Export To Excel&lt;/asp:LinkButton&gt;</p></blockquote>
<p>From here, the lbToExcel_Click function will call the Export to DataTable function <span style="color: #ff0000;">exportDataTableToCsv</span> defined earlier in this post. I would also advise making edits at this point to your DataTable by removing columns that were hidden in the GridView (or DataGrid). We want to pass a <span style="color: #3366ff;">formattedDataTable</span>.</p>
<p>If your page uses Ajax&#8217;s Update Panel controls, it is required to set the lbToExcel web control as a PostBackTrigger as opposed to an AsyncPostBackTrigger. To add a PostBackTrigger in Visual Studio 2008&#8217;s Ajax Update Panel, find the properties of the Update Panel. Under Behavior, find Triggers and choose to edit the Collection. Next, Click Add and from the Dropdown select PostBackTrigger. Next, you need to manually (without the aid of intellisense) type in the control name. In our case, the control name was lbToExcel. The result should be the code snippet example below:</p>
<blockquote><p>&lt;asp:UpdatePanel ID=&#8221;UpdatePanel1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;ContentTemplate&gt;<br />
&lt;asp:LinkButton ID=&#8221;<span style="color: #339966;">lbToExcel</span>&#8221; runat=&#8221;server&#8221;&gt;Export To Excel&lt;/asp:LinkButton&gt;<br />
&lt;/ContentTemplate&gt;<br />
&lt;Triggers&gt;<br />
&lt;asp:PostBackTrigger ControlID=&#8221;<span style="color: #339966;">lbToExcel</span>&#8220;&gt;<br />
&lt;/asp:PostBackTrigger&gt;<br />
&lt;/Triggers&gt;<br />
&lt;/asp:UpdatePanel&gt;</p></blockquote>
<p>Overall, this has worked flawlessly for me. If you have any problems, feel free to drop a line describing your challenges and I can attempt to give you a hand!</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/export-datatable-to-csv-file-download-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Switch Statement in C#</title>
		<link>http://www.victorchen.info/switch-statement-in-c/</link>
		<comments>http://www.victorchen.info/switch-statement-in-c/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 14:29:53 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[case]]></category>

		<category><![CDATA[enum]]></category>

		<category><![CDATA[if statement]]></category>

		<category><![CDATA[int]]></category>

		<category><![CDATA[integer]]></category>

		<category><![CDATA[string]]></category>

		<category><![CDATA[switch]]></category>

		<category><![CDATA[switch statement]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=60</guid>
		<description><![CDATA[When possible, a programmer should choose to use a switch statement over an if statement. Note that it is not always possible to replace an if statement with a switch statement. The right time to use a switch statement is when the if statement is constantly comparing the same variable. In our example, we are [...]]]></description>
			<content:encoded><![CDATA[<p>When possible, a programmer should choose to use a switch statement over an if statement. Note that it is not always possible to replace an if statement with a switch statement. The right time to use a switch statement is when the if statement is constantly comparing the same variable. In our example, we are constantly comparing the text in the Label control lblDayOfWeek. To make it easy, I have made blue the string text that will be used in our comparison.</p>
<blockquote><p>switch (<span style="color: #0000ff;">lblDayOfWeek.Text</span>)<br />
{<br />
case <span style="color: #0000ff;">&#8220;1&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Sunday&#8221;;<br />
break;<br />
case <span style="color: #0000ff;">&#8220;2&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Monday&#8221;;<br />
break;<br />
case <span style="color: #0000ff;">&#8220;3&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Tuesday&#8221;;<br />
break;<br />
case <span style="color: #0000ff;">&#8220;4&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Wednesday&#8221;;<br />
break;<br />
case <span style="color: #0000ff;">&#8220;5&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Thursday&#8221;;<br />
break;<br />
case <span style="color: #0000ff;">&#8220;6&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Friday&#8221;;<br />
break;<br />
case <span style="color: #0000ff;">&#8220;7&#8243;</span>:<br />
lblDayOfWeek.Text = &#8220;Saturday&#8221;;<br />
break;<br />
default:<br />
lblDayOfWeek.Text = &#8220;&#8221;;<br />
break;<br />
}</p></blockquote>
<p>The final default is equivalent to else, which means if none of the cases match, the default route will be taken. The greatest advantage to using the switch statement is efficiency. When a swtich statement is called, only one comparison is made.</p>
<p>Note that the switch statement is not restricted to string or integer. It is also possible to use enum or virtually any other comparable variable.<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/switch-statement-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>C# Error Message: &#8220;Inconsistent Accessibility&#8221;</title>
		<link>http://www.victorchen.info/c-error-message-inconsistent-accessibility/</link>
		<comments>http://www.victorchen.info/c-error-message-inconsistent-accessibility/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 16:20:24 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[accessibility]]></category>

		<category><![CDATA[error]]></category>

		<category><![CDATA[inconsistent]]></category>

		<category><![CDATA[message]]></category>

		<category><![CDATA[properties]]></category>

		<category><![CDATA[property]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=59</guid>
		<description><![CDATA[While working in C#, I got this error that was at first a bit difficult to decipher. I removed some of the actual variable terminology, but the overall error message is below.
Inconsistent accessibility: property type is less accessible than property
All this error message really means is that there is a public method that is illegally [...]]]></description>
			<content:encoded><![CDATA[<p>While working in C#, I got this error that was at first a bit difficult to decipher. I removed some of the actual variable terminology, but the overall error message is below.</p>
<blockquote><p>Inconsistent accessibility: property type is less accessible than property</p></blockquote>
<p>All this error message really means is that there is a public method that is illegally exposing a private property. Therefore, an easy fix (but not necessary the right one), is to change private property to public. I say this may not be the right approach because this may leave a security hole in your page and may not be how the page was originally designed.<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/c-error-message-inconsistent-accessibility/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Add Rows to a DataTable in C#</title>
		<link>http://www.victorchen.info/add-rows-to-a-datatable-in-c/</link>
		<comments>http://www.victorchen.info/add-rows-to-a-datatable-in-c/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 20:20:52 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[datarow]]></category>

		<category><![CDATA[datatable]]></category>

		<category><![CDATA[newrow()]]></category>

		<category><![CDATA[row]]></category>

		<category><![CDATA[Rows.Add()]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=49</guid>
		<description><![CDATA[When using a DataTable as a DataSource to a GridView in C#, it is often necessary to add additional rows, whether they be blank rows or fully populated rows, to the control. It has been my experience that it is much easier to add a DataRow into the DataTable prior to a DataBind.
The first step [...]]]></description>
			<content:encoded><![CDATA[<p>When using a DataTable as a DataSource to a GridView in C#, it is often necessary to add additional rows, whether they be blank rows or fully populated rows, to the control. It has been my experience that it is much easier to add a DataRow into the DataTable prior to a DataBind.</p>
<p>The first step is to create an empty datatable. It would be perfectly legal to start with a datatable prepopulated with data. In this case, we are naming the Datatable, <span style="color: #ff0000;">dt</span>.</p>
<blockquote><p>DataTable <span style="color: #ff0000;">dt </span>= new DataTable();</p></blockquote>
<p>The next step is to create a new DataRow object. In this case, we are calling it &#8220;newRow&#8221;. The next step would be to initialize the DataRow object, which is the second line below:</p>
<blockquote><p>DataRow <span style="color: #0000ff;">myNewRow</span>;<br />
<span style="color: #0000ff;">myNewRow </span>= <span style="color: #ff0000;">dt</span>.NewRow();</p></blockquote>
<p>Now that the DataRow has been created and initialized, simply add values to the object as you would an array. In the two examples below, we are adding values to two different columns in our row. We are first assigning the column with name customerId the integer value of 1. Secondly, we are assigning the column with name username a string johndoe. Repeat as needed.</p>
<blockquote><p><span style="color: #0000ff;">myNewRow</span>["<span style="color: #008080;">customerId</span>"] = 1;<br />
<span style="color: #0000ff;">myNewRow</span>["<span style="color: #008080;">username</span>"] = &#8220;johndoe&#8221; ;</p></blockquote>
<p>Finally, we want to add this newly created row (with two columns) to the originally blank datatable we created in the beginning.</p>
<blockquote><p><span style="color: #ff0000;">dt</span>.Rows.Add(<span style="color: #0000ff;">myNewRow</span>);</p></blockquote>
<p>All the steps from above are put together in the example below:</p>
<blockquote><p>DataTable <span style="color: #ff0000;">dt </span>= new DataTable();<br />
DataRow <span style="color: #0000ff;">myNewRow</span>;<br />
<span style="color: #0000ff;">myNewRow</span> = <span style="color: #ff0000;">dt</span>.NewRow();<br />
<span style="color: #0000ff;">myNewRow</span>["<span style="color: #008080;">customerId</span>"] = 1;<br />
<span style="color: #0000ff;">myNewRow</span>["<span style="color: #008080;">username</span>"] = &#8220;johndoe&#8221; ;<br />
<span style="color: #ff0000;">dt</span>.Rows.Add(<span style="color: #0000ff;">myNewRow</span>);</p></blockquote>
<p>With that you can now set this datatable as a DataSource and DataBind a GridView or any other similar C# control.</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/add-rows-to-a-datatable-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Get Value from Session Variable in C#</title>
		<link>http://www.victorchen.info/get-value-from-session-variable-in-c/</link>
		<comments>http://www.victorchen.info/get-value-from-session-variable-in-c/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 14:05:33 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[request]]></category>

		<category><![CDATA[server]]></category>

		<category><![CDATA[servervariables]]></category>

		<category><![CDATA[session]]></category>

		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=54</guid>
		<description><![CDATA[It&#8217;s common practice to store certain values in session variables to allow for easy access of data between page loads. This is known as a Server Variable in C#. Assume a server variable name of &#8220;foo&#8220;. It would be accessed as:
string myValue = Request.ServerVariables.Get(&#8221;foo&#8220;);
If you get the following error message: The name &#8220;Request&#8221; does not [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s common practice to store certain values in session variables to allow for easy access of data between page loads. This is known as a Server Variable in C#. Assume a server variable name of &#8220;<span style="color: #0000ff;">foo</span>&#8220;. It would be accessed as:</p>
<blockquote><p>string myValue = Request.ServerVariables.Get(&#8221;<span style="color: #0000ff;">foo</span>&#8220;);</p></blockquote>
<p>If you get the following error message: <em>The name &#8220;Request&#8221; does not exist in the current context</em>, try the following:</p>
<blockquote><p>string myValue = <span style="color: #ff0000;">System.Web.HttpContext.Current.</span>Request.ServerVariables.Get(&#8221;<span style="color: #0000ff;">foo</span>&#8220;);</p></blockquote>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/get-value-from-session-variable-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install Package Updates from the Linux Shell</title>
		<link>http://www.victorchen.info/install-package-updates-from-the-linux-shell/</link>
		<comments>http://www.victorchen.info/install-package-updates-from-the-linux-shell/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 15:24:41 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[centos4]]></category>

		<category><![CDATA[RHEL]]></category>

		<category><![CDATA[rhel4]]></category>

		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/?p=52</guid>
		<description><![CDATA[Installing updates from the Linux Shell is very simple in CentOS 4 and RHEL4 (with a valid subscription). Below are two of the most commonly used methods.
The first method can be dangerous, is easier because it is a non-interactive installation. It automatically assumes yes to all prompts.
yum -y update
The second method is safer and is [...]]]></description>
			<content:encoded><![CDATA[<p>Installing updates from the Linux Shell is very simple in CentOS 4 and RHEL4 (with a valid subscription). Below are two of the most commonly used methods.</p>
<p>The first method can be dangerous, is easier because it is a non-interactive installation. It automatically assumes yes to all prompts.</p>
<blockquote><p>yum -y update</p></blockquote>
<p>The second method is safer and is exactly the same as the first method, except it will prompt you at specified parts of the installation process.</p>
<blockquote><p>yum update</p></blockquote>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/install-package-updates-from-the-linux-shell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install And Configure RLogin on CentOS 4</title>
		<link>http://www.victorchen.info/install-and-configure-rlogin-on-centos-4/</link>
		<comments>http://www.victorchen.info/install-and-configure-rlogin-on-centos-4/#comments</comments>
		<pubDate>Fri, 30 May 2008 14:00:29 +0000</pubDate>
		<dc:creator>Victor Chen</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[centos4]]></category>

		<category><![CDATA[configure]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[restart]]></category>

		<category><![CDATA[rexec]]></category>

		<category><![CDATA[RHEL]]></category>

		<category><![CDATA[rhel4]]></category>

		<category><![CDATA[rlogin]]></category>

		<category><![CDATA[rsh]]></category>

		<category><![CDATA[rsh-server]]></category>

		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://www.victorchen.info/install-and-configure-rlogin-on-centos-4/</guid>
		<description><![CDATA[ The below instructions for installing rlogin have been confirmed for CentOS. This means there is a very high probability it is compatible with a registered copy of Red Hat Enterprise Linux 4 (rhel4).
ENSURE RSH PACKAGES INSTALLED
The first step is to insure you have the correct packages installed. To do this, simply type the following [...]]]></description>
			<content:encoded><![CDATA[<p> The below instructions for installing rlogin have been confirmed for CentOS. This means there is a very high probability it is compatible with a registered copy of Red Hat Enterprise Linux 4 (rhel4).</p>
<p><u><strong>ENSURE RSH PACKAGES INSTALLED</strong></u></p>
<p>The first step is to insure you have the correct packages installed. To do this, simply type the following in the terminal.</p>
<blockquote><p>rpm -qa | grep -i rsh</p></blockquote>
<p>The following should return two packages similar to:</p>
<blockquote><p>rsh-server-0.17-25.3<br />
rsh-0.17-25.3</p></blockquote>
<p>If you are missing any of the above packages, run the code below to have the appropriate two rsh packages installed using yum.</p>
<blockquote><p> yum install rsh*</p></blockquote>
<p><u><strong>EDIT FILE: /etc/xinetd.d/rsh</strong></u><br />
The most common changes are in <font color="#ff0000">red</font>, though you should still confirm the rest of the file.</p>
<blockquote><p> # default: off<br />
# description:<br />
# The rshd server is a server for the rcmd(3) routine and,<br />
# consequently, for the rsh(1) program. The server provides<br />
# remote execution facilities with authentication based on<br />
# privileged port numbers from trusted hosts.<br />
service shell<br />
{<br />
socket_type             = stream<br />
wait                    = no<br />
user                    = root<br />
log_on_success          += USERID<br />
log_on_failure          += USERID<br />
server                  = /usr/sbin/in.rshd<br />
disable                 = <font color="#ff0000">no</font><br />
}</p></blockquote>
<p><u><strong>EDIT FILE: /etc/xinetd.d/rlogin</strong></u><br />
The most common changes are in <font color="#ff0000">red</font>, though you should still confirm the rest of the file.</p>
<blockquote><p> # default: off<br />
# description:<br />
# Rlogind is a server for the rlogin program. The server provides remote<br />
# execution with authentication based on privileged port numbers from trusted<br />
# host<br />
service login<br />
{<br />
socket_type             = stream<br />
wait                    = no<br />
user                    = root<br />
log_on_success          += USERID<br />
log_on_failure          += USERID<br />
server                  = /usr/sbin/in.rlogind<br />
disable                 = <font color="#ff0000">no</font><br />
}</p></blockquote>
<p><u><strong>EDIT FILE: /etc/xineted.d/rexec</strong></u><br />
The most common changes are in <font color="#ff0000">red</font>, though you should still confirm the rest of the file.</p>
<blockquote><p> # default: off<br />
# description:<br />
# Rexecd is the server for the rexec program. The server provides remote<br />
# execution facilities with authentication based on user names and<br />
# passwords.<br />
service exec<br />
{<br />
socket_type             = stream<br />
wait                    = no<br />
user                    = root<br />
log_on_success          += USERID<br />
log_on_failure          += USERID<br />
server                  = /usr/sbin/in.rexecd<br />
disable                 = <font color="#ff0000">no</font><br />
}</p></blockquote>
<p><u><strong>EDIT FILE: /etc/securetty</strong></u><br />
The most common changes are in <font color="#ff0000">red</font>, though you should still confirm the rest of the file.</p>
<blockquote><p> console<br />
vc/1<br />
vc/2<br />
vc/3<br />
vc/4<br />
vc/5<br />
vc/6<br />
vc/7<br />
vc/8<br />
vc/9<br />
vc/10<br />
vc/11<br />
ttyS0<br />
tty1<br />
tty2<br />
tty3<br />
tty4<br />
tty5<br />
tty6<br />
tty7<br />
tty8<br />
tty9<br />
tty10<br />
tty11<br />
pts/0<br />
pts/1<br />
pts/2<br />
pts/3<br />
pts/4<br />
pts/5<br />
pts/6<br />
pts/7<br />
pts/8<br />
pts/9<br />
<font color="#ff0000"> rsh<br />
rlogin<br />
rexec</font></p></blockquote>
<p><u><strong>RESTART THE RSH-SERVER SERVICE</strong></u><br />
To restart, one of the the following two commands below. One restarts the service while the other starts again.</p>
<blockquote><p> /etc/init.d/xinetd start<br />
/etc/init.d/xinetd restart</p></blockquote>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.victorchen.info/install-and-configure-rlogin-on-centos-4/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.707 seconds -->
