Probably another easy one but I can't figure out why it's giving me this error.
Compiler Error Message: BC30451: Name 'FilterSelect' is not declared.
Source Error:
Line 89: Sub Filter_Action(sender As Object, e As EventArgs)
Line 90:
Line 91: sFilterID = FilterSelect.SelectedItem.Value
Line 92:
Line 93: If sFilterID <> "" Then
Source File: F:\WSD\DOX\text.aspx Line: 91
Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705.288
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
F:\WSD\DOX\text.aspx(91) : error BC30451: Name 'FilterSelect' is not declared.
Line 1: '------------------------------------------------------------------------------
Line 2: ' <autogenerated>
Line 3: ' This code was generated by a tool.
Line 4: ' Runtime Version: 1.0.3705.288
Line 5: '
Line 6: ' Changes to this file may cause incorrect behavior and will be lost if
Line 7: ' the code is regenerated.
Line 8: ' </autogenerated>
Line 9: '------------------------------------------------------------------------------
Line 10:
Line 11: Option Strict Off
Line 12: Option Explicit On
Line 13:
Line 14: Imports Microsoft.VisualBasic
Line 15: Imports System
Line 16: Imports System.Collections
Line 17: Imports System.Collections.Specialized
Line 18: Imports System.Configuration
Line 19: Imports System.Data
Line 20: Imports System.Data.SqlClient
Line 21: Imports System.Text
Line 22: Imports System.Text.RegularExpressions
Line 23: Imports System.Web
Line 24: Imports System.Web.Caching
Line 25: Imports System.Web.Security
Line 26: Imports System.Web.SessionState
Line 27: Imports System.Web.UI
Line 28: Imports System.Web.UI.HtmlControls
Line 29: Imports System.Web.UI.WebControls
Line 30:
Line 31: Namespace ASP
Line 32:
Line 33: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _
Line 34: Public Class text_aspx
Line 35: Inherits System.Web.UI.Page
Line 36: Implements System.Web.SessionState.IRequiresSessionState
Line 37:
Line 38: Private Shared __autoHandlers As Integer
Line 39:
Line 40: Private Shared __intialized As Boolean = false
Line 41:
Line 42: Private Shared __stringResource As Object
Line 43:
Line 44: Private Shared __fileDependencies As System.Collections.ArrayList
Line 45:
Line 46:
Line 47: #ExternalSource("F:\WSD\DOX\text.aspx",9)
Line 48:
Line 49:
Line 50: Public dtrSource As SqlDataReader
Line 51: Public cmdSelectSource As SqlCommand
Line 52: Public sPageID, sNameID, sTitleID, sFilterID as String
Line 53:
Line 54: Sub Load_Page()
Line 55:
Line 56: Dim sFilePath, sAuthorName, sWorksTitle, sNLink, sTLink, sRecordField as String
Line 57:
Line 58: sPageID = Request.QueryString("page_id")
Line 59: sNameID = Request.QueryString("name_id")
Line 60: sTitleID = Request.QueryString("title_id")
Line 61: sFilterID = Request.QueryString("filter_id")
Line 62:
Line 63: If sPageID <> "" And sNameID = "" Then
Line 64: Response.Write("<table width=""300"" border=""1"" align=""center"" cellpadding=""5"" cellspacing=""2"" class=""tbllists"">")
Line 65: Call Run_Query()
Line 66: While dtrSource.Read()
Line 67: sAuthorName = dtrSource("Name")
Line 68: sNLink = dtrSource("NLink")
Line 69: Response.Write("<tr><td>" + "<a href = ""text.aspx?page_id=" + sPageID + "&name_id=" + sNLink + "&order_id=Title"">" + sAuthorName + "</a>" + "</td></tr>")
Line 70: End While
Line 71: dtrSource.Close()
Line 72: cmdSelectSource.connection.close
Line 73: Response.Write("</table>")
Line 74: ElseIf sPageID <> "" And sNameID <> "" And sTitleID = "" Then
Line 75: Response.Write("<table width=""300"" border=""1"" align=""center"" cellpadding=""5"" cellspacing=""2"" class=""tbllists"">")
Line 76: Call Run_Query()
Line 77: While dtrSource.Read()
Line 78: sWorksTitle = dtrSource("Title")
Line 79: sTLink = dtrSource("TLink")
Line 80: sNLink = dtrSource("NLink")
Line 81: Response.Write("<tr><td>" + "<a href = ""text.aspx?page_id=" + sPageID + "&name_id=" + sNLink + "&title_id=" + sTLink + """>" + sWorksTitle + "</td></tr>" + "</a>")
Line 82: End While
Line 83: dtrSource.Close()
Line 84: cmdSelectSource.connection.close
Line 85: Response.Write("</table>")
Line 86: ElseIf sPageID <> "" And sNameID <> "" And sTitleID <> "" Then
Line 87: sFilePath = "txt/" + sNameID + "/" + sTitleID + ".html"
Line 88: Server.Execute(sFilePath)
Line 89: End If
Line 90:
Line 91: End Sub
Line 92:
Line 93: Public Sub Run_Query()
Line 94: Dim conText As SqlConnection
Line 95:
Line 96:
Line 97: conText = New SQLConnection("Server=DOX;Database=integration;User ID=sa;Password=")
Line 98: conText.Open()
Line 99:
Line 100: If sPageID <> "" And sNameID = "" Then
Line 101: cmdSelectSource = New SqlCommand( "SELECT Distinct dbo.tblTextSource.Name, dbo.tblTextTitles.Type, dbo.tblTextSource.Nlink FROM dbo.tblTextSource INNER JOIN dbo.tblTextTitles ON dbo.tblTextSource.ID = dbo.tblTextTitles.Source WHERE dbo.tblTextSource.Name Like '" & sFilterID & "%' And dbo.tblTextTitles.Type = '" & sPageID & "' ORDER BY dbo.tblTextSource.Name", conText)
Line 102: dtrSource = cmdSelectSource.ExecuteReader()
Line 103: Elseif sPageID <> "" And sNameID <> "" Then
Line 104: cmdSelectSource = New SqlCommand( "SELECT dbo.tblTextSource.Nlink, dbo.tblTextTitles.Title, dbo.tblTextTitles.Type, dbo.tblTextTitles.Tlink FROM dbo.tblTextSource INNER JOIN dbo.tblTextTitles ON dbo.tblTextSource.ID = dbo.tblTextTitles.Source WHERE dbo.tblTextTitles.Title Like '" & sFilterID & "%' And dbo.tblTextSource.NLink = '" & sNameID & "' AND dbo.tblTextTitles.Type = '" & sPageID & "' ORDER BY dbo.tblTextTitles.Title", conText)
Line 105: dtrSource = cmdSelectSource.ExecuteReader()
Line 106: End If
Line 107:
Line 108: End Sub
Line 109:
Line 110: Sub Filter_Module()
Line 111:
Line 112: If sTitleID = "" Then
Line 113: With Response
Line 114: .Write("<asp:dropdownlist AutoPostBack=""true"" runat=""server"" ID=""FilterSelect"" onSelectedIndexChanged=""Filter_Action"">")
Line 115:
Line 116: .Write("<asp:ListItem value=""[a-z]"" selected=""True""> A-Z </asp:ListItem>")
Line 117: .Write("<asp:ListItem value=""[a-g]"" selected=""True""> A-G </asp:ListItem>")
Line 118: .Write("<asp:ListItem value=""[h-l]"" selected=""True""> H-L </asp:ListItem>")
Line 119: .Write("<asp:ListItem value=""[m-q]"" selected=""True""> M-Q </asp:ListItem>")
Line 120: .Write("<asp:ListItem value=""[r-z]"" selected=""True""> R-Z </asp:ListItem>")
Line 121:
Line 122: .Write("</asp:dropdownlist>")
Line 123: End With
Line 124: End If
Line 125:
Line 126: End Sub
Line 127:
Line 128: Sub Filter_Action(sender As Object, e As EventArgs)
Line 129:
Line 130: sFilterID = FilterSelect.SelectedItem.Value
Line 131:
Line 132: If sFilterID <> "" Then
Line 133: Response.Redirect("text.aspx?page_id=" + sPageID + "&name_id=" + sNameID + "&filter_id=" + sFilterID)
Line 134: End If
Line 135:
Line 136: End Sub
Line 137:
Line 138:
I think it was the Response.Write of the ASP Controls that screwed up the code stack. I found an alternative for what I wanted to do and the problem is fixed.
Bookmarks