0

Guys, I need your help on this case

This is my error:
[Error 194 The base class includes the field 'PlanImg', but its type (System.Web.UI.HtmlControls.HtmlImage) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl)]

.aspx
[<li><p onclick="SetSelectedTab(1,'../XXXXXX/XXXXXX.aspx')"><span runat="server" ID="PlanImg" datasrc="#DTSRC" datafld="link1"></span></p></li>]

.aspx.cs
[PlanImg.Visible = true;]

This error is taking me too much time and hair, I need help :(
Thanks!!!

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by hericles
0

Hey,
Can you post up all of the code? I think there is something wrong beyond what you posted here.

0

Thanks hericles,

I remove the unnecessary codes for your convinience, here it is


<%@ Page language="C#" autoeventwireup="true" inherits="XXX, TTT"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<body>
<form id="Frm" action="" method="post" runat="server">
<XML id="DTSRC" src="labels.xml"></XML>

<div>
<ul>
<li>< onclick="Selected(1,'../XXX/YYY.aspx')"><span runat="server" ID="PlanImg" datasrc="#DTSRC" datafld="link1"></span></p></li>
</ul>
</div>
</form>
</body>


To give you a bigger picture, the id planimg was placed inside an img tag, so previously it was an image, I was instructed to replace all the image to text which is coming from a xml file, at first everything works fine but when they send me an updated files I merge it and carry over my changes then voila, this error occurs

thank!

0

Have a look at your .aspx.cs file. In the auto-generated code is the img element still defined as an Image? If it used to be an image but now isn't, that could explain why you're getting the error related to System.Web.UI.HtmlControls.HtmlImage.

0

I try adding new attributes on .aspx file (<p> instead of image) but it doesen't seem to communicate with .cs file..all id's from .aspx where labeled in red in .cs

0

When you say you were sent new files and you merged them, what were they? Aspx files?
It looks like you have altered something and now your .cs isn't referencing your .aspx page. You could always create a new aspx page and copy the code across if you're really stuck

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.