[ref][ref] >> >>'aspx vb code that incorporates the usercontrol >>Public Class ValidateLogin >> Inherits System.Web.UI.Page >> >>#Region " Web Form Designer Generated Code " >> >> 'This call is required by the Web Form Designer. >> Private[/ref] >Sub[ref] >>InitializeComponent() >> >> End Sub >> Protected WithEvents btnOK As >>System.Web.UI.WebControls.Button >> Protected WithEvents btnClear As >>System.Web.UI.WebControls.Button >> >> 'NOTE: The following placeholder declaration is >>required by the Web Form Designer. >> 'Do not delete or move it. >> Private designerPlaceholderDeclaration As[/ref] >System.Object[ref] >> >> Private Sub Page_Init(ByVal sender As[/ref][/ref] System.Object,[ref][ref] >>ByVal e As System.EventArgs) Handles MyBase.Init >> 'CODEGEN: This method call is required by the[/ref][/ref] Web[ref][ref] >>Form Designer >> 'Do not modify it using the code editor. >> InitializeComponent() >> End Sub >> >>#End Region >> >> Private strUserName As String >> Private exException As Exception() >> Protected ValidateLogin As >>YTCIWebUserControls.UserLogin >> >> Private Sub btnClear_Click(ByVal sender As >>System.Object, ByVal e As System.EventArgs) Handles >>btnClear.Click >> ValidateLogin.UserID = String.Empty >> ValidateLogin.Password = String.Empty >> End Sub >> >> Private Sub btnOK_Click(ByVal sender As[/ref] >System.Object,[ref] >>ByVal e As System.EventArgs) Handles btnOK.Click >> >> Dim strDataSource As String >> strDataSource = CType(Application >>("strDataSource"), String) >> >> Dim clsBLL As New NCVACBLL.Scheduling >>(strDataSource) >> Dim drOLEDBNCVAC As OleDbDataReader >> >> Try >> Cursor.Current = >>System.Windows.Forms.Cursors.WaitCursor >> drOLEDBNCVAC = clsBLL.GetUserInfo >>(ValidateLogin.UserID, ValidateLogin.Password) >>.. >>.. >>.. >>I'm really pulling my hair out over this one! I've[/ref][/ref] tried[ref][ref] >>so many different things to get this to work.... Can >>someone please HELP!! >> >>Thanks so much, >> >>Bill..... >>. >>[/ref] >. >[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <054001c36b71$8d211d60$a601280a@phx.gbl> [ref] => <041d01c36b5c$3ffd6440$a601280a@phx.gbl> <047501c36b62$217dde90$a601280a@phx.gbl> [htmlstate] => on_nl2br [postusername] => bill [ip] => wsyeager36@msn. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> usercontrol problem - ASP.NET General

usercontrol problem - ASP.NET General

When trying to run my web project, I get the following error: Pr Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific p error details and modify your source file appropriately. Pr Error Message: The base class includes the field 'ValidateLogin', but its type (YTCIWebUserControls.UserLogin) is not compatible with the type of control (ASP.UserLogin_ascx). Source Error: Line 13: <form id="Login" runat="server"> Line 14: <p></p> Line 15: <YTCI:LoginControl runat="server" id="ValidateLogin"></YTCI:LoginControl><BR> Line 16: <div align="center"> Line 17: <asp:button id="btnOK" runat="server" Text="OK"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source File: C:\Inetpub\wwwroot\NCVAC\logon.aspx Line: 15 All this is, is ...

  1. #1

    Default usercontrol problem

    When trying to run my web project, I get the following
    error:

    Pr Error
    Description: An error occurred during the parsing of a
    resource required to service this request. Please review
    the following specific p error details and modify your
    source file appropriately.

    Pr Error Message: The base class includes the
    field 'ValidateLogin', but its type
    (YTCIWebUserControls.UserLogin) is not compatible with the
    type of control (ASP.UserLogin_ascx).

    Source Error:


    Line 13: <form id="Login" runat="server">
    Line 14: <p></p>
    Line 15: <YTCI:LoginControl
    runat="server" id="ValidateLogin"></YTCI:LoginControl><BR>
    Line 16: <div align="center">
    Line 17: <asp:button
    id="btnOK" runat="server"
    Text="OK"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


    Source File: C:\Inetpub\wwwroot\NCVAC\logon.aspx Line:
    15



    All this is, is a usercontrol with a login screen as
    follows:

    'usercontrol html
    <% Control Language="vb" AutoEventWireup="false"
    Codebehind="UserLogin.ascx.vb"
    Inherits="YTCIWebUserControls.UserLogin"
    TargetSchema="http://schemas.microsoft.com/intellisense/ie5
    " %>
    <h3 align="center"><font face="Verdana">Logon Page</font>
    </h3>
    <table align="center">
    <tr>
    <td><asp:label id="lblUserID" Text="User
    ID:" Font-Bold="true" runat="server"></asp:label></td>
    <td><asp:textbox id="txtUserID"
    runat="server" MaxLength="20"></asp:textbox></td>
    <td><ASP:REQUIREDFIELDVALIDATOR
    id="vUserName" runat="server"
    ControlToValidate="txtUserID" ErrorMessage="UserID is
    required"

    Display="Static"></ASP:REQUIREDFIELDVALIDATOR></td>
    </tr>
    <tr>
    <td><asp:label id="lblPassword"
    Text="Password:" Font-Bold="true"
    runat="server"></asp:label></td>
    <td><asp:textbox id="txtPassword"
    runat="server" TextMode="Password"
    MaxLength="20"></asp:textbox></td>
    <td><ASP:REQUIREDFIELDVALIDATOR
    id="vUserPass" runat="server"
    ControlToValidate="txtPassword" ErrorMessage="Password is
    required"

    Display="Static"></ASP:REQUIREDFIELDVALIDATOR></td>
    </tr>
    <tr>
    <td>Persistent Cookie:</td>
    <td><ASP:CHECKBOX id="chkPersistCookie"
    runat="server" autopostback="false"></ASP:CHECKBOX></td>
    <td></td>
    </tr>
    </table>

    'usercontrol vb code

    Public MustInherit Class UserLogin
    Inherits System.Web.UI.UserControl

    #Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub
    InitializeComponent()

    End Sub
    Protected WithEvents vUserName As
    System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents vUserPass As
    System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents chkPersistCookie As
    System.Web.UI.WebControls.CheckBox
    Protected WithEvents lblMsg As
    System.Web.UI.WebControls.Label
    Protected WithEvents lblUserID As
    System.Web.UI.WebControls.Label
    Protected WithEvents txtUserID As
    System.Web.UI.WebControls.TextBox
    Protected WithEvents lblPassword As
    System.Web.UI.WebControls.Label
    Protected WithEvents txtPassword As
    System.Web.UI.WebControls.TextBox

    'NOTE: The following placeholder declaration is
    required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web
    Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Public Property UserID() As String
    Get
    UserID = txtUserID.Text
    End Get
    Set(ByVal Value As String)
    txtUserID.Text = Value
    End Set

    End Property

    Public Property Password() As String
    Get
    Password = txtPassword.Text
    End Get
    Set(ByVal Value As String)
    txtPassword.Text = Value
    End Set

    End Property

    Public Property PersistantCookie() As Boolean
    Get
    PersistantCookie = chkPersistCookie.Checked
    End Get
    Set(ByVal Value As Boolean)
    chkPersistCookie.Checked = Value
    End Set

    End Property

    End Class

    'aspx html that incorporates my usercontrol
    <% Register TagPrefix="YTCI" TagName="LoginControl"
    Src=".\UserControls\UserLogin.ascx" %>
    <% Page Language="vb" AutoEventWireup="false"
    Codebehind="Logon.aspx.vb" Inherits="NCVAC.ValidateLogin" % 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML>
    <HEAD>
    <title>Login</title>
    <meta content="Microsoft Visual
    Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1"
    name="CODE_LANGUAGE">
    <meta content="JavaScript"
    name="vs_defaultClientScript">
    <meta
    content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Login" runat="server">
    <p></p>
    <YTCI:LoginControl runat="server"
    id="ValidateLogin"></YTCI:LoginControl><BR>
    <div align="center">
    <asp:button id="btnOK"
    runat="server"
    Text="OK"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:button id="btnClear"
    runat="server" Text="Clear"></asp:button><br>
    </div>
    </form>
    </body>
    </HTML>

    'aspx vb code that incorporates the usercontrol
    Public Class ValidateLogin
    Inherits System.Web.UI.Page

    #Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub
    InitializeComponent()

    End Sub
    Protected WithEvents btnOK As
    System.Web.UI.WebControls.Button
    Protected WithEvents btnClear As
    System.Web.UI.WebControls.Button

    'NOTE: The following placeholder declaration is
    required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web
    Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Private strUserName As String
    Private exException As Exception()
    Protected ValidateLogin As
    YTCIWebUserControls.UserLogin

    Private Sub btnClear_Click(ByVal sender As
    System.Object, ByVal e As System.EventArgs) Handles
    btnClear.Click
    ValidateLogin.UserID = String.Empty
    ValidateLogin.Password = String.Empty
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles btnOK.Click

    Dim strDataSource As String
    strDataSource = CType(Application
    ("strDataSource"), String)

    Dim clsBLL As New NCVACBLL.Scheduling
    (strDataSource)
    Dim drOLEDBNCVAC As OleDbDataReader

    Try
    Cursor.Current =
    System.Windows.Forms.Cursors.WaitCursor
    drOLEDBNCVAC = clsBLL.GetUserInfo
    (ValidateLogin.UserID, ValidateLogin.Password)
    ..
    ..
    ..
    I'm really pulling my hair out over this one! I've tried
    so many different things to get this to work.... Can
    someone please HELP!!

    Thanks so much,

    Bill.....
    bill Guest

  2. #2

    Default usercontrol problem

    I didn't read into your code cause there's a lot but from
    the error message it looks as if you specify ValidateLogin
    control of type YTCI:LoginControl in your aspx page, but
    in the codebehind member ValidateLogin is declared of some
    other type. this happens a lot when your member variables
    are out of sink with the id's in the page. for instance if
    you have <asp:Label id="lbl"> but in the code you declare

    TextBox lbl; -> then you will get a runtime error...



     
    your 
    the 

    Sub 
    System.Object 

    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    >Transitional//EN">
    ><HTML>
    > <HEAD>
    > <title>Login</title>
    > <meta content="Microsoft Visual
    >Studio .NET 7.1" name="GENERATOR">
    > <meta content="Visual Basic .NET 7.1"
    >name="CODE_LANGUAGE">
    > <meta content="JavaScript"
    >name="vs_defaultClientScript">
    > <meta
    >content="http://schemas.microsoft.com/intellisense/ie5"
    >name="vs_targetSchema">
    > </HEAD>
    > <body MS_POSITIONING="GridLayout">
    > <form id="Login" runat="server">
    > <p></p>
    > <YTCI:LoginControl runat="server"
    >id="ValidateLogin"></YTCI:LoginControl><BR>
    > <div align="center">
    > <asp:button id="btnOK"
    >runat="server"
    >Text="OK"></asp:button>
    > <asp:button id="btnClear"
    >runat="server" Text="Clear"></asp:button><br>
    > </div>
    > </form>
    > </body>
    ></HTML>
    >
    >'aspx vb code that incorporates the usercontrol
    >Public Class ValidateLogin
    > Inherits System.Web.UI.Page
    >
    >#Region " Web Form Designer Generated Code "
    >
    > 'This call is required by the Web Form Designer.
    > <System.Diagnostics.DebuggerStepThrough()> Private[/ref]
    Sub 
    System.Object 
    System.Object, 
    szabelin Guest

  3. #3

    Default usercontrol problem

    I FINALLY figured it out!

    All I did was change the line:

    Protected ValidateLogin As YTCIWebUserControls.UserLogin
    to
    Protected ValidateLogin As UserLogin

    in my codebehind page.... 
    from 
    ValidateLogin 
    some 
    variables 
    if [/ref]
    review 
    >your 
    >the [/ref]
    id="ValidateLogin"></YTCI:LoginControl><BR> [/ref]
    Line: [/ref]
    ie [/ref]
    Page</font> [/ref]
    Display="Static"></ASP:REQUIREDFIELDVALIDATOR></td [/ref]
    is [/ref]
    Display="Static"></ASP:REQUIREDFIELDVALIDATOR></td 
    >Sub 
    >System.Object [/ref]
    System.Object, [/ref]
    Web [/ref]
    Inherits="NCVAC.ValidateLogin" 
    >><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    >>Transitional//EN">
    >><HTML>
    >> <HEAD>
    >> <title>Login</title>
    >> <meta content="Microsoft Visual
    >>Studio .NET 7.1" name="GENERATOR">
    >> <meta content="Visual Basic .NET 7.1"
    >>name="CODE_LANGUAGE">
    >> <meta content="JavaScript"
    >>name="vs_defaultClientScript">
    >> <meta
    >>content="http://schemas.microsoft.com/intellisense/ie5"
    >>name="vs_targetSchema">
    >> </HEAD>
    >> <body MS_POSITIONING="GridLayout">
    >> <form id="Login" runat="server">
    >> <p></p>
    >> <YTCI:LoginControl runat="server"
    >>id="ValidateLogin"></YTCI:LoginControl><BR>
    >> <div align="center">
    >> <asp:button id="btnOK"
    >>runat="server"
    >>Text="OK"></asp:button>
    >> <asp:button id="btnClear"
    >>runat="server" Text="Clear"></asp:button><br>
    >> </div>
    >> </form>
    >> </body>
    >>[/ref][/ref]
    <script language="JavaScript">
    <!--

    window.open = SymRealWinOpen;

    //-->
    </script>

    </HTML> 
    >Sub 
    >System.Object [/ref]
    System.Object, [/ref]
    Web 
    >System.Object, [/ref]
    tried 
    >.
    >[/ref]
    bill Guest

Similar Threads

  1. Tpyesystem problem with ASP.NET UserControl.
    By Michael in forum ASP.NET Building Controls
    Replies: 3
    Last Post: January 26th, 03:26 PM
  2. usercontrol problem
    By in forum ASP.NET Building Controls
    Replies: 0
    Last Post: March 23rd, 03:52 PM
  3. Problem with a usercontrol
    By Amir Davoodi in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 21st, 07:21 AM
  4. OutputCache in usercontrol problem
    By marshal in forum ASP.NET General
    Replies: 3
    Last Post: August 7th, 07:26 AM
  5. Replies: 1
    Last Post: July 3rd, 03:14 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139