473,322 Members | 1,846 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,322 software developers and data experts.

2 databinds in 1 parameter

I am trying to create a panel control with a tooltip that contains dynamic
information in it. So, when the user hovers over the panel, it shows them
some information on the record. I can get it to work fine with 1 database
field with this statement.

<asp:Panel id="pnlInfo" runat="server" ToolTip='<%#
DataBinder.Eval(container.DataItem, "id", "ID={0}" %>'></asp:Panel>

I'd like to add more fields in the tooltip but get an error when I try to do
this....

<asp:Panel id="pnlInfo" runat="server" ToolTip='<%#
DataBinder.Eval(container.DataItem, "id", "ID={0}" %> <%#
DataBinder.Eval(container.DataItem, "enteredby", "Entered by={0}"
%>'></asp:Panel>

Error I get is Overload resolution failed because no accessible 'ToString'
accepts this number of arguments.

Is this the correct way to do this?

Thanks
Nov 18 '05 #1
1 1019
Mike, you can concatenate using the ampersand (vb) within the one databinding expression like this

Tooltip = '<%# EvalResultingInString1 & EvalResultingInString2, etc. %>

If you want to do fancier string formatting outside of this, or maybe to keep it cleaner, you can also from within the databinding expression call a public function, e.g

<%# FormatToolTip(field1, field2, field3, etc.) %

....where FormatToolTip is a method on your class that takes the parms and returns a single string

Bil

----- Mike Johnson wrote: ----

I am trying to create a panel control with a tooltip that contains dynami
information in it. So, when the user hovers over the panel, it shows the
some information on the record. I can get it to work fine with 1 databas
field with this statement

<asp:Panel id="pnlInfo" runat="server" ToolTip='<%
DataBinder.Eval(container.DataItem, "id", "ID={0}" %>'></asp:Panel

I'd like to add more fields in the tooltip but get an error when I try to d
this...

<asp:Panel id="pnlInfo" runat="server" ToolTip='<%
DataBinder.Eval(container.DataItem, "id", "ID={0}" %><%
DataBinder.Eval(container.DataItem, "enteredby", "Entered by={0}
%>'></asp:Panel

Error I get is Overload resolution failed because no accessible 'ToString
accepts this number of arguments

Is this the correct way to do this

Thank

Nov 18 '05 #2

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

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
2
by: John A Grandy | last post by:
Is there something special in XML about the name "Parameter" ... I am not able to XPATH query for nodes named "Parameter" <Root> <Category CategoryID="1"> <Elements> <Element...
7
by: Steve | last post by:
I used System.Diagnostics.Process.Start(str) to launch application. str is based on the registry setting, in registry, it might be str = rundll32.exe...
2
by: PK | last post by:
Hi, I have an application that opens a Crystal report document and passes in a value to a parameter in the report (pointing to an Oracle DB). However, if I want to pass a "null" value to retrieve...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
3
by: Robert | last post by:
What is the best way to pass a parameter to an ObjectDataSource. I am able to add a new parameter to the SelectParameters, but I would like to just assign a value to an existing parmeter at...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
3
by: Ken Cox [Microsoft MVP] | last post by:
I've been going around and around on this one. I can't believe that it is "by design" as Microsoft says. Here's the situation: In *declarative* syntax, I'm trying to create a default datetime...
5
by: Trevisc | last post by:
Happy Thursday Everyone, I am trying to create a parameter that is one long varchar but that will be used in a SQL statement IN function: //string queryString = GetCurrentTitles(); //Below is...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.