Compile Error In Temp cs file

Last post 10-03-2008 11:17 AM by TATWORTH. 5 replies.

Sort Posts:

  • Compile Error In Temp cs file

    10-01-2008, 6:31 PM
    • Member
      point Member
    • Annette08
    • Member since 10-01-2008, 10:18 PM
    • Posts 10

     I don't understand why I'm getting this error.  This page has been able to build numerous times without this problem.

    Server Error in '/MA-Test' Application.

    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: CS1518: Expected class, delegate, enum, interface, or struct

    Source Error:

    Line 298:        
    Line 299:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
    Line 300:        public ma_catalog_aspx() {
    Line 301:            string[] dependencies;
    Line 302:            ((global::System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/MA_Catalog.aspx";

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ma-test\d549fadb\ebd380fd\App_Web_ma_catalog.aspx.cdcab7d2.dk94kct3.0.cs    Line: 300

  • Re: Compile Error In Temp cs file

    10-02-2008, 2:34 AM
    • Participant
      1,094 point Participant
    • ankit.sri
    • Member since 02-27-2008, 7:10 AM
    • Noida
    • Posts 236

    What is the return Type of your Method

    public ma_catalog_aspx()  
    There should be a Type definition of this Method either a Void type if you dont want to return any value like below:
    public void ma_catalog_aspx() {
    //Put your code here 
    Let me know if this works

    A fundamental rule in technology says whatever can be done will be done
  • Re: Compile Error In Temp cs file

    10-03-2008, 5:13 AM
    • All-Star
      62,940 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,306
    • TrustedFriends-MVPs

     The solution that I have found to this is:

    • Re-boot the PC
    • Clear out c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
    • You may also need to clear out C:\Documents and Settings\[USERNAME]\Local Settings\Temp
    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: Compile Error In Temp cs file

    10-03-2008, 10:28 AM
    • Member
      point Member
    • Annette08
    • Member since 10-01-2008, 10:18 PM
    • Posts 10

    thank you for your help. Smile  I found that there were extra brackets on my page which caused the compiler to interpret the code in this manner.  It's strange that the error wasn't red marked before the page was built.

  • Re: Compile Error In Temp cs file - NEW Question

    10-03-2008, 10:47 AM
    • Member
      point Member
    • Annette08
    • Member since 10-01-2008, 10:18 PM
    • Posts 10

    Thank you for your help! Smile

    I did try clearing out the temp files but found that there were extra brackets in my code that caused the complier to interpret my code in this manner.

     Maybe you can help me with something else.  I have been trying for days to make my graphic file that is stored in my database view in a viewer control.  The viewer control is written in java script.

    My application processes a query and the results show up in a gridview control.

    When a user selects one of the records in the gridview control, I want the contents of my "dwg image" file to display in the viewer window. 

     I have the application working to the point that I can pull a "dwg image" file through a file input control and display it in the viewer.  Now I just need it to work with the gridview control. I'm coding is C#.

     

    Here's the java script for a ViewDrawing button event handler.  I want to do this when I select a record in the gridview.

    <script id="clientEventHandlersJS" language="javascript">

    function ViewDrawing_onclick()

    {

    var filepath = document.getElementById("txtDwgFilePath");var dwgViewerCtrl= document.getElementById("dwgViewerCtrl");

    dwgViewerCtrl.PutSourcePath(filepath.value)

    }

     

    This is how far I got on my selected index changed event.  I'm getting an error when I use "dt" .

    protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)

    {

    System.Data.
    DataTable dt = new System.Data.DataTable();

    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

    {

    Control DWGControl = FindControl("dwgViewerCtrl");using (System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["DetailsDBFConnectionString3"].ConnectionString))

     

    {

    System.Data.SqlClient.
    SqlCommand command = new System.Data.SqlClient.SqlCommand("SELECT detail_ID, detail_dwg from [Detail_info]", myConnection);System.Data.SqlClient.SqlDataAdapter ada = new System.Data.SqlClient.SqlDataAdapter(command);

    ada.Fill(dt);

     

    }

     

     

  • Re: Compile Error In Temp cs file - NEW Question

    10-03-2008, 11:17 AM
    • All-Star
      62,940 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,306
    • TrustedFriends-MVPs

     You would be better to mark this thread ans answered and open a new one for your new question!

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Page 1 of 1 (6 items)