<?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>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2706495.aspx</link><pubDate>Sun, 26 Oct 2008 04:00:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2706495</guid><dc:creator>cheng_jiawei</dc:creator><author>cheng_jiawei</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2706495.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2706495</wfw:commentRss><description>&lt;p&gt;It&amp;#39;s LoadControl Source Code:&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="kwd"&gt;private&lt;/span&gt; Control LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, &lt;span class="kwd"&gt;object&lt;/span&gt;[] parameters)
&lt;b id="2"&gt;2    &lt;/b&gt;{
&lt;b id="3"&gt;3    &lt;/b&gt;    BuildResultCompiledType type = &lt;span class="kwd"&gt;null&lt;/span&gt;;
&lt;b id="4"&gt;4    &lt;/b&gt;    BuildResultNoCompileUserControl control = &lt;span class="kwd"&gt;null&lt;/span&gt;;
&lt;b id="5"&gt;5    &lt;/b&gt;    PartialCachingAttribute cachingAttribute;
&lt;b id="6"&gt;6    &lt;/b&gt;    &lt;span class="kwd"&gt;if&lt;/span&gt; (objectFactory != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="7"&gt;7    &lt;/b&gt;    {
&lt;b id="8"&gt;8    &lt;/b&gt;        type = objectFactory &lt;span class="kwd"&gt;as&lt;/span&gt; BuildResultCompiledType;
&lt;b id="9"&gt;9    &lt;/b&gt;        &lt;span class="kwd"&gt;if&lt;/span&gt; (type != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="10"&gt;10   &lt;/b&gt;        {
&lt;b id="11"&gt;11   &lt;/b&gt;            t = type.ResultType;
&lt;b id="12"&gt;12   &lt;/b&gt;            Util.CheckAssignableType(&lt;span class="kwd"&gt;typeof&lt;/span&gt;(UserControl), t);
&lt;b id="13"&gt;13   &lt;/b&gt;        }
&lt;b id="14"&gt;14   &lt;/b&gt;        &lt;span class="kwd"&gt;else&lt;/span&gt;
&lt;b id="15"&gt;15   &lt;/b&gt;        {
&lt;b id="16"&gt;16   &lt;/b&gt;            control = (BuildResultNoCompileUserControl) objectFactory;
&lt;b id="17"&gt;17   &lt;/b&gt;        }
&lt;b id="18"&gt;18   &lt;/b&gt;    }
&lt;b id="19"&gt;19   &lt;/b&gt;    &lt;span class="kwd"&gt;else if&lt;/span&gt; (t != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="20"&gt;20   &lt;/b&gt;    {
&lt;b id="21"&gt;21   &lt;/b&gt;        Util.CheckAssignableType(&lt;span class="kwd"&gt;typeof&lt;/span&gt;(Control), t);
&lt;b id="22"&gt;22   &lt;/b&gt;    }
&lt;b id="23"&gt;23   &lt;/b&gt;    &lt;span class="kwd"&gt;if&lt;/span&gt; (t != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="24"&gt;24   &lt;/b&gt;    {
&lt;b id="25"&gt;25   &lt;/b&gt;        cachingAttribute = (PartialCachingAttribute) TypeDescriptor.GetAttributes(t)[&lt;span class="kwd"&gt;typeof&lt;/span&gt;(PartialCachingAttribute)];
&lt;b id="26"&gt;26   &lt;/b&gt;    }
&lt;b id="27"&gt;27   &lt;/b&gt;    &lt;span class="kwd"&gt;else&lt;/span&gt;
&lt;b id="28"&gt;28   &lt;/b&gt;    {
&lt;b id="29"&gt;29   &lt;/b&gt;        cachingAttribute = control.CachingAttribute;
&lt;b id="30"&gt;30   &lt;/b&gt;    }
&lt;b id="31"&gt;31   &lt;/b&gt;    &lt;span class="kwd"&gt;if&lt;/span&gt; (cachingAttribute == &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="32"&gt;32   &lt;/b&gt;    {
&lt;b id="33"&gt;33   &lt;/b&gt;        Control control2;
&lt;b id="34"&gt;34   &lt;/b&gt;        &lt;span class="kwd"&gt;if&lt;/span&gt; (objectFactory != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="35"&gt;35   &lt;/b&gt;        {
&lt;b id="36"&gt;36   &lt;/b&gt;            control2 = (Control) objectFactory.CreateInstance();
&lt;b id="37"&gt;37   &lt;/b&gt;        }
&lt;b id="38"&gt;38   &lt;/b&gt;        &lt;span class="kwd"&gt;else&lt;/span&gt;
&lt;b id="39"&gt;39   &lt;/b&gt;        {
&lt;b id="40"&gt;40   &lt;/b&gt;            control2 = (Control) HttpRuntime.CreatePublicInstance(t, parameters);
&lt;b id="41"&gt;41   &lt;/b&gt;        }
&lt;b id="42"&gt;42   &lt;/b&gt;        UserControl control3 = control2 &lt;span class="kwd"&gt;as&lt;/span&gt; UserControl;
&lt;b id="43"&gt;43   &lt;/b&gt;        &lt;span class="kwd"&gt;if&lt;/span&gt; (control3 != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="44"&gt;44   &lt;/b&gt;        {
&lt;b id="45"&gt;45   &lt;/b&gt;            &lt;span class="kwd"&gt;if&lt;/span&gt; (virtualPath != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="46"&gt;46   &lt;/b&gt;            {
&lt;b id="47"&gt;47   &lt;/b&gt;                control3.TemplateControlVirtualPath = virtualPath;
&lt;b id="48"&gt;48   &lt;/b&gt;            }
&lt;b id="49"&gt;49   &lt;/b&gt;            control3.InitializeAsUserControl(&lt;span class="kwd"&gt;this&lt;/span&gt;.Page);
&lt;b id="50"&gt;50   &lt;/b&gt;        }
&lt;b id="51"&gt;51   &lt;/b&gt;        &lt;span class="kwd"&gt;return&lt;/span&gt; control2;
&lt;b id="52"&gt;52   &lt;/b&gt;    }
&lt;b id="53"&gt;53   &lt;/b&gt;    HashCodeCombiner combinedHashCode = &lt;span class="kwd"&gt;new&lt;/span&gt; HashCodeCombiner();
&lt;b id="54"&gt;54   &lt;/b&gt;    &lt;span class="kwd"&gt;if&lt;/span&gt; (objectFactory != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="55"&gt;55   &lt;/b&gt;    {
&lt;b id="56"&gt;56   &lt;/b&gt;        combinedHashCode.AddObject(objectFactory);
&lt;b id="57"&gt;57   &lt;/b&gt;    }
&lt;b id="58"&gt;58   &lt;/b&gt;    &lt;span class="kwd"&gt;else&lt;/span&gt;
&lt;b id="59"&gt;59   &lt;/b&gt;    {
&lt;b id="60"&gt;60   &lt;/b&gt;        combinedHashCode.AddObject(t);
&lt;b id="61"&gt;61   &lt;/b&gt;    }
&lt;b id="62"&gt;62   &lt;/b&gt;    &lt;span class="kwd"&gt;if&lt;/span&gt; (!cachingAttribute.Shared)
&lt;b id="63"&gt;63   &lt;/b&gt;    {
&lt;b id="64"&gt;64   &lt;/b&gt;        &lt;span class="kwd"&gt;this&lt;/span&gt;.AddStackContextToHashCode(combinedHashCode);
&lt;b id="65"&gt;65   &lt;/b&gt;    }
&lt;b id="66"&gt;66   &lt;/b&gt;    &lt;span class="kwd"&gt;string&lt;/span&gt; combinedHashString = combinedHashCode.CombinedHashString;
&lt;b id="67"&gt;67   &lt;/b&gt;    &lt;span class="kwd"&gt;return new&lt;/span&gt; PartialCachingControl(objectFactory, t, cachingAttribute, &lt;span class="st"&gt;&amp;quot;_&amp;quot;&lt;/span&gt; + combinedHashString, parameters);
&lt;b id="68"&gt;68   &lt;/b&gt;}
&lt;b id="69"&gt;69   &lt;/b&gt;
&lt;b id="70"&gt;70   &lt;/b&gt; 
&lt;b id="71"&gt;71   &lt;/b&gt;
&lt;b id="72"&gt;72   &lt;/b&gt; 
&lt;b id="73"&gt;73   &lt;/b&gt;
&lt;/pre&gt;&amp;nbsp;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2706484.aspx</link><pubDate>Sun, 26 Oct 2008 03:46:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2706484</guid><dc:creator>cheng_jiawei</dc:creator><author>cheng_jiawei</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2706484.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2706484</wfw:commentRss><description>&lt;p&gt;I Googled....&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you load a control, you do more than instantiate it..&lt;br /&gt;&lt;br /&gt;new RegInfo();, as you know, creates a new instance of a class.&lt;br /&gt;&lt;br /&gt;Page.LoadControl also creates a new instance, but also does a lot&lt;br /&gt;more...such as bringing the control up to the same event life cycle. AS you&lt;br /&gt;can imagine, if new did this, it would be inconsitent with how new works for&lt;br /&gt;normal classes (simply calling the constructor...).&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Karl&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2706482.aspx</link><pubDate>Sun, 26 Oct 2008 03:35:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2706482</guid><dc:creator>easter</dc:creator><author>easter</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2706482.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2706482</wfw:commentRss><description>&lt;p&gt;Thanks, that did work. Although, I don&amp;#39;t see why I need to use Page.LoadControl rather than just using the constructor of the control. Oh well, thanks :)&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2706481.aspx</link><pubDate>Sun, 26 Oct 2008 03:31:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2706481</guid><dc:creator>cheng_jiawei</dc:creator><author>cheng_jiawei</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2706481.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2706481</wfw:commentRss><description>&lt;p&gt;:) I build a demo,and find out your problem!&lt;/p&gt;
&lt;p&gt;See my demo:&lt;/p&gt;
&lt;p&gt;You shold create usercontrol like this: Page.LoadControl()&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;        &lt;span class="kwd"&gt;protected void&lt;/span&gt; Page_Load(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, EventArgs e)
&lt;b id="2"&gt;2    &lt;/b&gt;        {
&lt;b id="3"&gt;3    &lt;/b&gt;            &lt;span class="kwd"&gt;for&lt;/span&gt; (&lt;span class="kwd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 10; i++)
&lt;b id="4"&gt;4    &lt;/b&gt;            {
&lt;b id="5"&gt;5    &lt;/b&gt;                UserControl usercontrol = (UserControl)Page.LoadControl(&lt;span class="st"&gt;&amp;quot;~/UserControl.ascx&amp;quot;&lt;/span&gt;);
&lt;b id="6"&gt;6    &lt;/b&gt;                usercontrol.Name = i.ToString();
&lt;b id="7"&gt;7    &lt;/b&gt;                &lt;span class="kwd"&gt;this&lt;/span&gt;.pnlControl.Controls.Add(usercontrol);
&lt;b id="8"&gt;8    &lt;/b&gt;            }
&lt;b id="9"&gt;9    &lt;/b&gt;        }
&lt;b id="10"&gt;10   &lt;/b&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;    &lt;span class="kwd"&gt;public&lt;/span&gt; partial &lt;span class="kwd"&gt;class&lt;/span&gt; UserControl : System.Web.UI.UserControl
&lt;b id="2"&gt;2    &lt;/b&gt;    {
&lt;b id="3"&gt;3    &lt;/b&gt;
&lt;b id="4"&gt;4    &lt;/b&gt;        &lt;span class="kwd"&gt;private string&lt;/span&gt; _name;
&lt;b id="5"&gt;5    &lt;/b&gt;
&lt;b id="6"&gt;6    &lt;/b&gt;        &lt;span class="kwd"&gt;public string&lt;/span&gt; Name
&lt;b id="7"&gt;7    &lt;/b&gt;        {
&lt;b id="8"&gt;8    &lt;/b&gt;            &lt;span class="kwd"&gt;set&lt;/span&gt;
&lt;b id="9"&gt;9    &lt;/b&gt;            {
&lt;b id="10"&gt;10   &lt;/b&gt;                _name = &lt;span class="kwd"&gt;value&lt;/span&gt;;                
&lt;b id="11"&gt;11   &lt;/b&gt;            }
&lt;b id="12"&gt;12   &lt;/b&gt;            &lt;span class="kwd"&gt;get&lt;/span&gt; { &lt;span class="kwd"&gt;return&lt;/span&gt; _name; }
&lt;b id="13"&gt;13   &lt;/b&gt;        }
&lt;b id="14"&gt;14   &lt;/b&gt;
&lt;b id="15"&gt;15   &lt;/b&gt;        &lt;span class="kwd"&gt;protected void&lt;/span&gt; Page_Load(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, EventArgs e)
&lt;b id="16"&gt;16   &lt;/b&gt;        {
&lt;b id="17"&gt;17   &lt;/b&gt;            &lt;span class="kwd"&gt;this&lt;/span&gt;.LblText.Text = _name;
&lt;b id="18"&gt;18   &lt;/b&gt;        }
&lt;b id="19"&gt;19   &lt;/b&gt;    }
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&amp;lt;&lt;span class="tag"&gt;%@&lt;/span&gt;&lt;span class="attr"&gt; Control Language=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;C#&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; AutoEventWireup=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; CodeBehind=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;UserControl.ascx.cs&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Inherits=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;WebProjects.UserControl&amp;quot;&lt;/span&gt; %&amp;gt;
&lt;b id="2"&gt;2    &lt;/b&gt;&amp;lt;&lt;span class="tag"&gt;div&lt;/span&gt;&amp;gt;
&lt;b id="3"&gt;3    &lt;/b&gt;    &amp;lt;&lt;span class="tag"&gt;span&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class="tag"&gt;asp:Label&lt;/span&gt;&lt;span class="attr"&gt; ID=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;LblText&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="tag"&gt;asp:Label&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="tag"&gt;span&lt;/span&gt;&amp;gt;
&lt;b id="4"&gt;4    &lt;/b&gt;&amp;lt;/&lt;span class="tag"&gt;div&lt;/span&gt;&amp;gt;
&lt;b id="5"&gt;5    &lt;/b&gt;
&lt;/pre&gt;&amp;nbsp;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2706467.aspx</link><pubDate>Sun, 26 Oct 2008 02:51:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2706467</guid><dc:creator>easter</dc:creator><author>easter</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2706467.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2706467</wfw:commentRss><description>&lt;p&gt;That didn&amp;#39;t work. I&amp;#39;ve also removed all the link buttons btw, and made them into &amp;lt;a&amp;gt; tags, with a runat server to set their href on load.&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2706464.aspx</link><pubDate>Sun, 26 Oct 2008 02:44:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2706464</guid><dc:creator>cheng_jiawei</dc:creator><author>cheng_jiawei</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2706464.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2706464</wfw:commentRss><description>&lt;p&gt;I think you&amp;#39;d better&amp;nbsp;Add your UserControls in Panel Control(Server),just try.&lt;/p&gt;
&lt;p&gt;I think your coding is ok, but if you want to click the link button in your controls ,it will be post back.&lt;/p&gt;
&lt;p&gt;:)&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705530.aspx</link><pubDate>Sat, 25 Oct 2008 01:59:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705530</guid><dc:creator>easter</dc:creator><author>easter</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705530.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705530</wfw:commentRss><description>&lt;p&gt;No post back is occuring. The problem occurs on the initial load of the page.&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705529.aspx</link><pubDate>Sat, 25 Oct 2008 01:57:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705529</guid><dc:creator>cheng_jiawei</dc:creator><author>cheng_jiawei</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705529.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705529</wfw:commentRss><description>&lt;p&gt;I think the problem is that :where and when you created your UserControls?&lt;/p&gt;
&lt;p&gt;Just as you see, everytime&amp;nbsp; you postback your page,the UserControls that your added are completed lost(So is null).&lt;/p&gt;
&lt;p&gt;Yet,I&amp;nbsp;got that problems before.&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s better to create Client Controls instead of UserControl in the server.&lt;/p&gt;
&lt;p&gt;Or you have to create the UserControls everytime In the Page_Load event :)&lt;/p&gt;
&lt;p&gt;Hope that help~&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705517.aspx</link><pubDate>Sat, 25 Oct 2008 01:19:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705517</guid><dc:creator>jorr1027@cox.net</dc:creator><author>jorr1027@cox.net</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705517.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705517</wfw:commentRss><description>&lt;p&gt;Are you dynamically adding userControls to the aspx page itself?&lt;/p&gt;
&lt;p&gt;If so for every userControl added you have to add another &amp;lt;&lt;font color="#a31515" size="2"&gt;qcc&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;qccntrl&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;ID&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;QuoteControlID&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;runat&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;server&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt; &lt;font color="#000000"&gt;to the aspx page.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Possible solutions: &lt;/p&gt;
&lt;p&gt;1) on aspx&amp;nbsp;postback use a for loop to:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;append a number to &lt;font color="#0000ff"&gt;QuoteControlID &lt;/font&gt;&lt;font color="#000000"&gt;incrementing the ID, building the &amp;quot;&amp;lt;qcc:qccntrl ID=&amp;quot;&amp;quot;QuoteControl&amp;quot;&amp;quot;&amp;quot; + i + &amp;quot; runat=&amp;quot;&amp;quot;server&amp;quot;&amp;quot; /&amp;gt;&amp;quot; string and &lt;/font&gt;use an HTMLWriter to add it to the aspx page. When the page Renders it&amp;nbsp;may show the correct amount of controls.&lt;/p&gt;
&lt;p&gt;2) add the maximum number of quoteControls allowed to the aspx page, on Init disable whatever is not needed yet, on postback enable as many userControls as needed.&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705506.aspx</link><pubDate>Sat, 25 Oct 2008 01:05:43 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705506</guid><dc:creator>easter</dc:creator><author>easter</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705506.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705506</wfw:commentRss><description>&lt;p&gt;Normally, like the Ajax controls, I would statically put them in the page, but unfortunately I need to dynamically create the controls, as I won&amp;#39;t know how many will be needed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks for trying though :)&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705502.aspx</link><pubDate>Sat, 25 Oct 2008 01:00:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705502</guid><dc:creator>jorr1027@cox.net</dc:creator><author>jorr1027@cox.net</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705502.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705502</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;easter:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;EDIT: You edited your posts :P&lt;/p&gt;
&lt;p&gt;Okay, I see what you mean. The code you posted is in my ASCX page, not ASPX. Was a typo in my first post, sorry.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp; 
&lt;p&gt;ah! I&amp;#39;m taking to long to check my references. It seems my advice cannot help :(&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705493.aspx</link><pubDate>Sat, 25 Oct 2008 00:43:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705493</guid><dc:creator>easter</dc:creator><author>easter</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705493.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705493</wfw:commentRss><description>&lt;p&gt;EDIT: You edited your posts :P&lt;/p&gt;
&lt;p&gt;Okay, I see what you mean. The code you posted is in my ASCX page, not ASPX. Was a typo in my first post, sorry.&lt;/p&gt;</description></item><item><title>Re oops</title><link>http://forums.asp.net/thread/2705483.aspx</link><pubDate>Sat, 25 Oct 2008 00:25:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705483</guid><dc:creator>jorr1027@cox.net</dc:creator><author>jorr1027@cox.net</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705483.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705483</wfw:commentRss><description>&lt;p&gt;&lt;img src="http://forums.asp.net/emoticons/emotion-10.gif" alt="Embarrassed" /&gt;&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705484.aspx</link><pubDate>Sat, 25 Oct 2008 00:25:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705484</guid><dc:creator>jorr1027@cox.net</dc:creator><author>jorr1027@cox.net</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705484.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705484</wfw:commentRss><description>&lt;p&gt;Doh, I did not realize you were referencing your Controls code behind from the aspx file. My bad, ... It was my understanding that UserControls are for writing once what is used often, like the items in the AJAX control toolkit. I always put my asp controls on my UserControl.ascx page and put the code behind in my UserControl.ascx.cs page. I Place the &amp;lt;&lt;font color="#a31515" size="2"&gt;qcc&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;qccntrl&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;ID&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;QuoteControlID&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;runat&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;server&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt; &lt;font color="#000000"&gt;on the aspx page and any other controls the UserControl might interact with, the aspx.cs code behind handles the interaction between the UserControl and the aspx controls&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The aspx page is &amp;quot;hosting&amp;quot; the ascx control...&lt;/p&gt;</description></item><item><title>Re: Problem with UserControl</title><link>http://forums.asp.net/thread/2705482.aspx</link><pubDate>Sat, 25 Oct 2008 00:25:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2705482</guid><dc:creator>jorr1027@cox.net</dc:creator><author>jorr1027@cox.net</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2705482.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2705482</wfw:commentRss><description>&lt;p&gt;Instead of this in your aspx page:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;ContentTemplate&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quote &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:LinkButton&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; ID=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lnkQuote&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; runat=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; onclick=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lnkQuote_Click&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;a&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:LinkButton&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Score: &amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:Label&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; id=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lblScore&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; runat=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;a&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:Label&lt;/font&gt;&lt;/span&gt;&amp;gt; [ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:LinkButton&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; ID=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lnkUp&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; runat=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; Text=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;+&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; CommandArgument=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;up&amp;quot;&lt;/font&gt;&lt;/span&gt; &lt;br /&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onclick=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lnkUp_Click&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;a&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:LinkButton&lt;/font&gt;&lt;/span&gt;&amp;gt; / &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:LinkButton&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; ID=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lnkDown&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; runat=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; Text=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;-&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; CommandArgument=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;down&amp;quot;&lt;/font&gt;&lt;/span&gt; &lt;br /&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onclick=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lnkDown_Click&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;a&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:LinkButton&lt;/font&gt;&lt;/span&gt;&amp;gt; ]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Submitted: &amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:Label&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; ID=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lblTime&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; runat=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;a&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:Label&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:Label&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; ID=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;lblError&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;font color="#ff0000"&gt; runat=&lt;/font&gt;&lt;/span&gt;&lt;span class="attrv"&gt;&lt;font color="#0000ff"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;a&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;asp:Label&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;ContentTemplate&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;Only put:&lt;/p&gt;
&lt;p&gt;&amp;lt;&lt;span class="tag"&gt;&lt;font color="#800000"&gt;ContentTemplate&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;font color="#a31515" size="2"&gt;qcc&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;qccntrl&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;ID&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;QuoteControlID&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;runat&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;server&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/&lt;span class="tag"&gt;&lt;font color="#800000"&gt;ContentTemplate&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>