I need to define a button in code to open a window
This is the code I'm using
Dim img As ImageButton
For x = 0 To weekcolour.GetUpperBound(0)
columnname = "ColumnITask" + (x + 1).ToString
imagename = "btnEx" + (x + 1).ToString
If Not (img Is Nothing) Then
img.ImageUrl = "/private/images/" + weekcolour(x) + "_light_ilp.png"
If weekcolour(x).Contains("green") Then
img.OnClientClick = "openRadWindow('<%# DataBinder.Eval(Container.DataItem,'" + student_id + "') %>'); return false; > """
End If
End If
next
The code updates the image url correctly but does not add the onClientCick event
It still does not work if I remove the "if" statement
This is my open window script
This is the code I'm using
Dim img As ImageButton
For x = 0 To weekcolour.GetUpperBound(0)
columnname = "ColumnITask" + (x + 1).ToString
imagename = "btnEx" + (x + 1).ToString
If Not (img Is Nothing) Then
img.ImageUrl = "/private/images/" + weekcolour(x) + "_light_ilp.png"
If weekcolour(x).Contains("green") Then
img.OnClientClick = "openRadWindow('<%# DataBinder.Eval(Container.DataItem,'" + student_id + "') %>'); return false; > """
End If
End If
next
The code updates the image url correctly but does not add the onClientCick event
It still does not work if I remove the "if" statement
This is my open window script
<script type="text/javascript"><br><br> function openRadWindow(StudentID) {<br> var oWnd = radopen("task_update.aspx?StudentID=" + StudentID, "RadWindow1");<br> oWnd.center();<br> }<br> </script>