View Single Post
  #1 (permalink)  
Old December 11th, 2007, 06:37 AM
rpdrake rpdrake is offline
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Client Side Script not working in DNN


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)
            SQLComm = New SQLCommand(sSQL, SQLConn)
            oReader = SQLComm.ExecuteReader()

            ddlReason.DataSource = oReader
        End If
End Sub

<asp:DropDownList ID="ddlReason" DataTextField="CN_PolicyName_Nvarchar" DataValueField="CN_PolicyDateIncrement_int" Runat="server" AutoPostBack="True"/>