<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ChatWindow.ascx.cs" Inherits="ChatWindow" %> <div style="width: 211px;border:thick solid #ffa800"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> Hi <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>..<br /> <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Height="172px" Width="186px"></asp:TextBox><br /><br /> <asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick" Enabled="true"> </asp:Timer> </ContentTemplate></asp:UpdatePanel> </div> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" Width="148px"></asp:TextBox> <asp:Button ID="BtnSend" runat="server" onclick="BtnSend_Click" Text="Send" /> </ContentTemplate> </asp:UpdatePanel>
protected void craetecontrols() // this function is in main page in which i am adding above user control { foreach (DictionaryEntry obj in arr) { Panel p1 = new Panel(); p1.ID = "PanelChat" + obj.Key.ToString(); ChatWindow mycontrol = (ChatWindow)LoadControl("~/ChatWindow.ascx"); mycontrol.ID = "ChWId" + obj.Key.ToString(); p1.Controls.Add(mycontrol); p1.Style.Add("position", " absolute"); p1.Style.Add("bottom", "0"); p1.Style.Add("right", obj.Value.ToString()); UpdatePanel4.ContentTemplateContainer.Controls.Add(p1); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)