0

I'm just going to post my pages here if someone will take a look and let me know where to go from here...sorry, I could have attached files if you would prefer.

I am not sure what needs to be in my VB page if anything more is required nor am I clear that my connection string is carrying through to the WebService correctly. Also I am trying to link cascading dropdown list to filter items. I don't really even know if the database is getting hit, but I see no errors, just empty DDL.

I am so screwed up I don't even know how best to formulate my issues, I am lost in limbo, can't move forward and can't start over.

Please don't hesitate to critique my post's method, format and or syntax, even if you just don't like it vague.

ASPX page:

<%@ Page Language="VB" AutoEventWireup="false" EnableEventValidation="false" CodeFile="DRW.aspx.vb" inherits = "filterflow_Default" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Input Inventory selection criteria</title>

</head>
<body>        
 
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
    </div>
     <h3>Please Select Working Criteria:</h3>
    <h3>
        <asp:Label ID="LblLeveL" runat="server" Text="Label" ></asp:Label>
        &nbsp;&nbsp;&nbsp;
        
        <asp:Label ID="LblGEO" runat="server" Text="Label" ></asp:Label>
        &nbsp;&nbsp;&nbsp;
        
        <asp:Label ID="LblWY" runat="server" Text="Label" ></asp:Label>
        &nbsp;&nbsp;&nbsp;
        
        <asp:Label ID="LblSPG" runat="server" Text="Label" ></asp:Label>
        &nbsp;&nbsp;&nbsp;
       
        <asp:Label ID="LblFLOW" runat="server" Text="Label" ></asp:Label>
    </h3>
     
 
        Select SPG:  <asp:DropDownList ID="ddlSPG" runat="server" 
        DataSourceID="SqlDataSource1" /><br />
        Select FLOW:  <asp:DropDownList ID="ddlFLOW" runat="server" /><br />
 
        <ajaxToolkit:CascadingDropDown 
            id="CascadingDropDown1" 
            runat="server"
            category="SPG"
            prompttext="Select a Conference..."
            ServiceMethod="GetSPG"
            ServicePath="DRWebSvc.asmx"
            TargetControlId="ddlSPG"
        />
 
        <ajaxToolkit:CascadingDropDown 
            id="CascadingDropDown2" 
            runat="server" 
            category="FLOW"
            prompttext="Select a family..." 
            ServiceMethod="GetFLOW" 
            ServicePath="DRWebSvc.asmx"
            TargetControlId="ddlFLOW"
            ParentControlID="ddlSPG"
        />
 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:INVArchiveConnectionString %>" 
        SelectCommand="SELECT DISTINCT * FROM [tbl_Product]">
    </asp:SqlDataSource>
            

            &nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Submit" runat="server" Text="Submit Selection" />
 
    </form>
</body>
</html>

ASPX.VB CodeFile:

Partial Class filterflow_Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        LblLeveL.Text = "DM"
        LblGEO.Text = "US&C"
        '      ddlWM.Text = Today.ToString("MMM")
        LblWY.Text = "2010"
        LblSPG.Text = "Capture"
        LblFLOW.Text = "Consumer"


    End Sub

End Class

ASMX WebSvc:

<%@ WebService Language="VB" CodeBehind="DRW.aspx.vb" Class ="filterflow" %>

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Collections
Imports System.Collections.Generic
Imports System.Collections.Specialized
Imports AjaxControlToolkit
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration


' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://nerdliness.com/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class filterflow
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetSPG(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
        Dim strConnection As String = ConfigurationManager.ConnectionStrings("INVArchiveConnectionString").ConnectionString
        Dim sqlConn As SqlConnection = New SqlConnection(strConnection)
        Dim strSPGQuery As String = "SELECT DISTINCT * FROM tbl_Products"
        Dim cmdFetchSPG As SqlCommand = New SqlCommand(strSPGQuery, sqlConn)

        Dim dtrSPG As SqlDataReader
        Dim mySPGs As New List(Of CascadingDropDownNameValue)

        sqlConn.Open()
        dtrSPG = cmdFetchSPG.ExecuteReader

        While dtrSPG.Read()
            Dim strSPGName As String = dtrSPG("SPG_name").ToString
            Dim strSPGId As String = dtrSPG("SPG_id").ToString

            mySPGs.Add(New CascadingDropDownNameValue(strSPGName, strSPGId))
        End While

        Return mySPGs.ToArray
    End Function

    <WebMethod()> _
    Public Function GetFLOW(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
        Dim strConnection As String = ConfigurationManager.ConnectionStrings("INVArchiveConnectionString").ConnectionString
        Dim sqlConn As SqlConnection = New SqlConnection(strConnection)
        Dim strTeamQuery As String = "SELECT DISTINCT * FROM tbl_Products WHERE SPG = @SPG"
        Dim cmdFetchTeam As SqlCommand = New SqlCommand(strTeamQuery, sqlConn)

        Dim dtrFLOW As SqlDataReader
        Dim kvFLOW As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
        Dim intFLOWId As Integer

        If Not kvFLOW.ContainsKey("SPG") Or Not Int32.TryParse(kvFLOW("SPG"), intFLOWId) Then
            Return Nothing
        End If

        cmdFetchTeam.Parameters.AddWithValue("@SPG", intFLOWId)
        Dim myFLOWs As New List(Of CascadingDropDownNameValue)

        sqlConn.Open()
        dtrFLOW = cmdFetchTeam.ExecuteReader

        If Not kvFLOW.ContainsKey("Conference") Or Not Int32.TryParse(kvFLOW("Conference"), intFLOWId) Then
            Return Nothing
        End If

        While dtrFLOW.Read()
            Dim strFLOWName As String = dtrFLOW("FLOW_NAME").ToString
            Dim strFLOWId As String = dtrFLOW("FLOW_id").ToString

            myFLOWs.Add(New CascadingDropDownNameValue(strFLOWName, strFLOWId))
        End While

        Return myFLOWs.ToArray
    End Function

    <WebMethod()> _
    Public Function GetPlayers(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
        Dim strConnection As String = ConfigurationManager.ConnectionStrings("nerdlinessConnection").ConnectionString
        Dim sqlConn As SqlConnection = New SqlConnection(strConnection)
        Dim strPlayerQuery As String = "SELECT * FROM PLAYER WHERE team_id = @teamid"
        Dim cmdFetchPlayer As SqlCommand = New SqlCommand(strPlayerQuery, sqlConn)

        Dim dtrPlayer As SqlDataReader
        Dim kvPlayer As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)

        Dim intTeamId As Integer

        If Not kvPlayer.ContainsKey("Team") Or Not Int32.TryParse(kvPlayer("Team"), intTeamId) Then
            Return Nothing
        End If

        cmdFetchPlayer.Parameters.AddWithValue("@teamid", intTeamId)

        Dim myPlayers As New List(Of CascadingDropDownNameValue)

        sqlConn.Open()
        dtrPlayer = cmdFetchPlayer.ExecuteReader
        
        
        Dim kvTeam As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
        Dim intConfId As Integer
        If Not kvPlayer.ContainsKey("Team") Or Not Int32.TryParse(kvPlayer("Team"), intConfId) Then
            Return Nothing
        End If

        While dtrPlayer.Read()
            Dim strPlayerName As String = dtrPlayer("player_name").ToString
            Dim strPlayerId As String = dtrPlayer("player_id").ToString

            myPlayers.Add(New CascadingDropDownNameValue(strPlayerName, strPlayerId))
        End While

        Return myPlayers.ToArray
    End Function

End Class

Web CONFIG:

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<configSections>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
	</configSections>
	<connectionStrings>
    <add name="INVArchiveConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=&quot;C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\INVArchive.mdf&quot;;Integrated Security=True;Connect Timeout=30;User Instance=True"
        providerName="System.Data.SqlClient" />
    </connectionStrings>
	<system.web>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
        -->
		<compilation debug="false" strict="false" explicit="true">
			<assemblies>
				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
		</compilation>
		<pages>
			<namespaces>
				<clear/>
				<add namespace="System"/>
				<add namespace="System.Collections"/>
				<add namespace="System.Collections.Generic"/>
				<add namespace="System.Collections.Specialized"/>
				<add namespace="System.Configuration"/>
				<add namespace="System.Text"/>
				<add namespace="System.Text.RegularExpressions"/>
				<add namespace="System.Linq"/>
				<add namespace="System.Xml.Linq"/>
				<add namespace="System.Web"/>
				<add namespace="System.Web.Caching"/>
				<add namespace="System.Web.SessionState"/>
				<add namespace="System.Web.Security"/>
				<add namespace="System.Web.Profile"/>
				<add namespace="System.Web.UI"/>
				<add namespace="System.Web.UI.WebControls"/>
				<add namespace="System.Web.UI.WebControls.WebParts"/>
				<add namespace="System.Web.UI.HtmlControls"/>
			</namespaces>
			<controls>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			</controls>
		</pages>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Windows"/>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
		<httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
		</httpHandlers>
		<httpModules>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</httpModules>
	</system.web>
	<system.codedom>
		<compilers>
			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
			<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="OptionInfer" value="true"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
		</compilers>
	</system.codedom>
	<!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<modules>
			<remove name="ScriptModule"/>
			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-Integrated"/>
			<remove name="ScriptHandlerFactory"/>
			<remove name="ScriptHandlerFactoryAppServices"/>
			<remove name="ScriptResource"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</handlers>
	</system.webServer>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
</configuration>
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by miweiser
0

That's essentially where I got this code from...albeit converted from C#.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.