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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • asmx126453
    New Member
    • Sep 2008
    • 72

    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

    Code:
            #region Web Form Designer generated code
            override protected void OnInit(EventArgs e)
            {
                //
                // CODEGEN: This call is required by the ASP.NET Web Form Designer.
                //
                InitializeComponent();
                base.OnInit(e);
            }
    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?)
    Last edited by asmx126453; Nov 17 '08, 09:57 AM. Reason: compleet error
  • prasadgvl
    New Member
    • Nov 2008
    • 3

    #2
    Make sure you have "System" namespace imported as shown here.

    C#:

    Code:
    using System;
    VB.Net:

    Code:
    Imports System

    Comment

    • asmx126453
      New Member
      • Sep 2008
      • 72

      #3
      Nop isent working when i add that 1 i get some errors on my App_Web

      Comment

      • nukefusion
        Recognized Expert New Member
        • Mar 2008
        • 221

        #4
        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.

        Comment

        • asmx126453
          New Member
          • Sep 2008
          • 72

          #5
          Missing partial modifier on declaration of type 'DotNet.Offerte _nieuw'; another parti

          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.P age
          {

          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
          Last edited by asmx126453; Nov 17 '08, 12:18 PM. Reason: Next Error

          Comment

          • balabaster
            Recognized Expert Contributor
            • Mar 2007
            • 798

            #6
            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.P age

            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.P age
            {
            }

            to

            public partial class Offerte_nieuw : System.Web.UI.P age
            {
            }

            Comment

            • asmx126453
              New Member
              • Sep 2008
              • 72

              #7
              Yepz i know i tryd that also but in the code of the

              public partial class Offerte_nieuw : System.Web.UI.P age

              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

              Code:
              					<td><asp:label id="lblOfferte" runat="server" Font-Bold="True" ForeColor="White" Font-Size="Medium">Offerte</asp:label></td>
              					<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

              Comment

              • balabaster
                Recognized Expert Contributor
                • Mar 2007
                • 798

                #8
                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.

                Comment

                • asmx126453
                  New Member
                  • Sep 2008
                  • 72

                  #9
                  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

                  Comment

                  • balabaster
                    Recognized Expert Contributor
                    • Mar 2007
                    • 798

                    #10
                    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.n et/blogs/jschreuder/archive/2008/10/17/how-to-create-a-missing-designer-cs-file.aspx

                    Comment

                    • asmx126453
                      New Member
                      • Sep 2008
                      • 72

                      #11
                      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

                      Comment

                      • asmx126453
                        New Member
                        • Sep 2008
                        • 72

                        #12
                        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

                        Comment

                        • balabaster
                          Recognized Expert Contributor
                          • Mar 2007
                          • 798

                          #13
                          Well I've got 2005 Enterprise and 2008 Enterprise...od dly 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?

                          Comment

                          • r035198x
                            MVP
                            • Sep 2006
                            • 13225

                            #14
                            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?

                            Comment

                            • asmx126453
                              New Member
                              • Sep 2008
                              • 72

                              #15
                              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

                              Code:
                                  public partial class Offerte_nieuw : System.Web.UI.Page
                                  {
                                      #region Controlls
                                      protected System.Web.UI.WebControls.ImageButton ImageButton1;
                                      #endregion
                                      public bool nieuw;
                              
                                      #region Invullen van de tekstvelden uit Database
                                      private void Vullen_tekstvelden(string[] OfferteArray, bool nieuw)
                                      {
                                          txtNoteID.Text = OfferteArray[0];
                                          txtBTW.Text = "19";
                                          txtOfferteNr.Text = OfferteArray[1];
                                          txtDatum.Text = Functions.DateToNL(OfferteArray[2]);
                                          txtDebNr.Text = OfferteArray[3];
                                          txtKlantNaam.Text = OfferteArray[4];
                                          txtContactpersoon.Text = OfferteArray[5];
                                          txtOmschrijving.Text = OfferteArray[6];
                                          txtOrderNr.Text = OfferteArray[7];
                                          #region Nieuwe Offerte
                                          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


                              Code:
                              namespace DotNet
                              {
                              	/// <summary>
                              	/// Summary description for Offerte_nieuw.
                              	/// </summary>
                              	public class Offerte_nieuw : System.Web.UI.Page
                              	{
                              		#region Controlls
                              		protected System.Web.UI.WebControls.TextBox txtOfferteNr;
                              		protected System.Web.UI.WebControls.TextBox txtDatum;
                              		protected System.Web.UI.WebControls.TextBox txtDebNr;
                              		protected System.Web.UI.WebControls.TextBox txtKlantNaam;
                              		protected System.Web.UI.WebControls.TextBox txtContactpersoon;
                              		protected System.Web.UI.WebControls.TextBox txtStraat;
                              		protected System.Web.UI.WebControls.TextBox txtPostcode;
                              		protected System.Web.UI.WebControls.TextBox txtPlaats;
                              		protected System.Web.UI.WebControls.TextBox txtOmschrijving;
                              		protected System.Web.UI.WebControls.TextBox txtOrderNr;
                              		protected System.Web.UI.WebControls.TextBox txtReferentieNr;
                              		protected System.Web.UI.WebControls.Label txtNoteID;
                              		protected System.Web.UI.WebControls.TextBox txtTotaal;
                              		protected System.Web.UI.WebControls.TextBox txtBTWTotaal;
                              		protected System.Web.UI.WebControls.TextBox txtBTW;
                              		protected System.Web.UI.WebControls.TextBox txtSubTotaal;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs10;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk10;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel10;
                              		protected System.Web.UI.WebControls.TextBox txtAantal10;
                              		protected System.Web.UI.WebControls.TextBox txtDatum10;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs9;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk9;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel9;
                              		protected System.Web.UI.WebControls.TextBox txtAantal9;
                              		protected System.Web.UI.WebControls.TextBox txtDatum9;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs8;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk8;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel8;
                              		protected System.Web.UI.WebControls.TextBox txtAantal8;
                              		protected System.Web.UI.WebControls.TextBox txtDatum8;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs7;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk7;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel7;
                              		protected System.Web.UI.WebControls.TextBox txtAantal7;
                              		protected System.Web.UI.WebControls.TextBox txtDatum7;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs6;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk6;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel6;
                              		protected System.Web.UI.WebControls.TextBox txtAantal6;
                              		protected System.Web.UI.WebControls.TextBox txtDatum6;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs5;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk5;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel5;
                              		protected System.Web.UI.WebControls.TextBox txtAantal5;
                              		protected System.Web.UI.WebControls.TextBox txtDatum5;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs4;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk4;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel4;
                              		protected System.Web.UI.WebControls.TextBox txtAantal4;
                              		protected System.Web.UI.WebControls.TextBox txtDatum4;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs3;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk3;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel3;
                              		protected System.Web.UI.WebControls.TextBox txtAantal3;
                              		protected System.Web.UI.WebControls.TextBox txtDatum3;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs2;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk2;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel2;
                              		protected System.Web.UI.WebControls.TextBox txtAantal2;
                              		protected System.Web.UI.WebControls.TextBox txtDatum2;
                              		protected System.Web.UI.WebControls.TextBox txtPrijs1;
                              		protected System.Web.UI.WebControls.TextBox txtPrijsStuk1;
                              		protected System.Web.UI.WebControls.TextBox txtArtikel1;
                              		protected System.Web.UI.WebControls.TextBox txtAantal1;
                              		protected System.Web.UI.WebControls.TextBox txtDatum1;
                              		protected System.Web.UI.WebControls.ImageButton imgBtnVerzamel;
                              		protected System.Web.UI.WebControls.ImageButton ImageButton1;
                              		#endregion
                              		protected System.Web.UI.WebControls.ImageButton imgBtnBestelling;
                              		protected System.Web.UI.WebControls.ImageButton Imagebutton1;
                              		protected System.Web.UI.WebControls.ImageButton imgBtnKopie;
                              		protected System.Web.UI.WebControls.Label lblOfferte;
                              		protected System.Web.UI.WebControls.Label lblKlant;
                              		protected System.Web.UI.WebControls.Label lblOfferteNr;
                              		protected System.Web.UI.WebControls.Label lblContact;
                              		protected System.Web.UI.WebControls.Label lblDatum;
                              		protected System.Web.UI.WebControls.Label lblDebNr;
                              		protected System.Web.UI.WebControls.Label lblStraat;
                              		protected System.Web.UI.WebControls.Label lblPostcode;
                              		protected System.Web.UI.WebControls.Label lblPlaats;
                              		protected System.Web.UI.WebControls.Label lblOmschrijving;
                              		protected System.Web.UI.WebControls.Label lblOrderNr;
                              		protected System.Web.UI.WebControls.Label lblReferentie;
                              		protected System.Web.UI.WebControls.ImageButton btnPrinten;
                              		protected System.Web.UI.WebControls.ImageButton imbtnPrintenLokaal;
                              		protected System.Web.UI.WebControls.ImageButton imgAfleverbon;
                              		protected System.Web.UI.WebControls.ImageButton imgOpslaan;
                              		protected System.Web.UI.WebControls.ImageButton imgUpdate;
                              		public bool nieuw;
                              				
                              		#region Invullen van de tekstvelden uit Database
                              		private void Vullen_tekstvelden(string[] OfferteArray, bool nieuw)
                              		{
                              			txtNoteID.Text =		OfferteArray[0];
                              			txtBTW.Text =			"19";
                              			txtOfferteNr.Text =		OfferteArray[1];
                              			txtDatum.Text =			Functions.DateToNL(OfferteArray[2]);
                              			txtDebNr.Text =			OfferteArray[3];
                              			txtKlantNaam.Text =		OfferteArray[4];
                              			txtContactpersoon.Text =OfferteArray[5];
                              			txtOmschrijving.Text =	OfferteArray[6];
                              			txtOrderNr.Text =		OfferteArray[7];
                              			#region Nieuwe Offerte
                              			if (nieuw == true)
                              			{
                              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

                              Comment

                              Working...