Results 1 to 10 of 10

Thread: [2005] Problem creating web control

Threaded View

  1. #1

    Thread Starter
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Angry [2005] Problem creating web control

    ok here's what i'm trying to do

    here's my control that i'm trying to make, i want the filters to work along the lines of how the SelectParameters do in the SqlDataSource. the problem is the designer keeps telling me that the cssi:AdHocQueryFilter is an unknown server tag.
    HTML Code:
    <cssi:AdHocQueryBuilder ID="AdHocQueryBuilder1" runat="server">
                    <Filters>
                        <cssi:AdHocQueryFilter DataType="dateTime" FieldName="dd" DisplayName="dfs" />
                    </Filters>
                </cssi:AdHocQueryBuilder>
                
                <asp:SqlDataSource ID="SqlDataSource1" runat="server">
                    <SelectParameters>
                        <asp:Parameter Name="xxx" DefaultValue="ddd" />
                    </SelectParameters>
                </asp:SqlDataSource>
    here's the code for the AdHocQueryFilter class

    vb Code:
    1. Imports System.Web.UI
    2. Imports System.Collections
    3. Namespace UI.WebControls.AdHocQuery
    4.  
    5.     <ToolboxData("<{0}:AdHocQueryFilter />")> _
    6.     Public Class AdHocQueryFilter
    7.         Implements IStateManager
    8.  
    9.         Private m_IsTrackingViewState As Boolean
    10.         Private m_ViewState As StateBag
    11.  
    12.         <PersistenceMode(PersistenceMode.Attribute)> _
    13.         <System.ComponentModel.NotifyParentProperty(True)> _
    14.         Public Property DisplayName() As String
    15.             Get
    16.                 Dim value As Object = ViewState("DisplayName")
    17.                 Return IIf(value IsNot Nothing, value, String.Empty)
    18.             End Get
    19.             Set(ByVal value As String)
    20.                 ViewState("DisplayName") = value
    21.             End Set
    22.         End Property
    23.  
    24.         <PersistenceMode(PersistenceMode.Attribute)> _
    25.         <System.ComponentModel.NotifyParentProperty(True)> _
    26.         Public Property FieldName() As String
    27.             Get
    28.                 Dim value As Object = ViewState("FieldName")
    29.                 Return IIf(value IsNot Nothing, value, String.Empty)
    30.             End Get
    31.             Set(ByVal value As String)
    32.                 ViewState("FieldName") = value
    33.             End Set
    34.         End Property
    35.  
    36.         <PersistenceMode(PersistenceMode.Attribute)> _
    37.         <System.ComponentModel.NotifyParentProperty(True)> _
    38.         Public Property DataType() As System.TypeCode
    39.             Get
    40.                 Dim value As Object = ViewState("DataType")
    41.                 Return IIf(value IsNot Nothing, value, TypeCode.Empty)
    42.             End Get
    43.             Set(ByVal value As System.TypeCode)
    44.                 ViewState("DataType") = value
    45.             End Set
    46.         End Property
    47.  
    48.         Public Sub SetDirty()
    49.             Me.ViewState.SetDirty(True)
    50.         End Sub
    51.  
    52.         Protected Overridable ReadOnly Property ViewState() As StateBag
    53.             Get
    54.                 If m_ViewState Is Nothing Then
    55.                     m_ViewState = New StateBag(False)
    56.                     If m_IsTrackingViewState Then
    57.                         DirectCast(m_ViewState, IStateManager).TrackViewState()
    58.                     End If
    59.                 End If
    60.                 Return m_ViewState
    61.             End Get
    62.         End Property
    63.  
    64.         <System.ComponentModel.Browsable(False)> _
    65.         Public ReadOnly Property IsTrackingViewState() As Boolean Implements System.Web.UI.IStateManager.IsTrackingViewState
    66.             Get
    67.                 Return m_IsTrackingViewState
    68.             End Get
    69.         End Property
    70.  
    71.         Public Sub LoadViewState(ByVal state As Object) Implements System.Web.UI.IStateManager.LoadViewState
    72.             If state IsNot Nothing Then
    73.                 DirectCast(ViewState, IStateManager).LoadViewState(state)
    74.             End If
    75.         End Sub
    76.  
    77.         Public Function SaveViewState() As Object Implements System.Web.UI.IStateManager.SaveViewState
    78.             Dim retval As Object = Nothing
    79.             If m_ViewState IsNot Nothing Then
    80.                 retval = DirectCast(m_ViewState, IStateManager).SaveViewState
    81.             End If
    82.             Return retval
    83.         End Function
    84.  
    85.         Public Sub TrackViewState() Implements System.Web.UI.IStateManager.TrackViewState
    86.             m_IsTrackingViewState = True
    87.             If m_ViewState IsNot Nothing Then
    88.                 DirectCast(m_ViewState, IStateManager).TrackViewState()
    89.             End If
    90.         End Sub
    91.  
    92.     End Class
    93.  
    94. End Namespace
    Last edited by vbdotnetboy; Aug 19th, 2008 at 11:11 AM. Reason: Reopening

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width