p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 (http://p2p.wrox.com/forumdisplay.php?f=179)
-   -   Client Side Script not working in DNN (http://p2p.wrox.com/showthread.php?t=64482)

rpdrake December 11th, 2007 06:37 AM

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"/>

msellers December 16th, 2008 06:01 AM

Do you get any error messages when you try to run it?

From what you show there there the list should populate.

A few notes though, you REALLY want to make sure that you are always closing the connection.

cveks February 27th, 2009 03:06 PM

please post error_log so that we can locate problem


Php Web Hosting from $3.99/month

All times are GMT -4. The time now is 11:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.