Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 20th, 2005, 04:01 AM
Authorized User
 
Join Date: Apr 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hyperlink n Link Button

Hi,

I have created Link Button to link to other pages. After that I delete it n create hyperlink button to perform the same action.

But when i run it, following error is displayed:

Server Error in '/e-library' Application.
--------------------------------------------------------------------------------

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

Parser Error Message: The base class includes the field 'LinkOthers', but its type (System.Web.UI.WebControls.LinkButton) is not compatible with the type of control (System.Web.UI.WebControls.HyperLink).

Source Error:


Line 14: runat="server" Font-Names="Monotype Corsiva" Visible="False" Font-Bold="True" Width="385px"
Line 15: Font-Size="Large" Height="72px">Thank you for using E-Library System!</asp:label>
Line 16: <asp:HyperLink id="LinkOthers" style="Z-INDEX: 107; LEFT: 464px; POSITION: absolute; TOP: 24px"
Line 17: runat="server" Height="16px" Width="64px" Font-Bold="True" NavigateUrl="Others.aspx">Others</asp:HyperLink>
Line 18: <asp:HyperLink id="LinkJournals" style="Z-INDEX: 106; LEFT: 336px; POSITION: absolute; TOP: 24px"


Source File: c:\inetpub\wwwroot\e-library\Borrow.aspx Line: 16


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

[HTML code]
 <asp:label id="lblLogout" style="Z-INDEX: 102; LEFT: 120px; POSITION: absolute; TOP: 120px"
                runat="server" Font-Names="Monotype Corsiva" Visible="False" Font-Bold="True" Width="385px"
                Font-Size="Large" Height="72px">Thank you for using E-Library System!</asp:label>
            <asp:HyperLink id="LinkOthers" style="Z-INDEX: 107; LEFT: 464px; POSITION: absolute; TOP: 24px"
                runat="server" Height="16px" Width="64px" Font-Bold="True" NavigateUrl="Others.aspx">Others</asp:HyperLink>
            <asp:HyperLink id="LinkJournals" style="Z-INDEX: 106; LEFT: 336px; POSITION: absolute; TOP: 24px"
                runat="server" Height="16px" Width="56px" Font-Bold="True" NavigateUrl="Journals.aspx">Journals</asp:HyperLink>
            <asp:HyperLink id="LinkMagazines" style="Z-INDEX: 105; LEFT: 200px; POSITION: absolute; TOP: 24px"
                runat="server" Height="16px" Width="80px" Font-Bold="True" NavigateUrl="Magazines.aspx">Magazines</asp:HyperLink><asp:button id="btnLogout" style="Z-INDEX: 101; LEFT: 344px; POSITION: absolute; TOP: 264px"
                runat="server" Font-Bold="True" Width="152px" Height="32px" BackColor="Aqua" Text="Logout" ForeColor="Black"></asp:button><asp:button id="btnBack" style="Z-INDEX: 100; LEFT: 136px; POSITION: absolute; TOP: 264px" runat="server"
                Font-Bold="True" Width="152px" Height="32px" BackColor="Aqua" Text="Back to Main Menu" ForeColor="Black"></asp:button>
<asp:HyperLink id="LinkBooks" style="Z-INDEX: 104; LEFT: 96px; POSITION: absolute; TOP: 24px" runat="server"
                Height="16px" Width="64px" Font-Bold="True" NavigateUrl="Books.aspx">Books</asp:HyperLink>

[/HTML code]

I dun know why hv this error. Can somebody tell me?
Thanks!

Irene

 
Old May 20th, 2005, 08:40 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Try reading the error message:
Parser Error Message: The base class includes the field 'LinkOthers', but its type (System.Web.UI.WebControls.LinkButton) is not compatible with the type of control (System.Web.UI.WebControls.HyperLink).

You have changed the type of a control in markup or code-behind without changing the type in the other (code-behind or markup, respectively).

The type here in markup:

    <asp:XXXXXXXX runat="server" id="ctlMyControl" ... />

must match the type here in code-behind:

    Protected WithEvents ctlMyControl As System.Web.UI.WebControls.XXXXXXXX


-Peter
 
Old May 23rd, 2005, 07:26 PM
Authorized User
 
Join Date: Apr 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks spacy, the problem solved already.






Similar Threads
Thread Thread Starter Forum Replies Last Post
CH8 Hyperlink Extractor Service link for wsdl Firmbyte BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 May 18th, 2008 05:26 AM
Adding new row, hyperlink and sheet with a button Shaolin1976 Excel VBA 0 May 8th, 2008 09:01 AM
Link Button deontae45 ASP.NET 1.0 and 1.1 Basics 2 June 23rd, 2007 04:46 PM
Datagrid Button/Hyperlink Column snowydust VB How-To 0 September 6th, 2004 02:14 AM
Adding Hyperlink or Button to DataGrid koneruvijay VS.NET 2002/2003 3 November 13th, 2003 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.