Question Passing Dataset to User Web Control

bcorbett

Active member
Joined
Oct 16, 2006
Messages
27
Programming Experience
Beginner
I have a web user control that has the following properties



VB.NET:
Dim ds As DataSet
Dim EditPage As String
    'Properties
    Public Property PropDS() As DataSet
        Get
            Return Me.ds
        End Get
        Set(ByVal Value As DataSet)
            ds = Value
        End Set
    End Property
    Public Property PropEditPage() As String
        Get
            Return EditPage
        End Get
        Set(ByVal Value As String)
            EditPage = Value
        End Set
    End Property
But when I try and access the properties from an ASPX page. It says the control is not declared. Here is the Source:


Code:
VB.NET:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="TestDgrid.aspx.vb" Inherits="TestDgrid" title="Untitled Page" %>

<%@ Register Src="Dgrid.ascx" TagName="Dgrid" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">         

<uc1:Dgrid id="Dgrid1" name="Dgrid1" runat="server">        
</uc1:Dgrid>  

</asp:Content>

so if I try and do something like this it errors out:



VB.NET:
Dim ds as dataset = new Dataset
ds = Getdataset("Select * from Product") 
Dgrid1.PropDS = ds

Any Help would be appreciated!!! Thanks!
 
Back
Top