I was getting the following error after compiling the C# source file with
VS.NET 2003, Any help will be appreciated.
Many thanks!
Surjeet Gill
Details:
Compilation Error
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.
Compiler Error Message: CS0234: The type or namespace name 'Global' does not
exist in the class or namespace 'System.Web.UI.WebControls.PlaceHolder' (are
you missing an assembly reference?)
Source Error:
Line 26:
Line 27: [System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()]
Line 28: public class Global_asax : PlaceHolder.Global {
Line 29:
Line 30: private static bool __initialized = false;
Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET
Files\chapter02_placeholder\3f5aa4a9\6f93a474\mzry uqmu.0.cs Line: 28
This was the only C# source file in the project.
// File Placeholder.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace PlaceHolder
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.TextBox txtName;
protected System.Web.UI.WebControls.DropDownList ddlDays;
protected System.Web.UI.WebControls.Panel pnlDynamic;
// Use the Page_Load event to load the dynamically created
// controls so that they are available prior to rendering
private void Page_Load(object sender, System.EventArgs e)
{
// Get the value selected by user in the dropdown list
int intDays = Convert.ToInt32(ddlDays.SelectedItem.Value);
// Create textboxes to allow entering the
// travel expenses for each travel day
for (int i = 1; i <= intDays; i++)
{
LiteralControl lcExpenseCaption = new LiteralControl();
lcExpenseCaption.Text =
String.Format("Travel Expense for Day-{0} ", i);
// Create a textbox control
TextBox txtExpense = new TextBox();
// Set the ID property of the textbox
txtExpense.ID = String.Format("Expense{0}", i);
HtmlControl lcBreak = new HtmlGenericControl("br");
pnlDynamic.Controls.Add(lcExpenseCaption);
// Add the textbox to the panel
// if you omit this step, textbox is
// created but not displayed
pnlDynamic.Controls.Add(txtExpense);
pnlDynamic.Controls.Add(lcBreak);
}
// Display a linkbutton that allow users to
// post the expenses after they have entered the data
if(intDays>0)
{
LinkButton lbtnSubmit = new LinkButton();
lbtnSubmit.Text = "Submit Expenses";
// Add an event handler to the dynamically created
// link button
lbtnSubmit.Click += new EventHandler(lbtnSubmit_Click);
pnlDynamic.Controls.Add(lbtnSubmit);
HtmlControl lcBreak = new HtmlGenericControl("br");
pnlDynamic.Controls.Add(lcBreak);
}
}
// Handles the Click event for the dynamically
// created link button
private void lbtnSubmit_Click(object sender, System.EventArgs e)
{
double dblExpenses = 0;
int intDays = Convert.ToInt32(ddlDays.SelectedItem.Value);
// Find sum of all expenses
for (int i = 1; i <= intDays; i++)
{
// Find control in the collection of controls
// contained by the panel
TextBox txtExpense = (TextBox)
pnlDynamic.FindControl(String.Format("Expense{0}", i));
dblExpenses += Convert.ToDouble(txtExpense.Text);
}
// Display the results
Label lblResults = new Label();
lblResults.Text = String.Format(
"{0}, a sum of ${1} has been credited to your account",
txtName.Text, dblExpenses);
pnlDynamic.Controls.Add(lblResults);
}
#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);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
} 1 2005
Hi Surjeet,
Can you send me your machine.config file?
Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support ja******@online.microsoft.com
This post is provided "AS-IS" with no warranties and confers no rights.
-------------------- Thread-Topic: JIT Cmpile Error CS0234 thread-index: AcR7IRHxNMBu7KvDRL22qIZUPSr/Cg== X-WBNR-Posting-Host: 198.91.4.14 From: =?Utf-8?B?U3VyamVldCBHaWxs?= <Su*********@discussions.microsoft.com> Subject: JIT Cmpile Error CS0234 Date: Thu, 5 Aug 2004 12:19:03 -0700 Lines: 142 Message-ID: <73**********************************@microsoft.co m> MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Newsgroups: microsoft.public.dotnet.framework.aspnet NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:252413 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
I was getting the following error after compiling the C# source file with VS.NET 2003, Any help will be appreciated.
Many thanks! Surjeet Gill
Details:
Compilation Error Description: An error occurred during the compilation of a resource
requiredto service this request. Please review the following specific error
detailsand modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Global' does
notexist in the class or namespace 'System.Web.UI.WebControls.PlaceHolder'
(areyou missing an assembly reference?)
Source Error: Line 26: Line 27:
[System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()]Line 28: public class Global_asax : PlaceHolder.Global { Line 29: Line 30: private static bool __initialized = false;
Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NETFiles\chapter02_placeholder\3f5aa4a9\6f93a474\mzr yuqmu.0.cs Line: 28
This was the only C# source file in the project. // File Placeholder.aspx.cs using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls;
namespace PlaceHolder { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Label Label2; protected System.Web.UI.WebControls.Label Label3; protected System.Web.UI.WebControls.TextBox txtName; protected System.Web.UI.WebControls.DropDownList ddlDays; protected System.Web.UI.WebControls.Panel pnlDynamic;
// Use the Page_Load event to load the dynamically created // controls so that they are available prior to rendering private void Page_Load(object sender, System.EventArgs e) { // Get the value selected by user in the dropdown list int intDays = Convert.ToInt32(ddlDays.SelectedItem.Value); // Create textboxes to allow entering the // travel expenses for each travel day for (int i = 1; i <= intDays; i++) { LiteralControl lcExpenseCaption = new LiteralControl(); lcExpenseCaption.Text = String.Format("Travel Expense for Day-{0} ", i); // Create a textbox control TextBox txtExpense = new TextBox(); // Set the ID property of the textbox txtExpense.ID = String.Format("Expense{0}", i); HtmlControl lcBreak = new HtmlGenericControl("br"); pnlDynamic.Controls.Add(lcExpenseCaption); // Add the textbox to the panel // if you omit this step, textbox is // created but not displayed pnlDynamic.Controls.Add(txtExpense); pnlDynamic.Controls.Add(lcBreak); } // Display a linkbutton that allow users to // post the expenses after they have entered the data if(intDays>0) { LinkButton lbtnSubmit = new LinkButton(); lbtnSubmit.Text = "Submit Expenses"; // Add an event handler to the dynamically created // link button lbtnSubmit.Click += new EventHandler(lbtnSubmit_Click); pnlDynamic.Controls.Add(lbtnSubmit); HtmlControl lcBreak = new HtmlGenericControl("br"); pnlDynamic.Controls.Add(lcBreak); } } // Handles the Click event for the dynamically // created link button private void lbtnSubmit_Click(object sender, System.EventArgs e) { double dblExpenses = 0; int intDays = Convert.ToInt32(ddlDays.SelectedItem.Value); // Find sum of all expenses for (int i = 1; i <= intDays; i++) { // Find control in the collection of controls // contained by the panel TextBox txtExpense = (TextBox) pnlDynamic.FindControl(String.Format("Expense{0}", i)); dblExpenses += Convert.ToDouble(txtExpense.Text); } // Display the results Label lblResults = new Label(); lblResults.Text = String.Format( "{0}, a sum of ${1} has been credited to your account", txtName.Text, dblExpenses); pnlDynamic.Controls.Add(lblResults); }
#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); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load);
} #endregion } } This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: AIM |
last post by:
Error in msvc in building inheritance.obj to build hello.pyd
Hello,
I am trying to build the boost 1.31.0 sample extension hello.cpp.
I can not compile the file inheritance.cpp because the two...
|
by: Gregory |
last post by:
Hi,
One of the disadvantages of using error handling with error codes
instead of exception handling is that error codes retuned from a
function can be forgotten to check thus leading to...
|
by: deko |
last post by:
I use this convention frequently:
Exit_Here:
Exit Sub
HandleErr:
Select Case Err.Number
Case 3163
Resume Next
Case 3376
Resume Next
|
by: Bart de Vries |
last post by:
Hello,
I new on developing with ASP.NET and i wrote some lines of code. This
works fine when all the code is in one page, but when i split it up into and
ASPX file and make an DLL using a...
|
by: Doug Crabtree |
last post by:
I have a project that I am working on that whenever I change the form
controls, or any property on the form controls it rewrites the code for that
form.
I understand that it is supposed to do...
|
by: shin |
last post by:
hi i have an asp.net page and i am trying to transfer control to another
asp.net page
response.redirect works fine but server.transfer gives me the foll error
why is that
...
|
by: Sharon Tal |
last post by:
Compiler Error Message: CS0234: The type or namespace name 'Http' does not
exist in the class or namespace 'System.Runtime.Remoting.Channels' (are you
missing an assembly reference?)
Source...
|
by: Nikhil Patel |
last post by:
Hi all,
I am having a problem adding a reference in an ASP.Net project.
I have written a custom control using a Web Control Library project. I
compiled this project and generated a dll.
Now...
|
by: li.eddie |
last post by:
Hi All,
I'm new to ASP.NET and trying to create a Database application with
MS Visual Web Dev 2005. In my project, I wrote a generic abstract class
called DataAccessHelper.cs under App_Code folder...
|
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...
|
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,...
|
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: 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...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |