Link to home
Start Free TrialLog in
Avatar of shwaqar82
shwaqar82

asked on

BC30451 Error

Hi

Im using Dreamweaver 8 to develop aspx file using version 1.1 for dot net framework. I recieving error on line:

Compiler Error Message: BC30451: Name 'ddlGateway' is not declared.

Source Error:
Line 29:                 Dim nodeGateway As XmlNode
Line 30:                 For Each nodeGateway In nodeListGateway
Line 31:                     ddlGateway.Items.Add(New ListItem(nodeGateway.SelectSingleNode("NAME").InnerText, nodeGateway.SelectSingleNode("CODE").InnerText))
Line 32:                 Next
Line 33:                         End If

I have following rropusaspx file:

<%@ Page Language="VB" src="gropus.aspx.vb" Inherits="GroupInfo"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Group</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList ID="ddlGateway" runat="server" Width="240px" AutoPostBack="True"></asp:DropDownList>
</form>
</body>
</html>



I have the following gropus.aspx.vb file
Imports System
Imports System.Xml
Imports System.Text
Imports System.Net
Imports System.IO
Imports System.String
Imports System.Data
Imports System.Exception
Imports System.Web.UI.WebControls

Class GroupInfo
      Inherits System.Web.UI.Page
      
Public Sub Page_Init()
            'Dim ddlGateway As DropDownList()
            Dim ddlGateway As new DropDownList()
End Sub
      
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
          Try
            If Not Page.IsPostBack Then
                Dim docGateway As XmlDocument = New XmlDocument()
                docGateway.Load(Server.MapPath("//Gateway.xml"))
                Dim nodeListGateway As XmlNodeList = docGateway.SelectNodes("//GATEWAYS/GATEWAY")
                Dim nodeGateway As XmlNode
                For Each nodeGateway In nodeListGateway
                    ddlGateway.Items.Add(New ListItem(nodeGateway.SelectSingleNode("NAME").InnerText, nodeGateway.SelectSingleNode("CODE").InnerText))
                Next
                        End If
        Catch er As XmlException
            Response.Write(er.ToString)
        Catch er As HttpException
            Response.Write(er.ToString)
        Catch er As Exception
            Response.Write(er.ToString)
        End Try
    End Sub
End class


 
ASKER CERTIFIED SOLUTION
Avatar of Rouchie
Rouchie
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial