Hey there, so i have a list of strings stored in a session (1 big list of names)
i would like to display these names in a javascript alertbox. i tried simple 'hello' and it worked. but then when i try to pass my session, the alert box does not display.
my code is below. please help guys thanks so much.
1.SESSION CONTAINS A LIST OF NAMES AS A STRING - POPULATED WITH ADIO.NET FROM SQL SERVER
2.BEHIND CODE
protected Sub ShowMessage(sender As Object, e As EventArgs)
Dim message As String = "alert('" + Session("linkedSP").ToString() + "')"
ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), "alert", message, True)
End Sub
3.HTML
<pre> <asp:ImageButton ID="imbtnview" Width="20px" ToolTip="View service providers already linked to this user" ImageUrl="~/images/view.png" runat="server" OnClick="ShowMessage"/>
What I have tried:
Page.ClientScript.RegisterStartupScript(Me.GetType(), "alert", "showAlert(" + Session("linkedSP").ToString() + ");", True)
dim message =
ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), "alert", message, True)