Could someone possibly help me.
I have an aspx page that I need to produce Javascript on once a search is performed on data.
I have an ajax manager and have set the controls to update, however, I cannot get this routine on the server side to create the javascript on the page. If I do not use the ajax manager, it works fine.
This is the string that I need to write to the page (return), once a gridview updates.
I have tried the following methods with no luck:
I have an aspx page that I need to produce Javascript on once a search is performed on data.
I have an ajax manager and have set the controls to update, however, I cannot get this routine on the server side to create the javascript on the page. If I do not use the ajax manager, it works fine.
This is the string that I need to write to the page (return), once a gridview updates.
myStringScript = "<script type=""text/javascript"">" & vbCrLf & _ | |
"<!--" & vbCrLf & _ | |
String.Concat("var CheckBoxIDs = new Array(", String.Join(",", ArrayValuesAttend.ToArray()), ");") & vbCrLf & _ | |
"// -->" & vbCrLf & _ | |
"</script>" |
I have tried the following methods with no luck:
CheckBoxIDsArrayAttend.Text = myStringScript
(CheckBoxIDsArrayAttend is a literal control, and is also being updated by the ajax manager.)
-------------------------
TryCast(RadCodeBlock1.Controls(0), LiteralControl).Text = myStringScript
--------------------------
Page.ClientScript.RegisterStartupScript(Page.GetType(), "scr", myStringScript)
-------------------------------
None of these work. The Javascript just does not show up on the page after update (I can look for it when I view source on the page)
Any Ideas?
Thanks for your help.