<?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>SnapJag Creative Designs &#187; ASP.NET</title>
	<atom:link href="http://www.snapjag.com/category/programming/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snapjag.com</link>
	<description>Specialists in busines consulting, database administration, programming, hosting, photography, and creative system designs.</description>
	<lastBuildDate>Fri, 25 Nov 2011 00:59:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Using properties in an ASP.net Web Control</title>
		<link>http://www.snapjag.com/2009/04/using-properties-in-an-aspnet-web-control/</link>
		<comments>http://www.snapjag.com/2009/04/using-properties-in-an-aspnet-web-control/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 20:28:04 +0000</pubDate>
		<dc:creator>snapjag</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Web Control]]></category>

		<guid isPermaLink="false">http://www.snapjag.com/?p=465</guid>
		<description><![CDATA[When creating a web control in an ASP.net application many times you will need to make references to information, data values and other contents of the web control from the web control parent. This is done by adding a Property statement on the control. It could be as simple as a Username and Password control [...]]]></description>
			<content:encoded><![CDATA[<p>When creating a web control in an ASP.net application many times you will need to make references to information, data values and other contents of the web control from the web control parent. This is done by adding a Property statement on the control. It could be as simple as a Username and Password control to set or get the information at times of requesting login details.</p>
<p>Follow these steps to connect and use data on the User Web Control:</p>
<ol>
<li>Create a new Web Control in your application project</li>
<li>Place two label and two textboxes on the control</li>
<li>Name the two controls txtUsername and txtAddress</li>
<li>In the code behind of the control add the following code (C#)private string username = String.Empty;<br />
private string password; = String.Empty;</li>
<p>public string Username {<br />
get { return username; }<br />
set { set username = value; }<br />
}</p>
<p>public string Password{<br />
get { return password; }<br />
set { set password; = value; }<br />
}</p>
<li>Close the control designer windows, saving all changes</li>
<li>Open the web page that will use the control</li>
<li>Drag and drop the new web control onto the web page canvas (if you already had the web control on your webpage and you added new interface elements (public functions or properties), you will likely need to remove the controls including the REGISTER statements at the top of the page so that the interface elements are reconnected to the page for you.</li>
<li>In the code behind the web page, make any references to the Tag name of the control (assuming &#8220;uc1&#8243; in this case) using the following statements (C#).this.uc1.Username = &#8220;Your username&#8221;;<br />
this.uc1.Password{ = &#8220;Your password&#8221;;</li>
</ol>
<p>This concludes the tutorial to add a simple web control and connect to it from the parent web page where it resides. This concept will help in many ways like, login pages, bread crumbs, contained lists, or other user interface lists.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snapjag.com/2009/04/using-properties-in-an-aspnet-web-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<price></price>	</item>
		<item>
		<title>C# GridView rows not vertically aligned</title>
		<link>http://www.snapjag.com/2009/03/gridview-rows-not-vertically-aligned/</link>
		<comments>http://www.snapjag.com/2009/03/gridview-rows-not-vertically-aligned/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 17:19:50 +0000</pubDate>
		<dc:creator>snapjag</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://gleew.wordpress.com/?p=244</guid>
		<description><![CDATA[A recent project caused me grief until it dawned on me what the problem and the fix was. The GridView has a height property value and if it&#8217;s changed from the default (which is NULL), or to anything less than 25px (arbitrary number) you may experience an undesierable result where the GridView will vertically align [...]]]></description>
			<content:encoded><![CDATA[<p>A recent project caused me grief until it dawned on me what the problem and the fix was. The GridView has a height property value and if it&#8217;s changed from the default (which is NULL), or to anything less than 25px (arbitrary number) you may experience an undesierable result where the GridView will vertically align the rows in the middle of the control. I did this inadvertantly, creating this undesireable result, and I wanted to share with you the fix and why does this. <span id="more-276"></span></p>
<p><img class="alignright size-full wp-image-247" title="GridView Middle Vertical Alignment" src="http://gleew.files.wordpress.com/2009/03/gridviewalign01.png" alt="GridView Middle Vertical Alignment" width="367" height="147" />To recreate the issue, follow these instructions:<br />
* Create a new GridView control on your page<br />
* Set the DataSoruce to an ObjectSource control (there is more work to do here, but won&#8217;t be explained here)<br />
* Set the GridView height to 100px (arbitrary number), or resize it in height to be at least this number; again, this is a high arbitrary number for maximum visual effect. If it&#8217;s any smaller in height, you may not see the dramatic effect.<br />
* Add ONE and only ONE row to the ObjectSource<br />
* You will see that the GridView vertically aligns the row to the middle of the control.</p>
<p><img class="alignright size-full wp-image-247" title="GridView Middle Vertical Alignment" src="http://gleew.files.wordpress.com/2009/03/gridviewalign03.png" alt="GridView Top Vertical Alignment" width="353" height="142" />To fix the issue, do this:<br />
* remove the Height value in the property</p>
<div class="mceTemp">
<div class="mceTemp">This situation presents itself when the Height property of the grid has been changed. Either by changing the Height property or resizing the height of the control. If it changes to a large value, more rows will be spaced apart. If you it&#8217;s a small number, then you probably haven&#8217;t experienced this problem, but could when you don&#8217;t add large values.</div>
</div>
<p>By default, there is no Height value so the problem doesn&#8217;t present itself. In my situation, I placed a GridView on my form inside of a Panel with a Vertical scroll on so I can scroll through the gridview rows. There are, I&#8217;m sure, other ways to accomplish this, but it was all that was required for the project.</p>
<p>When adding 5 or more rows to the GridView ObjectSource the rows were their optimal height and top-aligned. However, if I add 5 or less rows, the rows are expanded in height and are spread evenly across the height of the GridView. Especially when there is only one row &#8230; the row will show in the middle of the GridView vertically. I want it to be top-aligned. I tried everhthing, I changed properties, I added CSS styles and alignment attributes, but nothing changed the effect.</p>
<p>It dawned on me that the rows were expanding to fill the vertical height of the GridView. I checked the Height property and it was set to 88px (bolded to show that it wasn&#8217;t the default value). I changed it to 1px (again bolded, so I knew it wasn&#8217;t the default) and the problem went away. But knowing this wasn&#8217;t the default, I could possibly run in to other problems. I then assumed that a NULL Height value was the default. I erased any value in the Height property, tried it again, and it worked. I have thus left it at this value.</p>
<p>Lesson learned, when I created the control in the first place, I resized the GridView to fill the expanse of the Panel in it&#8217;s width and height. The Height property was set and the grid was trying to fill the height of the control automatically. An undesireable effect.</p>
<p>You may want this effect to exist, but just know it happens so it&#8217;s done on purpose and not by accident.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snapjag.com/2009/03/gridview-rows-not-vertically-aligned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<price></price>	</item>
	</channel>
</rss>

