Click here to Skip to main content
15,886,847 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi,
i have a usercontrol .into usercontrol i call a strored procedure return number of records in table .
i want into user control create another user control.
i use this code
C#
SqlConnection con = new SqlConnection("Data Source=MORTEZA-PC\\SQLEXPRESS;Initial Catalog=News;Integrated Security=True");
        protected void Page_Load(object sender, EventArgs e)
        {

            //this code should be into for 
            string myuser = "<CS:userNews runat=" + "server" + "/>";
            divShowOtherComment.InnerHtml = myuser;
            myuser = "<CS:userNews runat=" + "server" + "/>";
            divShowOtherComment.InnerHtml = myuser;
            myuser = "<CS:userNews runat=" + "server" + "/>";
            divShowOtherComment.InnerHtml = myuser;
            

         

        }
<pre lang="c#">

but ,only show one usercontrol.
why?
Posted

You have to add your code that add dynamically a new user control into Page_Init() event method and not in Page_Load().
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900