473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Adding ImageButton into Datalist

Am trying to add an Image Button into a Datalist at Design time.

When I run it it comes up with error: Server tag not well formed.

It works perfectly when I add just an Image Control. Please help.

<asp:DataList
id="dlstframes"
runat="server">
<ItemTemplate>
<asp:ImageButton runat="server"
ImageUrl="<%# Container.DataItem("pictues") %>" />
</ItemTemplate>
</aspataList>

Please do help. I have serched thru the net to find something to solve this
problem. But cant find any clue.
--
Iyke
Mar 20 '06 #1
3 3063
You probably have figured out by now that you have typo in the syntax. You
needed to use single quotes to enclose the data binding expression because
the latter contains double quotation marks.

<asp:ImageButton runat="server"
ImageUrl='<%# Container.DataItem("pictues") %>' />

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"JuniorProgrammer" wrote:
Am trying to add an Image Button into a Datalist at Design time.

When I run it it comes up with error: Server tag not well formed.

It works perfectly when I add just an Image Control. Please help.

<asp:DataList
id="dlstframes"
runat="server">
<ItemTemplate>
<asp:ImageButton runat="server"
ImageUrl="<%# Container.DataItem("pictues") %>" />
</ItemTemplate>
</aspataList>

Please do help. I have serched thru the net to find something to solve this
problem. But cant find any clue.
--
Iyke

Mar 21 '06 #2
I also missed correcting the syntax for databinding which should have been:
<asp:ImageButton runat="server" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "picturename") %>' />

"Phillip Williams" wrote:
You probably have figured out by now that you have typo in the syntax. You
needed to use single quotes to enclose the data binding expression because
the latter contains double quotation marks.

<asp:ImageButton runat="server"
ImageUrl='<%# Container.DataItem("pictues") %>' />

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"JuniorProgrammer" wrote:
Am trying to add an Image Button into a Datalist at Design time.

When I run it it comes up with error: Server tag not well formed.

It works perfectly when I add just an Image Control. Please help.

<asp:DataList
id="dlstframes"
runat="server">
<ItemTemplate>
<asp:ImageButton runat="server"
ImageUrl="<%# Container.DataItem("pictues") %>" />
</ItemTemplate>
</aspataList>

Please do help. I have serched thru the net to find something to solve this
problem. But cant find any clue.
--
Iyke

Mar 21 '06 #3
I have tried changing the " to ' and have used DataBinder .Eval and now it
comes up with the error message

Control 'dlstProducts__ctl0__ctl0' of type 'ImageButton' must be placed
inside a form tag with runat=server.

But when I close the <asp:ImageButton with </asp:ImageButton> it still comes
up with error

Server tag not well formed.

Is this a problem with my compiler or something. It works perfectly with the
ordinary image control but not with the ImageButton control.

I really want to know what the problem is comeone help.
--
Iyke
"Phillip Williams" wrote:
I also missed correcting the syntax for databinding which should have been:
<asp:ImageButton runat="server" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "picturename") %>' />

"Phillip Williams" wrote:
You probably have figured out by now that you have typo in the syntax. You
needed to use single quotes to enclose the data binding expression because
the latter contains double quotation marks.

<asp:ImageButton runat="server"
ImageUrl='<%# Container.DataItem("pictues") %>' />

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"JuniorProgrammer" wrote:
Am trying to add an Image Button into a Datalist at Design time.

When I run it it comes up with error: Server tag not well formed.

It works perfectly when I add just an Image Control. Please help.

<asp:DataList
id="dlstframes"
runat="server">
<ItemTemplate>
<asp:ImageButton runat="server"
ImageUrl="<%# Container.DataItem("pictues") %>" />
</ItemTemplate>
</aspataList>

Please do help. I have serched thru the net to find something to solve this
problem. But cant find any clue.
--
Iyke

Mar 21 '06 #4

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

Similar topics

1
by: Mike Malter | last post by:
I take it that the only way to add rows to a DataList control is through DataBind? If not, how do I manually add rows to a DataList control? I have searched everywhere and can't find an example...
2
by: Clayton Hamilton | last post by:
I have a DataGrid on a webform bound to a Datasource and can successfully use <ItemTemplate> to create edit/update/cancel functionality for user maintenance of data. I use separate logic to delete...
2
by: Jake | last post by:
Hi All, I have an aspx page with a datagrid which I am using to display a list of thumbnails and their descriptions. The thumbnails are sitting on my harddrive and the links to them are stored...
1
by: Gilles T. | last post by:
Hi, I need to passing parameters in CommandArgument of the asp:ImageButton. I don't use datagrid or datalist Here is my code: Private Sub ImageButtonCommandHandler( sender As Object, e As...
0
by: hn | last post by:
I have an imagebutton as a datalist item. When I click on the image button, the event is not fired. It works fine with Linkbutton. Please help. The code snippet is as followed: <asp:datalist...
2
by: Tomek R. | last post by:
Hello ! I've got weird problem when adding new datagrid item. Here is the situation: my grid dgDeps is binded to DepartmentList arraylist, stored in Session between round-trips.. To add new...
3
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method...
0
by: Chris | last post by:
Hi, i want to access programmatically the ImageButton1 control in order to define the postBackUrl in function of other parameters. I tried: datalist1.findControl("ImageButton1") ... ...
1
by: cradius | last post by:
I've got a custom user control, with a DataList, that is dynamically added to the page. In the DataList is an ImageButton that, when clicked, fires off the ItemCommand event of the DataList and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.