I am creating dynamic divs for incoming and outgoing messages for chat web app. and these dynamically created divs will be added in parent div. For this I have to acccess that parent div, then set ClientMode and Controls to that div. But I am having error at the name of div that "given element doesn't exist in current context"

code is given below:

message_history_Container.ClientIDMode = ClientIDMode.Static;
message_history_Container.Controls.Add(div);

message_history_Container is id of that parent div

0 Answers