May 27, 2019 01:56 AM|Fei Han - MSFT|LINK
Glad to hear that you solved the problem by yourself, and thanks for sharing the solution.
have added the runat=server tag
If you added id and runat=server attributes to tag(s), you will be able to access it from code behind.
Besides, to assign text to div tag, we can use
err.InnerHtml = "your_text_here";
err.InnerText = "your_text_here";