Display a single quote in a GridView's ToolTip
-
The following code works:
<
<
<ToolTip='<%# "View employee information for " & Eval("FullName") & "." %>' />
<
<As I said, all works well here. However, I would prefer to have the following display for the ToolTip instead:
ToolTip='<%# "View " & Eval("FullName") & "' employee information." %>'
However it does not like the single quote ('). I have tried placing 2 and 3 single quotes in a row and it still fails. Any ideas? Thanks, Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
The following code works:
<
<
<ToolTip='<%# "View employee information for " & Eval("FullName") & "." %>' />
<
<As I said, all works well here. However, I would prefer to have the following display for the ToolTip instead:
ToolTip='<%# "View " & Eval("FullName") & "' employee information." %>'
However it does not like the single quote ('). I have tried placing 2 and 3 single quotes in a row and it still fails. Any ideas? Thanks, Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
Try replacing with '
-
Try replacing with '
Thanks for the reply however it literally show up the "'". I even tried the following:
ToolTip='<%# System.Web.HttpUtility.HtmlDecode("View " & Eval("FullName") & "' employee information.") %>'
It failed as well. Any other ideas? Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
Thanks for the reply however it literally show up the "'". I even tried the following:
ToolTip='<%# System.Web.HttpUtility.HtmlDecode("View " & Eval("FullName") & "' employee information.") %>'
It failed as well. Any other ideas? Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
Thanks but I have already tried that as well. I get the usual 'server tag not well formed' error and the page does not render. Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
The following code works:
<
<
<ToolTip='<%# "View employee information for " & Eval("FullName") & "." %>' />
<
<As I said, all works well here. However, I would prefer to have the following display for the ToolTip instead:
ToolTip='<%# "View " & Eval("FullName") & "' employee information." %>'
However it does not like the single quote ('). I have tried placing 2 and 3 single quotes in a row and it still fails. Any ideas? Thanks, Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
Try
ToolTip='<%# MyCodebehindFormatingMethod(Eval("FullName")) %>'
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
-
The following code works:
<
<
<ToolTip='<%# "View employee information for " & Eval("FullName") & "." %>' />
<
<As I said, all works well here. However, I would prefer to have the following display for the ToolTip instead:
ToolTip='<%# "View " & Eval("FullName") & "' employee information." %>'
However it does not like the single quote ('). I have tried placing 2 and 3 single quotes in a row and it still fails. Any ideas? Thanks, Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
I'd rather not use a code-behind function. Here's the work-around I came up with:
ToolTip='<%# "View " & Eval("FullName") & chr(39) & "s employee information." %>'
It doesn't seem to mind the chr(39) with in the html. If anyone comes up with a better one, feel free to post... Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
I'd rather not use a code-behind function. Here's the work-around I came up with:
ToolTip='<%# "View " & Eval("FullName") & chr(39) & "s employee information." %>'
It doesn't seem to mind the chr(39) with in the html. If anyone comes up with a better one, feel free to post... Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
Have you tried string.Format()? I think the Eval function can also be used in the way directly.
It liked this:
ToolTip='<%# String.Format("View " & Eval("FullName") & "{0}s employee information.", chr(39)) %>'
but not this
ToolTip='<%# String.Format("View " & Eval("FullName") & "{0}s employee information.", "'") %>'
For some reason it really jsut does not like the single quote. Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
-
It liked this:
ToolTip='<%# String.Format("View " & Eval("FullName") & "{0}s employee information.", chr(39)) %>'
but not this
ToolTip='<%# String.Format("View " & Eval("FullName") & "{0}s employee information.", "'") %>'
For some reason it really jsut does not like the single quote. Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)
Cracked it! Use
'
. I test it using:<html> <body> <span title='Andy's tooltip'>hello world</span> </body> </html>
Regards Andy
-
Cracked it! Use
'
. I test it using:<html> <body> <span title='Andy's tooltip'>hello world</span> </body> </html>
Regards Andy
Hey that did work and is the best solution. Thanks! Do you have any ideas on this recent post? NavigateUrl='<%=CodeBehindFunction %>' does not work[^] Thanks, Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)