<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: ASP.Net Dynamic Controls (Part 4)</title>
	<atom:link href="http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/</link>
	<description>Discussion on Development in Several Different Flavours</description>
	<lastBuildDate>Fri, 06 Jan 2012 16:25:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jino</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-79</link>
		<dc:creator>Jino</dc:creator>
		<pubDate>Tue, 25 Nov 2008 18:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-79</guid>
		<description>hi...
   This will very helpfull for my work.
                Thankingyou</description>
		<content:encoded><![CDATA[<p>hi&#8230;<br />
   This will very helpfull for my work.<br />
                Thankingyou</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel D' Aarmas</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-78</link>
		<dc:creator>Daniel D' Aarmas</dc:creator>
		<pubDate>Thu, 25 Sep 2008 15:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-78</guid>
		<description>Hi, I&#039;ve been reading your posts and are great but  I have a question to help me in my development. I&#039;m trying to add panels dynamically with out clear the previous. I mean initially I have just 1 panel with some textboxes, in the bottom of the page I have a Button to &quot;Add a new panel&quot;, ok i just want to click that button and render in my page a new panel without deleting de previous one, and if i have added 3 panels when i click the fourth time the button get the 4 panels rendered in the page. This can be done?? Thanks for your support!!!!</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;ve been reading your posts and are great but  I have a question to help me in my development. I&#8217;m trying to add panels dynamically with out clear the previous. I mean initially I have just 1 panel with some textboxes, in the bottom of the page I have a Button to &#8220;Add a new panel&#8221;, ok i just want to click that button and render in my page a new panel without deleting de previous one, and if i have added 3 panels when i click the fourth time the button get the 4 panels rendered in the page. This can be done?? Thanks for your support!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeevan</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-77</link>
		<dc:creator>Jeevan</dc:creator>
		<pubDate>Tue, 16 Sep 2008 10:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-77</guid>
		<description>Hai.
Is there any posibility to generate complete grid view in dynamic means withour html source. using only code behind. if yes..
add drop downlist and checkbox from coding</description>
		<content:encoded><![CDATA[<p>Hai.<br />
Is there any posibility to generate complete grid view in dynamic means withour html source. using only code behind. if yes..<br />
add drop downlist and checkbox from coding</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ming</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-76</link>
		<dc:creator>Ming</dc:creator>
		<pubDate>Sun, 24 Aug 2008 20:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-76</guid>
		<description>Great Hints,
I have using one day to think about how to prevent  dynamic control disappear after post back and maintenance the viewstate.
It seem i just leave it re-generate every times on Page_Load and keep the same ControlID is the easy way to solve my problem.</description>
		<content:encoded><![CDATA[<p>Great Hints,<br />
I have using one day to think about how to prevent  dynamic control disappear after post back and maintenance the viewstate.<br />
It seem i just leave it re-generate every times on Page_Load and keep the same ControlID is the easy way to solve my problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BigT</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-75</link>
		<dc:creator>BigT</dc:creator>
		<pubDate>Wed, 06 Feb 2008 21:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-75</guid>
		<description>Extremely Helpful Adam!!!!
Thank you SIR! Saved me many hours of headaches...</description>
		<content:encoded><![CDATA[<p>Extremely Helpful Adam!!!!<br />
Thank you SIR! Saved me many hours of headaches&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-74</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 05 Feb 2008 21:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-74</guid>
		<description>Here is an example of pulling from the database and processing the ids in the save click.

&lt;pre class=&quot;brush: vb&quot;&gt;&lt;%@ Page Language=&quot;VB&quot; %&gt;
&lt;%@ Import Namespace=&quot;System.Data.SqlClient&quot; %&gt;

&lt;script runat=&quot;server&quot;&gt;

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   Dim chk As CheckBox
   Dim sdr As SqlDataReader, cmd As SqlCommand, dbConn As SqlConnection

   dbConn = New SqlConnection(&quot;Data Source=localhost;Initial Catalog=Northwind&quot;)
   dbConn.Open()
   cmd = New SqlCommand(&quot;SELECT SupplierID, CompanyName FROM Suppliers ORDER BY CompanyName&quot;, dbConn)
   sdr = cmd.ExecuteReader()
   While (sdr.Read())
     chk = New CheckBox()
     chk.ID = &quot;chk&quot; &amp; sdr(&quot;SupplierID&quot;)
     chk.Text = sdr(&quot;CompanyName&quot;)
     phControls.Controls.Add(chk)
     phControls.Controls.Add(New LiteralControl(&quot;&lt;br /&gt;&quot;))
   End While
   sdr.Close()
 End Sub

 Sub Click_Save(ByVal s As Object, ByVal e As EventArgs)
   lblMessage.Text = &quot;Saving: &quot;
   Dim id As String
   For Each ctl As Control In phControls.Controls
     If Left(ctl.ID, 3) = &quot;chk&quot; AndAlso (CType(ctl, CheckBox)).Checked Then
       id = Mid(ctl.ID, 4)
       &#039;------------------ Process checked id&#039;s here ----------------------------
       lblMessage.Text += id &amp; &quot; &quot;
     End If
   Next
 End Sub

&lt;/script&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
   &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
  &lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;Dynamic Checkoxes&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;div&gt;
    &lt;asp:Label ID=&quot;lblMessage&quot; runat=&quot;server&quot; /&gt;
    &lt;br /&gt;&#160;&lt;br /&gt;
    &lt;asp:PlaceHolder ID=&quot;phControls&quot; runat=&quot;server&quot; /&gt;
    &lt;br /&gt;&#160;&lt;br /&gt;
    &lt;asp:Button ID=&quot;btnSave&quot; OnClick=&quot;Click_Save&quot; Text=&quot;Save Checkboxes&quot; runat=&quot;server&quot; /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Here is an example of pulling from the database and processing the ids in the save click.</p>
<pre class="brush: vb">&lt;%@ Page Language="VB" %&gt;
&lt;%@ Import Namespace="System.Data.SqlClient" %&gt;

&lt;script runat="server"&gt;

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   Dim chk As CheckBox
   Dim sdr As SqlDataReader, cmd As SqlCommand, dbConn As SqlConnection

   dbConn = New SqlConnection("Data Source=localhost;Initial Catalog=Northwind")
   dbConn.Open()
   cmd = New SqlCommand("SELECT SupplierID, CompanyName FROM Suppliers ORDER BY CompanyName", dbConn)
   sdr = cmd.ExecuteReader()
   While (sdr.Read())
     chk = New CheckBox()
     chk.ID = "chk" &amp; sdr("SupplierID")
     chk.Text = sdr("CompanyName")
     phControls.Controls.Add(chk)
     phControls.Controls.Add(New LiteralControl("&lt;br /&gt;"))
   End While
   sdr.Close()
 End Sub

 Sub Click_Save(ByVal s As Object, ByVal e As EventArgs)
   lblMessage.Text = "Saving: "
   Dim id As String
   For Each ctl As Control In phControls.Controls
     If Left(ctl.ID, 3) = "chk" AndAlso (CType(ctl, CheckBox)).Checked Then
       id = Mid(ctl.ID, 4)
       '------------------ Process checked id's here ----------------------------
       lblMessage.Text += id &amp; " "
     End If
   Next
 End Sub

&lt;/script&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head runat="server"&gt;
    &lt;title&gt;Dynamic Checkoxes&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
    &lt;asp:Label ID="lblMessage" runat="server" /&gt;
    &lt;br /&gt;&nbsp;&lt;br /&gt;
    &lt;asp:PlaceHolder ID="phControls" runat="server" /&gt;
    &lt;br /&gt;&nbsp;&lt;br /&gt;
    &lt;asp:Button ID="btnSave" OnClick="Click_Save" Text="Save Checkboxes" runat="server" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: sue</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-73</link>
		<dc:creator>sue</dc:creator>
		<pubDate>Sat, 05 Jan 2008 17:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-73</guid>
		<description>Thanks so much for posting this; it helped me quickly solve an issue I&#039;ve been struggling with! ~ Sue</description>
		<content:encoded><![CDATA[<p>Thanks so much for posting this; it helped me quickly solve an issue I&#8217;ve been struggling with! ~ Sue</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-70</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sat, 18 Aug 2007 06:01:20 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-70</guid>
		<description>C# Equivalent:

&lt;pre class=&quot;brush: csharp&quot;&gt;cmd.Click += new EventHandler(Button_Click);&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>C# Equivalent:</p>
<pre class="brush: csharp">cmd.Click += new EventHandler(Button_Click);</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: sachin jain</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-71</link>
		<dc:creator>sachin jain</dc:creator>
		<pubDate>Fri, 17 Aug 2007 12:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-71</guid>
		<description>Kindly tel me how to add this handler in c#(c# code)

AddHandler cmd.Click, AddressOf Button_Click</description>
		<content:encoded><![CDATA[<p>Kindly tel me how to add this handler in c#(c# code)</p>
<p>AddHandler cmd.Click, AddressOf Button_Click</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Voir</title>
		<link>http://devsushi.com/2007/01/19/aspnet-dynamic-controls-part-4/comment-page-1/#comment-72</link>
		<dc:creator>Alan Voir</dc:creator>
		<pubDate>Mon, 13 Aug 2007 04:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://adamhewgill.com/devsushi/2007/01/19/aspnet-dynamic-controls-part-4/#comment-72</guid>
		<description>I thought Part 4 was supposed to be about AJAX?  Looks like that one got ya stumped, eh? ;-)

Just as an FYI, as a writer, you really ought to refactor this series of articles.  Most programmers are interested in the right way to do something, and  why it&#039;s right.  You have whole articles (Part 1 and Part 2?) that essentially tell people the wrong way to do things...so why would you want someone to read that?</description>
		<content:encoded><![CDATA[<p>I thought Part 4 was supposed to be about AJAX?  Looks like that one got ya stumped, eh? ;-)</p>
<p>Just as an FYI, as a writer, you really ought to refactor this series of articles.  Most programmers are interested in the right way to do something, and  why it&#8217;s right.  You have whole articles (Part 1 and Part 2?) that essentially tell people the wrong way to do things&#8230;so why would you want someone to read that?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

