用户控件传入的参数VS提示我没有声明?为什么?
主页用户控件的注册:
<%@register tagprefix= "uc1 " tagname= "newlist " src= "newlist.ascx "%>
<%@ Page Language= "vb " AutoEventWireup= "false " Codebehind= "Default.aspx.vb " Inherits= "TheArticleSYS._Default "%>
用户控件的隐藏代码:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
'如果传入的参数不为空,则显示出文章信息
If aid <> " " Then
'Dim constr As String = "provider=microsoft.jet.oledb.4.0;data source= " + Server.MapPath( ". ") + "\Articlesys_db.mdb "
'Dim mycon As OleDb.OleDbConnection = New OleDb.OleDbConnection(constr)
Dim mysql As String
Dim constr As String = ConfigurationSettings.AppSettings( "constr ") & Server.MapPath( ". ") & ConfigurationSettings.AppSettings( "dbs ")
Dim mycon As OleDb.OleDbConnection = New OleDb.OleDbConnection(constr)
mysql = "select top 5 title,id,sdate from articles where akinds= " + aid + "order by id desc "
Try
Dim mycmd As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(mysql, mycon)
Dim dt As DataSet = New DataSet
mycmd.Fill(dt)
repeater1.DataSource = dt.Tables(0)
repeater1.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End If
End Sub
提示我aid没有声明!!
高手帮我看一下!谢谢!!
------解决方案--------------------你只是贴了个Page_Load,哪里声明什么aid了?