Yes
<div runat="server"></div>
will make it server-side. You can generate it in code using
var myDiv = new HtmlGenericControl("div");
Edit: what you create is a server-side control, there is no need to add runat="server" .
Change per comment:
<div onclick="alert('hello')" runat="server"></div>
or
var myDiv = new HtmlGenericControl("div"); myDiv.Attributes.Add("onclick", "alert('hello');");
Yuriy faktorovich
source share