CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 12/18/2003 6:09:48 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 72 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
tamaradobson
Asp.Net User
CS1518 Error in User Control12/18/2003 6:09:48 AM

0

Hello. I've been having a lot of trouble with a user control that I've been trying to create. I'm trying to make a dynamic hierarchical menu that displays a submenu whenever a main category item is clicked. I've gone through many incarnations of this, with DataLists, Repeaters and hidden Panels, and nothing's worked.

Right now, I'm trying to run the method that will display my submenu panel and I'm getting the following error:

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 111: #line hidden
Line 112:
Line 113: public leftnav_ascx() {
Line 114: if ((ASP.leftnav_ascx.__initialized == false)) {
Line 115: ASP.leftnav_ascx.__initialized = true;

Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\2135a508\8d69a834\qewupd-o.0.cs Line: 113

I've read some of the forums, and I know that this message is usually produced when the type of method is not specified, however I've made sure that that is not the case in my code. Could someone take a look at it and tell me if there's something else that I'm doing wrong?

Thanks.


<%@ Control Language="C#" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">

protected void Page_Load(Object Src, EventArgs e) {

if (!Page.IsPostBack) {
OleDbConnection myConnection;
OleDbDataAdapter myCommand;

pnlSubNav.Visible = false;

myConnection = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("/work/boc/bocxp-02084/db/bocxp-02084.mdb") + ";Persist Security Info=false;");
myCommand = new OleDbDataAdapter("SELECT catID, catName FROM cat WHERE catOrder > 0 ORDER BY catOrder ASC", myConnection);

DataSet dsLeftNav = new DataSet();
myCommand.Fill(dsLeftNav, "Categories");

ddlLeftNav.DataSource=dsLeftNav.Tables["Categories"].DefaultView;
ddlLeftNav.DataBind();
}
}

protected void SubNavSelect(Object sender, EventArgs e) {

OleDbConnection myConnection;
OleDbDataAdapter myCommand;

myConnection = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("/work/boc/bocxp-02084/db/bocxp-02084.mdb") + ";Persist Security Info=false;");

myCommand = new OleDbDataAdapter("SELECT subcat.subcatID, subcat.catID, subcat.subcatName, cat.catName FROM subcat WHERE subcat.subcatID=" + ddlLeftNav.SelectedItem.Value + " LEFT JOIN cat ON subcat.catID=cat.catID ORDER BY subcat.subcatOrder ASC", myConnection);

DataSet dsSubCat = new DataSet();
myCommand.Fill(dsSubCat, "SubCategories");

rptSubNav.DataSource = dsSubCat.Tables["SubCategories"].DefultView;
rptSubNav.DataBind();

pnlSubNav.Visible = true;
}
}
</script>
<table width="150" cellpadding="0" cellspacing="0" border="0">
<tr><td>
<asp:DropDownList id="ddlLeftNav" AutoPostBack="true" DataTextField="catName" DataValueField="catID" OnSelectedIndexChanged="SubNavSelect" runat="server">
</asp:DropDownList>
</td></tr>
<asp:panel id="pnlSubNav" runat="server">
<tr><td align="center">
<asp:Repeater id="rptSubNav" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "subcatName") %><br/>
</ItemTemplate>
</asp:Repeater>
</td></tr>
</asp:panel>
<tr><td align="center">
<br/><img src="/work/boc/bocxp-02084/images/ads/PoweredByASPNET.gif" alt="Powered by ASP.Net" border="0"/>
</td></tr>
</table>
master4eva
Asp.Net User
Re: CS1518 Error in User Control12/18/2003 11:51:07 AM

0

The error is being produced because of a syntax error - what you have got there is a constructor syntax. The problem that I am having is that there is no such similar type of line in your provided code. Could you identify where this line is coming from?
-- Justin Lovell
tamaradobson
Asp.Net User
Re: CS1518 Error in User Control12/19/2003 2:06:13 AM

0

I'm not really sure what you mean. Are you saying that I'm supposed to be creating a constructor but haven't specified as such in my code? As to which line is generating the error, I believe it's the SubNavSelect() method that I'm trying to call after the Page_Load. I know that a .dll has been stored in the temporary file listed in the error message, but I'm not sure if it can be cleared, or if there's some other error in the code that I've written. I've pasted the entire code for the control in my posting above. Is there a line that I'm supposed to include to make it act as a constructor?
master4eva
Asp.Net User
Re: CS1518 Error in User Control12/19/2003 12:55:10 PM

0

Ok, if this all your code, then there is something else wrong. You might want to check the bin directory to see if there is any "loose" assemblies in there. If not, then try the following command line from your desired framework (will be located in the windows folder under microsoft.net folder):

regiis -i

-- Justin Lovell
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
First asp.net error. Pl help (69,16): error >CS1518: Expected class, delegate, enum, interface, or ... User Control Panel, Private Messages, Subscriptions, Search Forums ...
CodeProject: PLINQO - Supercharge LINQ to SQL. Free source code ... Aug 17, 2007 ... Static & Panel Controls .... IncludeFunctions, Include stored procedures and user functions in mapping. .... (185,16): error CS1518: Expected class, delegate , enum, interface, or struct (195,25): error CS1518: Expected ...
Compiler Error Message: CS0433: - v1.9.1.x Issues - Yet Another ... It's static and doesnt have any login controls or anything with a link to the Forum. ..... MyDomain.com\Forum\App_Code\YAF\Forum.cs(120,22): error CS1518: ... User Profile; Hide User Posts. Users browsing this topic ...
I have error I can't figure out. It says Expected class, delegate ... and then add the user to the selected roles ... Error CS1518: Expected class, delegate, enum, interface, or struct… Problem ... This error occurs when a record or a table control is deleted and one or more of the global ...
CodeProject: PLINQO - Supercharge LINQ to SQL. Free source code ... Static & Panel Controls .... IncludeFunctions, Include stored procedures and user functions in mapping. IncludeViews, Include views in mapping. .... (185,16) : error CS1518: Expected class, delegate, enum, interface, or struct ...







how to integrate google checkout for shopping cart in asp.net

using post method urgent

problem in expressions ??????

dropdownlist with no results

error message: date of pramater can not turn system.string to system.datetime ?

console.writeline output window

img tag problem

delete file error??

datasources

auto-update web site

number of web sites creation on single iis server

converting from string to int

the process cannot access the file <> because it is being used by another process

checkbox problem

how to: send email with submit button

monitoring pages

commandeventhandler and multiview control

arraylist to datatable error "this row already belongs to another table"

.net changes my id tags. how do i deal with this?

page cannot be refreshed without resending the information.

sending querystring to particular frame

accessing web controls in a placeholder???

input mask error - dll problem

online designer products

writing pdf documents using vb.net

how to know which ddl caused the postback?

automated positioning of web form elements

usercontrol inside usercontrol problem

file in use error when using excel

does it matter to disable view state in an asp.net button ?

   
  Privacy | Contact Us
All Times Are GMT