<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Custom Server Controls</title><link>http://forums.asp.net/19.aspx</link><description>All about building ASP.NET server controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=12&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Custom Control with 2-way databinding</title><link>http://forums.asp.net/thread/3276305.aspx</link><pubDate>Mon, 06 Jul 2009 08:31:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3276305</guid><dc:creator>Allen Chen – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3276305.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=19&amp;PostID=3276305</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I wrote a simple project that can help you understand IPostBackDataHandler:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://cid-2fa13ebc6cc8e80f.skydrive.live.com/self.aspx/Public/Understand%7C_IPostBackDataHandler%7C_lvl%7C_300.zip"&gt;http://cid-2fa13ebc6cc8e80f.skydrive.live.com/self.aspx/Public/Understand%7C_IPostBackDataHandler%7C_lvl%7C_300.zip&lt;/a&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Custom Control with 2-way databinding</title><link>http://forums.asp.net/thread/3269216.aspx</link><pubDate>Wed, 01 Jul 2009 15:01:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3269216</guid><dc:creator>Disco Patrick</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3269216.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=19&amp;PostID=3269216</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;&lt;p&gt;I recently posted &lt;a target="_blank" title="another thread in the Data Presentation Controls forum" href="http://forums.asp.net/t/1441712.aspx"&gt;another thread in the Data Presentation Controls forum&lt;/a&gt;, though I think it might have got a better reponse in this forum.&lt;/p&gt;&lt;p&gt;I&amp;#39;m building a Custom Server Control so I can reuse it throughout my site wherever it is needed. Basically it emits a HTML table with header cells on the top and left. Inside the header cells there are titles. In the future there may also be other fields. These fields should be editable.&lt;/p&gt;&lt;p&gt;The data cells also contain editable information, though this time it is a dropdown list that the user can choose from.&lt;/p&gt;&lt;p&gt;The control needs to initially show data that is already in the database, but then allow the user to edit and save any of the information back to the database.&lt;/p&gt;&lt;p&gt;I began this project by using User Controls for their relative simplicity, but soon discovered that it is (apparently) impossible to instantiate them from a class in my App_Code folder - they have to be instantiated from a page, or another User Control. So I moved over to Custom Server Controls.&lt;/p&gt;&lt;p&gt;How it works so far: starting with a table, I use a typed dataset to get the column headings from the database, iterate through them, creating a new headercell for each one. I then get the row headings in a similar way, add a new row and header cell for each one, and also add the data cells for each column. Every one of these cells is actually another Custom Control - as I create them, I set my custom properties to populate titles into textboxes, etc.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I thought there might be a standard way of rebinding any changes I made in these textboxes back to the database, but the one reply in my other thread would suggest not. I wanted to get a second opinion from this forum.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Perhaps the way forward is to simply add a submit button to the page, and get each of these cells to do something on postback. I&amp;#39;ve had a look at IPostBackEventHandler and IPostBackDataHandler but can&amp;#39;t get my head around how they work. Can anyone help?&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>