<?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>Jigsaw Boys &#187; ASP.NET</title>
	<atom:link href="http://www.jigsawboys.com/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jigsawboys.com</link>
	<description>Security, Network and Computer Tech Tip Database!</description>
	<lastBuildDate>Wed, 17 Aug 2011 22:59:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SubSonic 3.0 ActiveRecord Tutorial</title>
		<link>http://www.jigsawboys.com/2009/11/25/subsonic-3-0-activerecord-examples/</link>
		<comments>http://www.jigsawboys.com/2009/11/25/subsonic-3-0-activerecord-examples/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 07:42:58 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[subsonic]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=275</guid>
		<description><![CDATA[I wanted to demonstrate the complete and utter power of SubSonic Activerecord&#8217;s toolset. Pretty much, its an easy to use querying engine which automatically creates objects that you can use within your ASP.NET project. You can use LINQ querying if you like, or you can use the SubSonic preferred way as demonstrated below; Want to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I wanted to demonstrate the complete and utter power of SubSonic Activerecord&#8217;s toolset. Pretty much, its an easy to use querying engine which automatically creates objects that you can use within your ASP.NET project. You can use LINQ querying if you like, or you can use the SubSonic preferred way as demonstrated below;</p>
<p><strong>Want to bind a gridview?</strong></p>
<pre class="brush: csharp; title: ; notranslate">
var categories = category.All();
gvList.DataSource = categories;
gvList.DataBind();
</pre>
<p>Boom. Done.</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;pre lang=&quot;csharp&quot; line=&quot;1&quot;&gt;
int iLineID = 1;
category delCat = category.SingleOrDefault(x =&gt; x.id == iLineID);
delCat.Delete();
</pre>
<p>Too easy right?</p>
<p><strong>What about adding a new record?</strong></p>
<pre class="brush: csharp; title: ; notranslate">
category newCat = new category();
newCat.name = &quot;Dummy category name&quot;;
newCat.Add();
</pre>
<p>How easy is that? Go <a href="http://subsonicproject.com/download">grab SubSonic now</a>!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2009/11/25/subsonic-3-0-activerecord-examples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET &amp; AlternatingRowStyle &amp; IE8</title>
		<link>http://www.jigsawboys.com/2009/09/17/asp-net-alternatingrowstyle-ie8/</link>
		<comments>http://www.jigsawboys.com/2009/09/17/asp-net-alternatingrowstyle-ie8/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 04:17:36 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IE8]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=252</guid>
		<description><![CDATA[If you&#8217;re a ASP.NET developer like myself, you may or may not have noticed a few changes to your sites when viewed in Internet Explorer 8. As an example I had a gridview which had a different background for alternating rows. And my CSS was something like The Solution The easy (and maybe a little [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a ASP.NET developer like myself, you may or may not have noticed a few changes to your sites when viewed in Internet Explorer 8.</p>
<p>As an example I had a gridview which had a different background for alternating rows.</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;AlternatingRowStyle CssClass=&quot;odd&quot; /&gt;&lt;/code&gt;
</pre>
<p>And my CSS was something like</p>
<pre class="brush: csharp; title: ; notranslate">
.odd { background-image: url(../graphics/tealbg.gif); }
</pre>
<h2>The Solution</h2>
<p>The easy (and maybe a little messy) way to solve this is to force the page to use IE7 compatibility. You can do this by adding the following to your <head> tag.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=7&quot; /&gt;
</pre>
<p><b>Note:</b> The above meta tag MUST appear before any link tags (stylesheet includes for example)</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2009/09/17/asp-net-alternatingrowstyle-ie8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NETs Forms Based Authentication</title>
		<link>http://www.jigsawboys.com/2008/10/31/aspnets-forms-based-authentication/</link>
		<comments>http://www.jigsawboys.com/2008/10/31/aspnets-forms-based-authentication/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 08:23:06 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=185</guid>
		<description><![CDATA[Websites that offer membership based services often require their important files to be secured from non-members. For this purpose, they need to implement form based authentication that ensures that only members can access the files and even if a non-member copies the exact location of the file on the server, he/she is denied access to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Websites that offer membership based services often require their important files to be secured from non-members. For this purpose, they need to implement form based authentication that ensures that only members can access the files and even if a non-member copies the exact location of the file on the server, he/she is denied access to the file and redirected back to the login page. Let’s check it out.</p>
<p>1. If you are using an IDE then you need to create a new project and add a LoginPage.aspx page. Switch to html view and add the following code inside the tag of you LoginPage.aspx page.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;h2&gt; &lt;font face=&quot;Times New Roman&quot;&gt;Login Credentials&lt;/font&gt; &lt;/h2&gt;
&lt;table&gt; &lt;tr&gt;
&lt;td&gt;User Name :&lt;/td&gt;
&lt;td&gt;&lt;input id=&quot;CUserName&quot; type=&quot;text&quot; runat=&quot;server&quot; NAME=&quot;CUserName&quot;&gt;&lt;/td&gt;
&lt;td&gt;&lt;ASP:RequiredFieldValidator ControlToValidate=&quot;CUserName&quot; Display=&quot;Static&quot; ErrorMessage=&quot;*&quot; runat=&quot;server&quot; ID=&quot;VUserName&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password:&lt;/td&gt;
&lt;td&gt;&lt;input id=&quot;CUserPass&quot; type=&quot;password&quot; runat=&quot;server&quot; NAME=&quot;CUserPass&quot;&gt;&lt;/td&gt;
&lt;td&gt;&lt;ASP:RequiredFieldValidator ControlToValidate=&quot;CUserPass&quot; Display=&quot;Static&quot; ErrorMessage=&quot;*&quot; runat=&quot;server&quot; ID=&quot;VUserPass&quot; /&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;
&lt;input type=&quot;submit&quot; Value=&quot;Login&quot; runat=&quot;server&quot; ID=&quot;cmdLogin&quot; NAME=&quot;cmdLogin&quot;&gt;
&lt;/p&gt;
&lt;asp:Label id=&quot;lblMsg&quot; ForeColor=&quot;red&quot; FontName=&quot;Times New Roman&quot; FontSize=&quot;12&quot; runat=&quot;server&quot;/&gt;
</pre>
<p>2. Now, change the authentication in your web.config file to and modify the authentication parameters as given below:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;authorization&gt;
&lt;allow users=&quot;*&quot; /&gt;
&lt;deny users=&quot;?&quot; /&gt;
&lt;/authorization&gt;
</pre>
<p>3. Now, browse the virtual directory in Internet Information Services (IIS), right click on it to access the properties. Move to security tab &#038; click on edit to check Anonymous access option.</p>
<p>4. On your IDE change the view mode to code view for the LoginPage.aspx page and add the following code to it. Refer to Point 4 of Code Event Handler at http://support.microsoft.com/kb/308157</p>
<p><strong>Provide your own coding for authenticating the username &#038; password</strong></p>
<pre class="brush: vb; title: ; notranslate">
if CUserName.Value = &quot;AAAAAAA&quot; and CUserPass.Value = &quot;BBBBBBBB&quot; Then
FormsAuthentication.RedirectFromLoginPage(CUserName.Value , True)
else
Response.Redirect(&quot;LoginPage.aspx&quot; , True)
End if
End Sub
</pre>
<p>5. Create a new page and name it as DefaultPage.aspx and add the following to the html view of the page.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;&lt;-td&gt;http://ServerName/FormsAuth/SecuredFolder/AnyFile.doc&lt;/td&gt;
&lt;td&gt;&lt;-asp:Button id=&quot;SendFile&quot; runat=&quot;server&quot; Text=&quot;Send File&quot;&gt;&lt;/asp:Button&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</pre>
<p>Now, switch to code view for this page &#038; add the following lines</p>
<pre class="brush: vb; title: ; notranslate">
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click FormsAuthentication.SignOut()
Response.Redirect(&quot;LoginPage.aspx&quot; , True)
End Sub
Private Sub SendFile_Click( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles SendFile.Click
Response.ContentType = &quot;application/msword&quot;
Response.Clear()
Response.TransmitFile(&quot;SecuredFolderAnyFile.doc&quot;) ‘Create a SecuredFolder in Virtual Directory &amp; add “AnyFile.doc” to it
Response.End()
End Sub
</pre>
<p>Why I used a button instead of a hyperlink is because in case of hyperlink the file will be cached and even if you change the contents of the file, the old file will be displayed. A button will prevent this.</p>
<p>6. Protect the SecuredFolder and ensure that you have granted the READ permission to the Network service or ASPNET. Run your project and try what happens when you try to paste the url of the file and then access it. You will notice a Login page instead of the file.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2008/10/31/aspnets-forms-based-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The GridView fired event PageIndexChanging which wasn&#8217;t handled</title>
		<link>http://www.jigsawboys.com/2008/10/22/the-gridview-fired-event-pageindexchanging-which-wasnt-handled/</link>
		<comments>http://www.jigsawboys.com/2008/10/22/the-gridview-fired-event-pageindexchanging-which-wasnt-handled/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 23:49:41 +0000</pubDate>
		<dc:creator>Jamsi</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[gridview]]></category>

		<guid isPermaLink="false">http://www.jigsawboys.com/?p=179</guid>
		<description><![CDATA[If you've set a gridviews AllowPaging attribute to "true", you'll notice the following error;
The GridView fired event PageIndexChanging which wasn't handled


No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve set a gridviews AllowPaging attribute to &#8220;true&#8221;, you&#8217;ll notice the following error;</p>
<blockquote><p>The GridView fired event PageIndexChanging which wasn&#8217;t handled</p></blockquote>
<p>To setup paging with Gridviews, you also need to set the page index property to the new page that you wish to view. Funny enough, this is extremely easy to do. See below for a code example written in C#.</p>
<p>The ASPX page</p>
<pre class="brush: plain; title: ; notranslate">
&lt;asp:GridView ID=&quot;gvList&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;true&quot; AllowPaging=&quot;true&quot; PageSize=&quot;10&quot; OnPageIndexChanging=&quot;gvList_PageIndexChanging&quot;&gt;
</pre>
<p>and the C# code</p>
<pre class="brush: csharp; title: ; notranslate">
    protected void gvList_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        bindGrid();

        gvList.PageIndex = e.NewPageIndex;
        gvList.DataBind();
    }
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jigsawboys.com/2008/10/22/the-gridview-fired-event-pageindexchanging-which-wasnt-handled/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

