Wrox Programmer Forums
|
BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6
This is the forum to discuss the Wrox book Professional DotNetNuke ASP.NET Portals by Shaun Walker, Patrick J. Santry, Joe Brinkman, Dan Caron, Scott McCulloch, Scott Willhite, Bruce Hopkins; ISBN: 9780764595639
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2007, 06:37 AM
Registered User
 
Join Date: Dec 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Client Side Script not working in DNN

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



 
Old December 16th, 2008, 06:01 AM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

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.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"
 
Old February 27th, 2009, 03:06 PM
Registered User
 
Join Date: Feb 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please post error_log so that we can locate problem

______________________________________________

Php Web Hosting from $3.99/month





Similar Threads
Thread Thread Starter Forum Replies Last Post
Client Side Script Not Working sramesh ASP.NET 2.0 Basics 3 August 2nd, 2007 03:56 PM
Problem with client side script cschng Classic ASP Basics 2 May 23rd, 2005 12:43 AM
please help ping with client side script nlicata VBScript 0 June 10th, 2004 01:44 AM





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