I at asp.net many times call js method & # xff08; Don't use the button click way & # xff09; & # xff0c; Scenario is the background data updated activate the foreground refresh the page
ClientScript. RegisterStartupScript executed only once & # xff08; The key is a variable & # xff09;
js method & # xff1a;
the function test (tt)
{
Alert (& # 39; The test & # 39; & # 43; Tt);
}
private static void Data_Monitor ()
{
Using (SqlConnection connection & # 61; New SqlConnection (_connStr))
{
String mntSql & # 61; & # 34; Select ID, BH, MONITOR_DT MONITOR_VALUE From [dbo] [MONITOR_REALTIME] & # 34;;
Using (SqlCommand command & # 61; New SqlCommand (mntSql, connection))
{
Command.Com mandType & # 61; CommandType. Text;
Connection. The Open ();
SqlDependency dependency & # 61; New SqlDependency (command);
The dependency. OnChange & # 43; The & # 61; New OnChangeEventHandler (dependency_OnChange);
The command. ExecuteNonQuery ();
CurrentPage. ClientScript. RegisterStartupScript (currentPage. GetType (), & # 34; Js & # 34; & # 43; JsCount. ToString (), & # 34; <script> The test (111); </script> & # 34;);
JsCount & # 43; & # 43;;
}
}
}
currentPage. ClientScript. RegisterStartupScript (currentPage. GetType (), & # 34; Js & # 34; & # 43; JsCount. ToString (), & # 34; <script> The test (111); </script> & # 34;); Only do a
if in button_click point a button to perform a
could you tell me who encountered similar problems & # xff1f; Thank you