473,387 Members | 1,863 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,387 software developers and data experts.

The type or namespace name 'EventArgs' could not be found (are you missing a using di

Hey guys i Hope somone can help i have bin looking on the internet but i cant solve it here is the code where i get the error

Expand|Select|Wrap|Line Numbers
  1.         #region Web Form Designer generated code
  2.         override protected void OnInit(EventArgs e)
  3.         {
  4.             //
  5.             // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  6.             //
  7.             InitializeComponent();
  8.             base.OnInit(e);
  9.         }
the blue line is under EventArgs so the error looks 2 be there i also looked in some other pages were exactly the same code is being used without getting an error but i dont now wy i am getting that error

Compleet error : The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)
Nov 17 '08 #1
16 26424
Make sure you have "System" namespace imported as shown here.

C#:

Expand|Select|Wrap|Line Numbers
  1. using System;
VB.Net:

Expand|Select|Wrap|Line Numbers
  1. Imports System
Nov 17 '08 #2
Nop isent working when i add that 1 i get some errors on my App_Web
Nov 17 '08 #3
nukefusion
221 Expert 100+
Then if you aren't missing a using directive then the other possibility is that the System assembly has not been referenced for some reason. I don't do a lot of ASP.NET myself but it seems strange that it wouldn't have been referenced automatically.
Right-click your project in the solution explorer and select "Add Reference". Under the .NET tab find "System" in the list, highlight and click ok.
Then attempt to rebuild your project.
Nov 17 '08 #4
Alrydi tryd that before i saw that on the internet but it dident work also

I did get some steps farther i think ?

Becase Now i get an error on

public class Offerte_nieuw : System.Web.UI.Page
{

And i work with Inhertis option in ASPX page

This is the error i Get now

Missing partial modifier on declaration of type 'DotNet.Offerte_nieuw'; another partial declaration of this type exists
Nov 17 '08 #5
balabaster
797 Expert 512MB
When you define a web page, there are two parts - the automatically defined bit, and the bit you interact with. This allows you to have bits of classes logically separated out into multiple files - for example with the "designer" code generated automatically by .NET and the "logical" code which you write...

When you create the bit you interact with, you need to define it as:

public partial class MyClass : System.Web.UI.Page

You can't have one "part" of the class defined as "partial" and one part not defined as partial. Not defining one of them as partial makes the system believe that you're trying to create a class that contains its whole definition within one file. Because another file within your project contains a partial definition with this class name, it thinks you're either creating a second class with the same name which an illegal operation or more likely you're missing the partial keyword (which is what the compiler is complaining about in this case)...

You're missing the "partial" keyword in your class declaration...

Change your class signature from:

public class Offerte_nieuw : System.Web.UI.Page
{
}

to

public partial class Offerte_nieuw : System.Web.UI.Page
{
}
Nov 17 '08 #6
Yepz i know i tryd that also but in the code of the

public partial class Offerte_nieuw : System.Web.UI.Page

I start intializing a lot of txtboxes and labels and if i put the code partial with it it says als those txtboxen and labels are alrydi containing a defention and i need those txtboces becase i am working with an Array that gets data from an SQL database and this is in the C# programming page i also have a ASPX page with these code's in it

Expand|Select|Wrap|Line Numbers
  1.                     <td><asp:label id="lblOfferte" runat="server" Font-Bold="True" ForeColor="White" Font-Size="Medium">Offerte</asp:label></td>
  2.                     <td><asp:label id="txtNoteID" runat="server" Font-Bold="True" Width="103px"></asp:label></td>
And i also need those Array's to be loaded with a postback function so that he loads those values in the begining of the page
Nov 18 '08 #7
balabaster
797 Expert 512MB
Yes - those textboxes already contain a definition in the other part of the partial class - the part that's auto generated by .NET.

At the top of your Solution browser, there's a bunch of buttons. If you hold your mouse over each one, find the one that says "Show All Files" and click it.

Now you'll be able to see both of the Code behind classes that are attached to your ASPX/ASCX.

Open the designer one (that you didn't write) and you should see that the items you defined in the ASPX definition should show up in there.

You don't need to redefine them yourself in your partial class - and if you do, you'll see the error you're seeing.
Nov 18 '08 #8
Nop i heard that before but in VS 2005 You dont have that button and i am working in visual studio 2005.

But i can see the files with the following extension:

ASPX
ASPX.CS
ASPX.RESX

that are the 3 files i have for each page
Nov 18 '08 #9
balabaster
797 Expert 512MB
Have you come across this yet? I don't think it's exactly what you're trying to do, but it should give you some idea as to how to alleviate the issue:

http://bloggingabout.net/blogs/jschreuder/archive/2008/10/17/how-to-create-a-missing-designer-cs-file.aspx
Nov 18 '08 #10
Hey Tnx

I took a fast look at it and it realy looks like the problem i have i also converted this project from an previos version so i think that it may solve my problem i will find out tomorow first thing and tanx for all your help it whas realy usefull

Hope that i can sole it whit that article tomorow I will let you now if i solved it
Nov 18 '08 #11
Hey i have some questions becase i whanne now with what programm you can select the option Show All Files

I tried it with you previos post but the problem is i cant get the designer code to be visible and i also cant select the option Convert To Webapplication

the programs i have on my computer now are

Visual Web Developer 2008 express edition
Visual C# 2008 express edition
Visual Studio 2005

What do you think is the best programm to solve that error becase i cudent find any option like Convert to webapplication or Show all files with what programms are you doing that
Nov 19 '08 #12
balabaster
797 Expert 512MB
Well I've got 2005 Enterprise and 2008 Enterprise...oddly in 2005 Enterprise, the button is there but for some odd reason, it's disabled and I can't figure out why. In 2008 it's not there - but it creates Web Applications slightly differently than in 2005 where you'd normally create a new site... and I've not had a chance to sit and tinker enough to figure out how to create a 2005 Web Application as opposed to a 2005 Website...

Maybe someone else can provide some input?
Nov 19 '08 #13
r035198x
13,262 8TB
What's the background info here?
When did you start to see the errors? Did you create the project yourself or are you trying to edit some project which was created on another IDE?
Nov 19 '08 #14
I did not create it my self it whas bild in 2002 and now i am eddeting it becase there were some errors that made sure the application dident work anymore so now i need to get it to work i converted it from VS 7 to 2005 and that alrydi cuased a lot of erros but the most of them are solved now i only need this last page to work than its done but this last page is to tricky for me in the page i get 3 errors 1 with an Array and 2 with Queries here is the code for the array becase i have 2 document with the same name and i dont now wich one is can best use see the beginning of the code and i hope you know wich 1 i can best use

Expand|Select|Wrap|Line Numbers
  1.     public partial class Offerte_nieuw : System.Web.UI.Page
  2.     {
  3.         #region Controlls
  4.         protected System.Web.UI.WebControls.ImageButton ImageButton1;
  5.         #endregion
  6.         public bool nieuw;
  7.  
  8.         #region Invullen van de tekstvelden uit Database
  9.         private void Vullen_tekstvelden(string[] OfferteArray, bool nieuw)
  10.         {
  11.             txtNoteID.Text = OfferteArray[0];
  12.             txtBTW.Text = "19";
  13.             txtOfferteNr.Text = OfferteArray[1];
  14.             txtDatum.Text = Functions.DateToNL(OfferteArray[2]);
  15.             txtDebNr.Text = OfferteArray[3];
  16.             txtKlantNaam.Text = OfferteArray[4];
  17.             txtContactpersoon.Text = OfferteArray[5];
  18.             txtOmschrijving.Text = OfferteArray[6];
  19.             txtOrderNr.Text = OfferteArray[7];
  20.             #region Nieuwe Offerte
  21.             if (nieuw == true)
Here is get an error on the Array and i thought that maybe the insancies werent created so the otther document is this


Expand|Select|Wrap|Line Numbers
  1. namespace DotNet
  2. {
  3.     /// <summary>
  4.     /// Summary description for Offerte_nieuw.
  5.     /// </summary>
  6.     public class Offerte_nieuw : System.Web.UI.Page
  7.     {
  8.         #region Controlls
  9.         protected System.Web.UI.WebControls.TextBox txtOfferteNr;
  10.         protected System.Web.UI.WebControls.TextBox txtDatum;
  11.         protected System.Web.UI.WebControls.TextBox txtDebNr;
  12.         protected System.Web.UI.WebControls.TextBox txtKlantNaam;
  13.         protected System.Web.UI.WebControls.TextBox txtContactpersoon;
  14.         protected System.Web.UI.WebControls.TextBox txtStraat;
  15.         protected System.Web.UI.WebControls.TextBox txtPostcode;
  16.         protected System.Web.UI.WebControls.TextBox txtPlaats;
  17.         protected System.Web.UI.WebControls.TextBox txtOmschrijving;
  18.         protected System.Web.UI.WebControls.TextBox txtOrderNr;
  19.         protected System.Web.UI.WebControls.TextBox txtReferentieNr;
  20.         protected System.Web.UI.WebControls.Label txtNoteID;
  21.         protected System.Web.UI.WebControls.TextBox txtTotaal;
  22.         protected System.Web.UI.WebControls.TextBox txtBTWTotaal;
  23.         protected System.Web.UI.WebControls.TextBox txtBTW;
  24.         protected System.Web.UI.WebControls.TextBox txtSubTotaal;
  25.         protected System.Web.UI.WebControls.TextBox txtPrijs10;
  26.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk10;
  27.         protected System.Web.UI.WebControls.TextBox txtArtikel10;
  28.         protected System.Web.UI.WebControls.TextBox txtAantal10;
  29.         protected System.Web.UI.WebControls.TextBox txtDatum10;
  30.         protected System.Web.UI.WebControls.TextBox txtPrijs9;
  31.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk9;
  32.         protected System.Web.UI.WebControls.TextBox txtArtikel9;
  33.         protected System.Web.UI.WebControls.TextBox txtAantal9;
  34.         protected System.Web.UI.WebControls.TextBox txtDatum9;
  35.         protected System.Web.UI.WebControls.TextBox txtPrijs8;
  36.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk8;
  37.         protected System.Web.UI.WebControls.TextBox txtArtikel8;
  38.         protected System.Web.UI.WebControls.TextBox txtAantal8;
  39.         protected System.Web.UI.WebControls.TextBox txtDatum8;
  40.         protected System.Web.UI.WebControls.TextBox txtPrijs7;
  41.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk7;
  42.         protected System.Web.UI.WebControls.TextBox txtArtikel7;
  43.         protected System.Web.UI.WebControls.TextBox txtAantal7;
  44.         protected System.Web.UI.WebControls.TextBox txtDatum7;
  45.         protected System.Web.UI.WebControls.TextBox txtPrijs6;
  46.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk6;
  47.         protected System.Web.UI.WebControls.TextBox txtArtikel6;
  48.         protected System.Web.UI.WebControls.TextBox txtAantal6;
  49.         protected System.Web.UI.WebControls.TextBox txtDatum6;
  50.         protected System.Web.UI.WebControls.TextBox txtPrijs5;
  51.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk5;
  52.         protected System.Web.UI.WebControls.TextBox txtArtikel5;
  53.         protected System.Web.UI.WebControls.TextBox txtAantal5;
  54.         protected System.Web.UI.WebControls.TextBox txtDatum5;
  55.         protected System.Web.UI.WebControls.TextBox txtPrijs4;
  56.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk4;
  57.         protected System.Web.UI.WebControls.TextBox txtArtikel4;
  58.         protected System.Web.UI.WebControls.TextBox txtAantal4;
  59.         protected System.Web.UI.WebControls.TextBox txtDatum4;
  60.         protected System.Web.UI.WebControls.TextBox txtPrijs3;
  61.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk3;
  62.         protected System.Web.UI.WebControls.TextBox txtArtikel3;
  63.         protected System.Web.UI.WebControls.TextBox txtAantal3;
  64.         protected System.Web.UI.WebControls.TextBox txtDatum3;
  65.         protected System.Web.UI.WebControls.TextBox txtPrijs2;
  66.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk2;
  67.         protected System.Web.UI.WebControls.TextBox txtArtikel2;
  68.         protected System.Web.UI.WebControls.TextBox txtAantal2;
  69.         protected System.Web.UI.WebControls.TextBox txtDatum2;
  70.         protected System.Web.UI.WebControls.TextBox txtPrijs1;
  71.         protected System.Web.UI.WebControls.TextBox txtPrijsStuk1;
  72.         protected System.Web.UI.WebControls.TextBox txtArtikel1;
  73.         protected System.Web.UI.WebControls.TextBox txtAantal1;
  74.         protected System.Web.UI.WebControls.TextBox txtDatum1;
  75.         protected System.Web.UI.WebControls.ImageButton imgBtnVerzamel;
  76.         protected System.Web.UI.WebControls.ImageButton ImageButton1;
  77.         #endregion
  78.         protected System.Web.UI.WebControls.ImageButton imgBtnBestelling;
  79.         protected System.Web.UI.WebControls.ImageButton Imagebutton1;
  80.         protected System.Web.UI.WebControls.ImageButton imgBtnKopie;
  81.         protected System.Web.UI.WebControls.Label lblOfferte;
  82.         protected System.Web.UI.WebControls.Label lblKlant;
  83.         protected System.Web.UI.WebControls.Label lblOfferteNr;
  84.         protected System.Web.UI.WebControls.Label lblContact;
  85.         protected System.Web.UI.WebControls.Label lblDatum;
  86.         protected System.Web.UI.WebControls.Label lblDebNr;
  87.         protected System.Web.UI.WebControls.Label lblStraat;
  88.         protected System.Web.UI.WebControls.Label lblPostcode;
  89.         protected System.Web.UI.WebControls.Label lblPlaats;
  90.         protected System.Web.UI.WebControls.Label lblOmschrijving;
  91.         protected System.Web.UI.WebControls.Label lblOrderNr;
  92.         protected System.Web.UI.WebControls.Label lblReferentie;
  93.         protected System.Web.UI.WebControls.ImageButton btnPrinten;
  94.         protected System.Web.UI.WebControls.ImageButton imbtnPrintenLokaal;
  95.         protected System.Web.UI.WebControls.ImageButton imgAfleverbon;
  96.         protected System.Web.UI.WebControls.ImageButton imgOpslaan;
  97.         protected System.Web.UI.WebControls.ImageButton imgUpdate;
  98.         public bool nieuw;
  99.  
  100.         #region Invullen van de tekstvelden uit Database
  101.         private void Vullen_tekstvelden(string[] OfferteArray, bool nieuw)
  102.         {
  103.             txtNoteID.Text =        OfferteArray[0];
  104.             txtBTW.Text =            "19";
  105.             txtOfferteNr.Text =        OfferteArray[1];
  106.             txtDatum.Text =            Functions.DateToNL(OfferteArray[2]);
  107.             txtDebNr.Text =            OfferteArray[3];
  108.             txtKlantNaam.Text =        OfferteArray[4];
  109.             txtContactpersoon.Text =OfferteArray[5];
  110.             txtOmschrijving.Text =    OfferteArray[6];
  111.             txtOrderNr.Text =        OfferteArray[7];
  112.             #region Nieuwe Offerte
  113.             if (nieuw == true)
  114.             {
And here is the other page with all the same code axcept what you see in the beggining and i whas wondering whats the ebst to use becase with this page i get error about EventArgs and more

If i am wright they just whanne load some values from the database to the Array and in to an txtbox when i look at that bit off code i dont see an error aldo i know that my Array = NULL

is it posible to load a value from a database into an array and from that array into a txtbox if i know how that works i maybe able to solve it but i cant even find a way on internet that thous that
Nov 20 '08 #15
r035198x
13,262 8TB
The only advice I have left on this thread is that if you want to change someone's code, you better make sure that you understand what it is doing first so that you know what effects your changes have.
Nov 20 '08 #16
Yep your right but i now that with that code there is a way to load the database record into an array there is just something wrong with it that i cant find but Tnx for all your help guys wil try it on a differnt way
Nov 20 '08 #17

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

Similar topics

2
by: Matthew Louden | last post by:
using System.Data; using System.Data.SqlClient; //etc... SqlConnection conn = new SqlConnection(connString); SQLDataSetCommand myCmd = new SQLDataSetCommand("select * from Test;", conn);...
1
by: Randall Parker | last post by:
Using VS 2003 and Cassini web server. I'm new to ASP.Net and so this may be a dumb question. I'm getting an error where the type 'FarmLand.WebForm1' is not found. The Codebehind C# source file...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
0
by: Jigar.Patel | last post by:
I have simple remoting server exposing following simple method. When I try to add webreference to this server in another project, it gives me following error: Custom tool error: Unable to import...
7
by: Harris | last post by:
Dear all, I have the following codes: ====== public enum Enum_Value { Value0 = 0, Value1 = 10,
0
by: WebDev2 | last post by:
I can't get AJAX.NET Pro to work. I keep getting a Compiler Error Message: CS0246: The type or namespace name 'AjaxPro' could not be found (are you missing a using directive or an assembly...
6
by: antonyliu2002 | last post by:
Hi, guys, I am using Visual Web Developer Express 2005 for my web application. I wrote a simple class called MyTestClass.cs and put it in the App_Code folder. I compiled it to library from...
2
by: Nico Vonckx | last post by:
Hello, As I am taking my first steps in C#.NET i wrote this but I always receive an error message. <%@ Page Language="C#" %> <script runat="server"> void Submit_Click(object obj, Eventargs...
7
rrocket
by: rrocket | last post by:
The entire error is "CS0246: The type or namespace name 'RateWebServiceClient' could not be found (are you missing a using directive or an assembly reference?)" I am trying to access a web...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.