473,893 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CS0654: Method 'Chapter7.Singl eBind.GetImageU RL()' referenced without parentheses

80 New Member
Hello, I am currently working on an ASP.NET web application. When I compile my code behind the page, I do not get any errors ;however, when I attempt to view my code in a browser I get the error that is the title of this post. I am going to include a copy of my code behind the page, and my .aspx file code, can anyone help me out here? I am using Visual Studio.NET 2003, and my code behind the page is written in C#.

Here is the error as it appears in my browser:
Expand|Select|Wrap|Line Numbers
  1. Compilation Error 
  2. 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. 
  4. Compiler Error Message: CS0654: Method 'Chapter7.SingleBind.GetImageURL()' referenced without parentheses
  6. Source Error:
  10. Line 16:                 Font-Names="Trebuchet MS" ForeColor="DarkSlateGray" Font-Size="Medium">Single Data Binding</asp:label><asp:label id="lblImageURL" style="Z-INDEX: 104; LEFT: 168px; POSITION: absolute; TOP: 132px"
  11. Line 17:                 runat="server" Font-Names="Trebuchet MS" Font-Size="X-Small" Width="100px" Height="30px"><%# ImageURL %>
  12. Line 18:             </asp:label><asp:textbox id=txtImageURL style="Z-INDEX: 110; LEFT: 167px; POSITION: absolute; TOP: 193px" runat="server" Width="104px" Text="<%# ImageURL %>"></asp:textbox><asp:image id=imgImageURL style="Z-INDEX: 108; LEFT: 166px; POSITION: absolute; TOP: 255px" runat="server" ImageUrl="<%# GetImageURL %>">
  13. Line 19:             </asp:image><asp:label id="Label4" style="Z-INDEX: 105; LEFT: 293px; POSITION: absolute; TOP: 131px" runat="server"
  14. Line 20:                 Font-Names="Trebuchet MS" Font-Size="X-Small" Width="184px" Height="38px">Displays the image name using an ASP.NET label control</asp:label><asp:label id="Label5" style="Z-INDEX: 106; LEFT: 293px; POSITION: absolute; TOP: 194px" runat="server"
Here is my code behind the page:
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  12. namespace Chapter7
  13. {
  14.     /// <summary>
  15.     /// Summary description for Products.
  16.     /// </summary>
  17.     public class SingleBind : System.Web.UI.Page
  18.     {
  19.         protected System.Web.UI.WebControls.Label lblImageURL;
  20.         protected System.Web.UI.WebControls.Image imgImageURL;
  21.         protected System.Web.UI.WebControls.Label Label4;
  22.         protected System.Web.UI.WebControls.Label Label5;
  23.         protected System.Web.UI.WebControls.Label Label7;
  24.         protected System.Web.UI.WebControls.TextBox txtImageURL;
  25.         //protected System.Web.UI.HtmlControls.HtmlInputText txtImageURL;
  26.         protected System.Web.UI.WebControls.Label Label1;
  28.         protected string ImageURL 
  29.         {
  30.             get 
  31.             {
  32.                 return "logo.gif";
  33.             }
  34.         }
  35.         protected string GetImageURL()
  36.         {
  37.                 return "images/logo.gif";
  38.         }
  39.         private void Page_Load(object sender, System.EventArgs e)
  40.         {
  41.             Page.DataBind();
  42.             // Put user code to initialize the page here
  43.         }
  45.         #region Web Form Designer generated code
  46.         override protected void OnInit(EventArgs e)
  47.         {
  48.             //
  49.             // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  50.             //
  51.             InitializeComponent();
  52.             base.OnInit(e);
  53.         }
  55.         /// <summary>
  56.         /// Required method for Designer support - do not modify
  57.         /// the contents of this method with the code editor.
  58.         /// </summary>
  59.         private void InitializeComponent()
  60.         {    
  61.             this.Load += new System.EventHandler(this.Page_Load);
  63.         }
  64.         #endregion
  65.     }
  66. }
And here is my .aspx file in its entirity:
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="c#" AutoEventWireup="false" Codebehind="SingleBind.aspx.cs" Inherits="Chapter7.SingleBind" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML>
  4.     <HEAD>
  5.         <title></title>
  6.         <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
  7.         <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
  8.         <meta content="JavaScript" name="vs_defaultClientScript">
  9.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10.     </HEAD>
  11.     <body MS_POSITIONING="GridLayout">
  12.         <form id="Form1" method="post" runat="server">
  13.             <IMG style="Z-INDEX: 101; LEFT: 4px; POSITION: absolute; TOP: 6px" src="images/header2.jpg">
  14.             <IMG style="Z-INDEX: 102; LEFT: 21px; POSITION: absolute; TOP: 96px" src="images/menu.gif">&nbsp;&nbsp;
  15.             <asp:label id="Label1" style="Z-INDEX: 109; LEFT: 218px; POSITION: absolute; TOP: 71px" runat="server"
  16.                 Font-Names="Trebuchet MS" ForeColor="DarkSlateGray" Font-Size="Medium">Single Data Binding</asp:label><asp:label id="lblImageURL" style="Z-INDEX: 104; LEFT: 168px; POSITION: absolute; TOP: 132px"
  17.                 runat="server" Font-Names="Trebuchet MS" Font-Size="X-Small" Width="100px" Height="30px"><%# ImageURL %>
  18.             </asp:label><asp:textbox id=txtImageURL style="Z-INDEX: 110; LEFT: 167px; POSITION: absolute; TOP: 193px" runat="server" Width="104px" Text="<%# ImageURL %>"></asp:textbox><asp:image id=imgImageURL style="Z-INDEX: 108; LEFT: 166px; POSITION: absolute; TOP: 255px" runat="server" ImageUrl="<%# GetImageURL %>">
  19.             </asp:image><asp:label id="Label4" style="Z-INDEX: 105; LEFT: 293px; POSITION: absolute; TOP: 131px" runat="server"
  20.                 Font-Names="Trebuchet MS" Font-Size="X-Small" Width="184px" Height="38px">Displays the image name using an ASP.NET label control</asp:label><asp:label id="Label5" style="Z-INDEX: 106; LEFT: 293px; POSITION: absolute; TOP: 194px" runat="server"
  21.                 Font-Names="Trebuchet MS" Font-Size="X-Small" Width="192px" Height="40px">Display the image name in an ASP.NET textbox control</asp:label><asp:label id="Label7" style="Z-INDEX: 107; LEFT: 293px; POSITION: absolute; TOP: 254px" runat="server"
  22.                 Font-Names="Trebuchet MS" Font-Size="X-Small" Width="190px" Height="54px">Displays the image name in an ASP.NET image button control</asp:label></form>
  23.     </body>
  24. </HTML>
Any help that could be provided in this area, would be greatly appreciated.
Feb 21 '07 #1
1 2588
80 New Member
I figured it out just now, I needed to remove the "get" statement in the C# code, and I needed to add "()" to "ImageURL" and "GetImageUR L" in the code behind the page, and all of the databinding statments: < %ImageURL() %>
Feb 21 '07 #2

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

Similar topics

by: Martin Bless | last post by:
Why can't we have an additional 'print' statement, that behaves exactly like 'print' but doesn't insert that damn blank between two arguments? Could be called 'printn' or 'prin1' or 'prinn' anything similar you like. Would make my life so much easier. Often I start with a nice and short print statement, then there happen to be more arguments and neat formatting becomes more important and as a result I find myself
by: Steve | last post by:
Hi I have decided it is time to learn Javascript (I know PHP fairly well, so I thought it shouldn't be too difficult!!!) I have a couple of question though, which I can highlight with the following code... --- function mysortfn(a,b) {
by: Max Adams | last post by:
Using System.Timers.ElapsedEventHandler to specify a method and and ElapsedEventArgs object I've trawled the internet looking for some help on this topic. What I want to do is, every x seconds call function y with some parameters. Simple. The ElapsedEventArgs paramerter I want to pass in is an object "c" of a custom type. The following does not work: Clock.Elapsed += new System.Timers.ElapsedEventHandler( OnTimer, new
by: Howard Bryce | last post by:
I have come across code containing things like sizeof int How come that one can invoke sizeof without any parentheses surrounding its argument? Is this admissible within the standard? Can it in general be done with one argument functions? Why would one want to do it anyway, other than showing that one knows and to save two characters?
by: gilad | last post by:
hi, I would like to get the address of a class method in an instance. In the following sample the third like access the method. how can I get the address into a long variable - something like - long addr = B->*local_method ... (this does not work) class BCls { public: void method(void ) {
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; //every class may have this statement self.hello = function() {
by: Kevin Walzer | last post by:
I am trying to structure a Tkinter application with classes instead of just with simple functions, but I'm not sure how to call methods from my main class. My main class is packetstreamApp(). Within that class I call various methods, including drawGUI() and authorizeDump(). My problem comes when I try to call authorizeDump from the Tkinter menu. Here is the code that calls authorizeDump(): self.packetmenu.add_command(label="Start...
by: placid | last post by:
Hi all, Is it possible to be able to do the following in Python? class Test: def __init__(self): pass def puts(self, str): print str
by: Lyn | last post by:
Can anyone explain this for me? A sub procedure can be called with or without parentheses around the arguments. By personal convention, I normally use parentheses. I am in the middle of a fairly large project (for me), happily using parentheses everywhere -- until this happened: The following sub is defined in a class module. Public Sub DeleteXXRecord(lngEORekNombro As Long, lngXXRekNombro As Long)
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.