473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Compilation Error

Hi friends i am getting the error in my application i don't know what to do please help me.i am useing a data bimder into my text box here is the my code

Expand|Select|Wrap|Line Numbers
  1. <%@ Page language="c#" Codebehind="Accomplishment.aspx.cs" AutoEventWireup="false" Inherits="Accomplishments.Accomplishment" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3. <HTML>
  4.     <HEAD>
  5.         <title>Accomplishment</title>
  6.         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
  7.         <meta content="C#" name="CODE_LANGUAGE">
  8.         <meta content="JavaScript" name="vs_defaultClientScript">
  9.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10.     </HEAD>
  11.     <body>
  12.         <form id="Form1" method="post" runat="server">
  13.             <table height="100%" cellSpacing="0" width="700" align="center" border="1"> 
  14.                 <tr>
  15.                     <td height="50"><IMG src="header.jpg" width="700"></td>
  16.                 </tr>
  17.                 <tr>
  18.                     <td vAlign="top">
  19.                         <table cellPadding="5" width="700">
  20.                             <tr>
  21.                                 <td>FirstName:
  22.                                     <asp:textbox id="txtFirstName" ReadOnly="True" Runat="server"></asp:textbox>LastName:
  23.                                     <asp:textbox id="txtLastName" ReadOnly="True" Runat="server"></asp:textbox>
  24.                                     <
  25.                                     <asp:TextBox ID="txtemployee"   Visible=False Runat=server text='<%# DataBinder.Eval(Container.DataItem,"employeeid")%>'>
  26.                                     </asp:TextBox>
  27.                                 </td>
  28.                             </tr>
  29.                             <tr>
  30.                                 <td>Login
  31.                                     <asp:textbox id="txtLogin" ReadOnly="True" Runat="server"></asp:textbox>Dept:<asp:textbox id="txtdept" ReadOnly="True" Runat="server"></asp:textbox>
  32.                                 </td>
  33.                             </tr>
  34.                             <tr>
  35.                                 <td>DateCreated:
  36.                                     <asp:textbox id="txtdatecreated" ReadOnly="True" Runat="server"></asp:textbox>ProejctName:
  37.                                     <asp:dropdownlist id="drpProject" Runat="server" AutoPostBack="True">
  38.                                         <asp:ListItem Value="">Select a Project</asp:ListItem>
  39.                                         <asp:ListItem Value="01">Employee Nominations</asp:ListItem>
  40.                                         <asp:ListItem Value="02">Accomplishments</asp:ListItem>
  41.                                     </asp:dropdownlist>
  42.                                     <asp:RequiredFieldValidator ID="Project" Runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="drpProject"></asp:RequiredFieldValidator>
  43.                                     <asp:dropdownlist id="drpMonth" Runat="server" AutoPostBack="True">
  44.                                         <asp:ListItem Value="">Select a Month</asp:ListItem>
  45.                                         <asp:ListItem Value="01">January</asp:ListItem>
  46.                                         <asp:ListItem Value="02">February</asp:ListItem>
  47.                                         <asp:ListItem Value="03">March</asp:ListItem>
  48.                                         <asp:ListItem Value="04">April</asp:ListItem>
  49.                                         <asp:ListItem Value="05">May</asp:ListItem>
  50.                                         <asp:ListItem Value="06">June</asp:ListItem>
  51.                                         <asp:ListItem Value="07">July</asp:ListItem>
  52.                                         <asp:ListItem Value="08">August</asp:ListItem>
  53.                                         <asp:ListItem Value="09">September</asp:ListItem>
  54.                                         <asp:ListItem Value="10">October</asp:ListItem>
  55.                                         <asp:ListItem Value="11">November</asp:ListItem>
  56.                                         <asp:ListItem Value="12">December</asp:ListItem>
  57.                                     </asp:dropdownlist>
  58.                                 </td>
  59.                             </tr>
  60.                             <tr>
  61.                                 <td><asp:textbox id="txtdescription" Runat="server" TextMode="MultiLine" Height="150" Width="600"></asp:textbox></td>
  62.                             </tr>
  63.                             <tr>
  64.                                 <td><asp:button id="cmdSubmit" Runat="server" Text="Submit"></asp:button></td>
  65.                             </tr>
  66.                         </table>
  67.                     </td>
  68.                 </tr>
  69.             </table>
  70.         </form>
  71.     </body>
  72. </HTML>
  73.  
  74.  
  75.  

and here is the erro i am getting

Expand|Select|Wrap|Line Numbers
  1.  
  2. Server Error in '/Accomplishments' Application.
  3. --------------------------------------------------------------------------------
  4.  
  5. Compilation Error 
  6. Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 
  7.  
  8. Compiler Error Message: CS0117: 'System.Web.UI.Control' does not contain a definition for 'DataItem'
  9.  
  10. Source Error:
  11.  
  12.  
  13.  
  14. Line 23:                                     <asp:textbox id="txtLastName" ReadOnly="True" Runat="server"></asp:textbox>
  15. Line 24:                                     <
  16. Line 25:                                     <asp:TextBox ID="txtemployee"   Visible=False Runat=server text='<%# DataBinder.Eval(Container.DataItem,"employeeid")%>'>
  17. Line 26:                                     </asp:TextBox>
  18. Line 27:                                 </td>
  19.  
  20.  
  21. Line 


please help me do you ay other way to do this i am passing the employeeid through the data binder how i acn do this please help me
Oct 15 '07 #1
5 1189
Plater
7,872 Expert 4TB
Container.DataItem is your offending line.
You will need to type-cast that object to whatever it's REAL object type is to make use of that property.
Oct 15 '07 #2
hey do you know which property do i need to use instead of Container.DataItem because i tried so many things but did not get the right anwers please me .
Oct 15 '07 #3
Plater
7,872 Expert 4TB
What is Container? If it's a textbox you would use .Text
Oct 15 '07 #4
hey now error is changed it is show this error now
Expand|Select|Wrap|Line Numbers
  1. Compiler Error Message: CS0246: The type or namespace name 'Text' could not be found (are you missing a using directive or an assembly reference?)
  2.  
  3.  
what should i do with this please help me
Oct 15 '07 #5
Plater
7,872 Expert 4TB
Uhhh you should be using Container.Text, not just "Text"
Oct 15 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Joachim | last post by:
I made some project changes (which seems it doesn't help if I undo) which have created compilation error: " Server Error in '/PCSWebApp1' Application....
2
by: James Zhuo | last post by:
Hi all I've been getting the following compilation error. I should explain the background of the project that i am taking over. This is a project that has been developed by someone else a while...
0
by: James Zhuo | last post by:
hi all I changed the name of the class LoginPage to a different name "LoginPageOne" But the same error gets generated with the Wiliam.Request.LoginPageOne. That pretty much leaves me clueless...
0
by: Jie | last post by:
Does anyone know why I keep having the following error. I have to rebuild the solution every time I run it in design mode. thanks jie Server Error in '/ReapPortal' Application....
0
by: John | last post by:
Hi, I've just rolled out a new version of an ASP.NET application. It runs fine on development and training servers, but on production get the following error when trying to access a page: ...
2
by: VB Programmer | last post by:
I created a ASP.NET app locally and it works great. Uploaded it to my server and I get this error when trying to view a page. Any ideas? Server Error in '/earlyalert3' Application....
2
by: Kevin R. | last post by:
I have been ignoring this problem for a few weeks now, but it's becoming a bit annoying not to mention unproductive. Here it goes: I compile my project with no errors. Then after I debug/run it,...
6
by: Plat | last post by:
I've Googled this for a while, to no avail. Hopefully someone can help me. Maybe I'm using the wrong terminology. Here's the scoop! Let's say I've got a simple *.ASPX page that has a syntax...
0
by: Stimp | last post by:
I've created an aspx page called HistoryManage.aspx. The page works fine on my local machine but when I load it off the web I get the following strange error... Compilation Error...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.