Compiler Error Message: CS1026: ) expected

I want to put a hyperlink with the following code, but it display the error--Compiler Error Message: CS1026: ) expected, PLEASE CAN ANYONE HELP ME??

<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl='<%#"product.aspx?productID="DataBinder.Eval(Container, "DataItem.ProductID")%>' ID="Hyperlink1">
<%# DataBinder.Eval(Container, "DataItem.CategoryName") %>
</asp:HyperLink>
</ItemTemplate>
and CODE BEHIND:::
namespace Ecommerce
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataList listCategory;

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
loadCategory();
}
// Put user code to initialize the page here
}
void loadCategory()
{
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" + Server.MapPath("db.mdb");
OleDbConnection dbConnection = new OleDbConnection(connectionString);
string queryString = "SELECT CategoryName, CategoryID from Category";
OleDbDataAdapter objAdapter = new OleDbDataAdapter(queryString, dbConnection);
DataSet dsCategory = new DataSet();
objAdapter.Fill(dsCategory, "Suppliers");
listCategory.DataSource = dsCategory;
listCategory.DataBind();
}

}
}
0
prabinkcm
8/23/2004 3:26:28 PM
asp.net.presentation-controls 72751 articles. 2 followers. Follow

6 Replies
383 Views

Similar Articles

[PageSpeed] 2

You are missing an ampersand in ..........?productID="DataBinder....., should be

..........?productID=" & DataBinder.........
Bug [MCSD]
0
Bug_Bugger
8/23/2004 5:29:29 PM
Are you sure of this??


<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl='<%#"product.aspx?productID="DataBinder.Eval(Container, "DataItem.ProductID")%>' ID="Hyperlink1">
<%# DataBinder.Eval(Container, "DataItem.CategoryName") %>
</asp:HyperLink>
</ItemTemplate>

I suppose it wud work had u coded like below..Also note the change I applied to this
<%# DataBinder.Eval(Container, "DataItem.CategoryName") %>

<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl="product.aspx?productID=" '<%#DataBinder.Eval(Container.DataItem, "ProductID")%>' ID="Hyperlink1">
<%# DataBinder.Eval(Container.DataItem, "CategoryName") %>
</asp:HyperLink>
</ItemTemplate>

hth

Shravan Addaypally MCP

0
shravan79
8/23/2004 5:31:37 PM
I tried the ampersand but there is still the error:: 

Operator '&' cannot be applied to operands of type 'string' and 'object'
Please help me.
I have already looked into more than 100 websites, but still could not solve.......
0
prabinkcm
8/24/2004 2:14:53 AM
thanks for your modified version, but it seems you have mistakenly type a totally wrong code: With your code in the "html" Visual Studio cannot create  a DataList in the Design mode and display error: 

Error Creating Control List Control

Could you please revise the code and help me........I have tried and ,looked in more than 100 websites but still I cannot solve it.
0
prabinkcm
8/24/2004 2:16:59 AM
Try


<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl='<%#"product.aspx?productID=" + DataBinder.Eval(Container.DataItem,"ProductID").ToString()%>' ID="Hyperlink1">
<%# DataBinder.Eval(Container.DataItem,"CategoryName") %>
</asp:HyperLink>
</ItemTemplate>

Sushila Bowalekar Patel
Visual ASP/ASP.NET MVP
http://weblogs.asp.net/sushilasb
0
SushilaSB
8/24/2004 3:59:18 AM
Unfortunately, 


NavigateUrl="product.aspx?productID=" '<%#DataBinder.Eval(Container.DataItem, "ProductID")%>'

will never work. The whole property value assigned must be enclosed into the <%# %> tags. Appending .ToString() must fix the current error
Bug [MCSD]
0
Bug_Bugger
8/24/2004 9:09:13 AM
Reply:

Similar Artilces:

Compiler Error Message: CS1026: ) expected #2
Hi I hope someone can help with a compiler error message as follows   <asp:HyperLink ID="HyperLink1" runat="server" Height="29px" NavigateUrl='<%# String.Format("Eval("Hyper")?Telecomitaccno={0}&BUSINESSSTREAM={1}&Dealer={2}", Eval("Telecomitaccno"), Eval("BusinessStream"), Eval("Dealer")) %>' The hyperlink is designed to evaluate a hyperling value from a table and then navigate to it carrying forward three items of information. The hyperlink works carrying the three pieces o...

Compiler Error Message: CS1026: ) expected
Hello,I have a simple web form that runs on a windows 2003 server with the 2.0 .NET framework but when I move the app over to a Windows 2000 server running the 1.1 framework it gives me a strange error. If it's not something specific with that then it may be the COM component I'm calling but I was hoping I could get a hand debugging this. I've looked at a lot of other posts with similar error messages but those all seem to point to inline ASP with a # between the <% %> tags. I do call this page from a javascript function below but it's just a window.open.On the Windows ...

Compiler Error Message: CS1003: Syntax error, ':' expected
hent..." : "slett..."%>Hi, i have error in the belowed statement. It says " CS1003: Syntax error, ':' expected" If any body help me, It would be grateful.. Thanks in advance.   Compiler Error Message: CS1003: Syntax error, ':' expectedSource Error: Line 28: <td style="border:1;"><%# Eval("Person")%></td> Line 29: <td style="border:1;"><%# Eval("ass")%></td> Line 30: ...

Compiler Error Message: The compiler failed with error code1.
 Hi all, I just installed the software which was fine and no errors... when i went to run it first time at local host it came up with the following error... anyone know what this means?? I have created different ASP.NET projects and it runs no problem... Regards Sicose Server Error in '/PortalVBSDK' 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: The compiler failed...

Compiler Error Message: The compiler failed with error code 128
I recently installed the .net framework 1.1 to one of my IIS servers. I have been running the .net and some of the starter kits on my dev box and it works just great. In addition to trying the time tracking starter kit (which also works great on my dev box), I have tried a very simple test.aspx page. I would appreciate any help or direction on what to do about this. I am new to .net and not even sure what to try to resolve this problem Thanks in advance. -Bob Server Error in '/TTWebVBVS' Application. ----------------------------------------------------------------------...

Compiler Error Message: The compiler failed with error code -1073741502
Hi all, I am posting this just in case this information is useful for other people. I have an ASP.Net page created with VS2005 worked perfectly when running in release mode, but it consistently gave me the following error when running in debug mode within VS2005: Compiler Error Message: The compiler failed with error code -1073741502  The problem was solved after restarting VS.Hong Hi, I appreciate that you share your experience here. Thanks, ThomasThomas SunMicrosoft Online Community SupportPlease remember to click “Mark as Answer” on the post that helps you, and to click...

Compiler Error Message: The compiler failed with error code 128.
 I have deployed my website to a server hosted by a hosting company. (WebHost4life). I keep getting an error message when I try to access the web application via the assigned URL. Does anyone know what the problem is? Why am I getting this error message and how do I fix it? Server Error in '/' 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: The compiler failed with error code 128...

Compiler Error Message CS1002; expected
Can anyone tell me why this is erroring out? <title><b>User:</b><%Response.Write (Request.ServerVariables("LOGON_USER"))%></title>  Add a semicolon at the end.. <%Response.Write (Request.ServerVariables("LOGON_USER"));%> Alternativley you could write<%= Request.ServerVariables("LOGON_USER") %> in which case a semicolon is not required. amar  Adding this code I get  Compiler Error Message: CS0118: 'System.Web.HttpRequest.ServerVariables' is a 'property' but is used l...

Compiler Error Message: CS1002: ; expected
anybody can tell me what is the wrong for below line, i got error message Compiler Error Message: CS1002: ; expected SqlConnection myConnection = New SqlConnection(ConfigurationSettings.AppSettings["connectionString1"]); Thanks SABU Is that a direct copy and paste of your code? Because the "new" keyword needs to be all lowercase.Alister...

Compiler Error Message: CS1002: ; expected
Hello, I keep getting the following error : Server Error in '/' 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: CS1002: ; expected Source Error: Line 220: cmd.ExecuteNonQuery(); Line 221: SqlCommand cmd = new SqlCommand("SELECT LASTUSED FROM MRISEQ WHERE UPPER(SEQID)='CASEID'", conn); Line 222: Dim lastused As OleDb...

Compiler Error Message: BC30203: Identifier expected.
Hi all, Getting this error on line 12 of my source code, it's only a simple example and I think the code is right, but I can't figure out whats causing it. Compiler Error Message: BC30203: Identifier expected. Line 10: Dim objRdr As OleDbDataReader Line 11: Line 12: objConn = New OleDbConnection( _"Provider=Microsoft.Jet.OleDb.4.0;" & _"Data Source=C:\finalyearproject2\" & _"projectallocation.mdb") Line 13: objCmd = New OleDbCommand("SELECT * FROM project_descriptions", objConn) Line 14: objConn.Open() Her...

Compiler Error Message: BC30188: Declaration expected.
This is my code: When I run this I get the error "Compiler Error Message: BC30188: Declaration expected.". What is wrong ? The error points out to the statement >Line 7: Response.write ("HI") ' Insert page code here ' Response.write ("HI") Sub Page_OnLoad(sender As Object, e As EventArgs) response.write ("hi there" ) end Sub Function GetSomeDates() As System.Data.IDataReader Dim connectionString As String = "server='(local)'; trusted_connection=true; database='Orders'" Dim dbConnection...

Web resources about - Compiler Error Message: CS1026: ) expected - asp.net.presentation-controls

Compiler - Wikipedia, the free encyclopedia
... , or external linking . The most common reason for wanting to transform source code is to create an executable program. The name "compiler" ...

Compiler - Wikipedia, the free encyclopedia
"Compile" and "compiling" redirect here. For the software company, see Compile (publisher) . For other uses, see Compilation . This article has ...

Facebook Open-Sources HipHop PHP Compiler Software
Earlier this morning, Facebook officially made their new PHP “compiler,” called HipHop, available as open source software. In the blog post by ...

Art in the Age of Matter Compilers
jurvetson posted a photo: Sheba may be the harbinger of art in the digital age — a mathematical sculptor with digital matter. She manipulates ...

Interpreters and Compilers (Bits and Bytes, Episode 6) - YouTube
This animation explains the difference between interpreters and compilers. It is from Episode 6 of the classic 1983 television series, Bits and ...

Typesafe cofounder forking Scala compiler
The main contributor to the Scala compiler, Paul Phillips, has announced on GitHub that he is forking the compiler to “fix some of the innumerable ...

Does Apple's new developer agreement ban Adobe's Flash-to-iPhone compiler?
Given that any kind of formal truce between Apple and Adobe was essentially blown out of the water by Steve Job's very public slating of Flash ...

Apple seeds devs with Safari 5.2 for Lion, Xcode 4.4 with new LLVM compiler
... to the general public this summer. Among the new features: According to Apple, Xcode 4.4 includes an editor for Collada 3D files, compiler support ...

NVIDIA and Continuum Analytics Announce NumbaPro, A Python CUDA Compiler
... are announcing that they are bringing Python support to CUDA. Specifically, Continuum Analytics’ will be introducing a new Python CUDA compiler, ...

IntelliJ Releases IDEA 12, Brings Improved UI, New Compiler Mode, Android UI Designer, And More
I'm not going to pretend to be a developer here, and I'll openly admit that the bulk of what IDEA 12 does is over my head. However, I do understand ...

Resources last updated: 12/6/2015 1:36:04 PM