RegisterClientScriptBlock without a form tag

Trying to understand why the client code is not displayed on the page (using the user control), I found a link, it turns out you must have a form tag for it to work ( Page.RegisterClientScriptBlock announced this, but the ClientScriptManager.RegisterClientScriptBlock that I use does not talks about it).
I am using Visual studio 2005.
Does anyone know if this has been resolved?

Edit :
To clarify, I want my control to add javascript code to the section of the page chapter without using

<form runat="server"

I tried to add it using:

HtmlGenericControl x = new HtmlGenericControl("script");
x.InnerText = "alert('123');";
Page.Header.Controls.Add(x);

But that did not work for me.

+3
4

!
OnPreRender ( Render).

, , - Mitchel Sellers, runat :

 HtmlGenericControl x = new HtmlGenericControl("script");
 x.InnerText = GetScriptSection();
 Page.Header.Controls.Add(x);

, !

+2

, , .

, " ", , , script "head" , runat = "server", Head.

+2

MSDN registerclientscriptblock :

script object < form runat = server > . script , , <script> .

, .

0

, :

runat = "server",

<form id="theform" runat="server">

HTML- .

0

Source: https://habr.com/ru/post/1702246/


All Articles