Hello,
I'm trying to get some Client Side script working in my DNN module.
It works fine in a .aspx page but when I add it to my .ascx module it stops working.
Basically it populates a dropdownlist from a SQL dB.
Thnx for looking
<%@ Import Namespace="System.Data.SQLClient" %>
<%@ Import Namespace="System.Data" %>
<script language="
VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
Dim SQLConn As SQLConnection
Dim SQLComm As SQLCommand
Dim oReader As SQLDataReader
Dim sSQL As String
Dim sConn As String
sSQL = "SELECT * from CN_Policy_Types"
sConn = "Server=localhost;Database=**;uid=**;pwd=**;"
SQLConn = New SQLConnection(sConn)
SQLConn.Open()
SQLComm = New SQLCommand(sSQL, SQLConn)
oReader = SQLComm.ExecuteReader()
ddlReason.DataSource = oReader
ddlReason.DataBind()
End If
End Sub
</script>
<asp:DropDownList ID="ddlReason" DataTextField="CN_PolicyName_Nvarchar" DataValueField="CN_PolicyDateIncrement_int" Runat="server" AutoPostBack="True"/>