473,508 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Item Template problem in Datagrid

Hi all,

I have a itemtemplate in a DataGrid and it works fine on VB .NET but the
same does not work in C#

<asp:Templatecolumn HeaderText="EVID" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "EVID").ToString() %>
<asp:HyperLink runat="server" id="myLink" text="View..." NavigateUrl='<%#
"default.aspx?id=" & Container.DataItem("EVID") %>' / <---happens here
</ItemTemplate>
</asp:Templatecolumn>

what am i missing?

I get this error: (IN C#)
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: CS0019: Operator '&' cannot be applied to operands
of type 'string' and 'object'
Thanks,
Stephen
Nov 20 '06 #1
1 1011
<asp:HyperLink runat="server" id="myLink" text="View..." NavigateUrl='<%#
"default.aspx?id=" & Container.DataItem("EVID") %>' />
Hello Stephen!

try this,

<asp:HyperLink runat="server" id="myLink" text="View..."
NavigateUrl='<%#
"default.aspx?id=" + Container.DataItem("EVID").ToString() %>' />

and kindly let me know in any case.

Regards,
Mohsin Rizvi

Nov 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
314
by: Yazeed | last post by:
im adding a Calendar using a template withing a datagrid in edit item template, how can i access the value of the selected date? or where to handle the event SelectedDateChanged ?
7
4201
by: localhost | last post by:
A DataGrid with shows a label in one of the columns when in view mode. When in edit mode, I want to show a dropdown, and have the default selection set to what the textbox used to be. Right now...
1
375
by: Paul | last post by:
There are a number of places in my app where I want the user to work with an item (a real physical item referred to by its stock number) If such an item hasn't been selected, I redirect the user...
3
9869
by: Stimp | last post by:
I have a datalist that outputs a link to a picture in each ItemTemplate: e.g. <asp:DataList id="DataList1" ...etc> <ItemTemplate> <a href='Pic.aspx?pic=somenumber'>picture</a> </ItemTemplate>...
3
7297
by: Big Dave | last post by:
I know it's been asked a million times before, but I still can't seem to find an answer that works. I've got a dropdown list in the footer template of a datagrid. The dropdown list databinds,...
0
1059
by: yezanxiong | last post by:
My datagrid is built by coding, based on template table, and item has checkbox, label, and textbox. I set 10 rows in one page. and I can also set the width value for each column. Because if...
1
2821
by: Julius Fenata | last post by:
Dear all, I need help to change my item-template value format... Here is my case, I have a datagrid, with 'SubjectPrice' field, and when the grid displayed, my 'SubjectPrice' field displayed...
2
3662
by: Luis Esteban Valencia Muñoz | last post by:
I have a datagrid that displays editable text fields (2 different price fields) and a checkbox in every row. It has a "SaveChanges" button at the bottom, which, when pressed, looks at every...
9
2678
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
1
2735
by: Abhishek | last post by:
I am creating a Datagrid at runtime and I have to create all the columns of grid at runtime... I am facing problem in the item template column. Here I want to place more than one control... For...
0
7133
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...
0
7336
Oralloy
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,...
0
7405
jinu1996
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...
0
5643
agi2029
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,...
1
5059
isladogs
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...
0
4724
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...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
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...

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.