469,280 Members | 1,790 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

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 24650
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

Post your reply

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

Similar topics

1 post views Thread by Randall Parker | last post: by
reply views Thread by Jigar.Patel | last post: by
7 posts views Thread by Harris | last post: by
6 posts views Thread by antonyliu2002 | last post: by
2 posts views Thread by Nico Vonckx | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.