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.
!OnPreRender ( Render).
, , - Mitchel Sellers, runat :
HtmlGenericControl x = new HtmlGenericControl("script"); x.InnerText = GetScriptSection(); Page.Header.Controls.Add(x);
, !
, , .
, " ", , , script "head" , runat = "server", Head.
MSDN registerclientscriptblock :
script object < form runat = server > . script , , <script> .
, .
, :
runat = "server",
<form id="theform" runat="server">
HTML- .
Source: https://habr.com/ru/post/1702246/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1702241/upload-images-to-sql-server-2005-using-aspnet-mvc&usg=ALkJrhgN9IysdHW1owcERYkd8HJ3UN7TJgКак обнаружить восстановление элемента в событии ItemAdded() в SharePoint - eventsКак выполнить захват вызова Xperf на 64-битной ОС? - performanceIs it possible to use svn: externals, ignoring external links for this url? - svnДолжен ли я fsck ext3 на встроенной системе? - linuxmysql nested insert for tagging - mysqlHow do you deal with exceptions in UserControls when using .net Winform Designer? - .netJPA: "SELECT DISTINCT" with BLOB columns - javaПроблема с получением выделенного текста при использовании кнопки спринтера и selection.createRange() в Internet Explorer - javascriptHow to efficiently process and process video streams using a GPU? - gpuAll Articles