473,503 Members | 3,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1052
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
3818
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
16920
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
2731
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
4069
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
19313
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
9541
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
6869
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
3144
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
8002
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
5295
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...
0
7188
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
7063
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
7258
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,...
1
6970
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
5558
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,...
0
4663
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
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
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.