|
|
 |
| Classic ASP Components Discussions specific to components in ASP 3. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Components section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

April 19th, 2005, 09:06 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Location: Wuhan, Hubei, China.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
how to bind a data()
Hi everyone!
How can we bind a data which is selected from a database to a control(not datagrid ,datalist or repeater) such as a Label or a Linkbutton control ?
for example,if I want to bind a picture to the linkbutton control,and the picture is stored in a database,so how shall I do?
Thanks in advance!
Candle
__________________
Candle
|

April 19th, 2005, 09:22 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You cant bind data from database to Label or LinkButton control.
|

April 19th, 2005, 03:36 PM
|
 |
Wrox Author
Points: 33,563, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
Quote:
quote:Originally posted by Santhi
You cant bind data from database to Label or LinkButton control.
|
You can't???
What about something like this:
<asp:Label id="lblTest" runat="server" Text='<%# SomeDatabindingExpression %>' />
Wouldn't that bind the results of SomeDatabindingExpression to the label?
Candle, are you trying to display a blob from the database, or did you store the *path* to the image in the database?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|

April 20th, 2005, 03:01 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry Candle,as imar said you can bind data for label controls using databinding expression.But we can't directly bind as we do in DataGrid,DataList or repeater controls.You can put the database related operations in function and return the whatever value you want to bind to label control using <%#%>..
|

April 20th, 2005, 03:35 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Location: Wuhan, Hubei, China.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks!
I did store the path of the image in the database,but cannot bind it to the linkbutton's imageurl property.maybe i can use a function.
Candle
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |