473,399 Members | 3,302 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,399 software developers and data experts.

Using ToolTip to store data

I am using a series of checkbox's in a repeater -- (not the
checkboxlist) -- the problem I am encountering is that the checkbox
does not have a value attribute. I tried to add it via the
"InputAttribute" however it doesn't seem to hold state on a postback.

Is there any reason why I can't use the ToolTip attribute of the
CheckBox control to store data? Then retreive it via another page?

Here's a visualization of what I am trying to accomplish.

CHECK YOUR WEBSITE FEATURES
[x] Flash
[x] Streaming Video
[ ] Search Engine Optimization
[ ] Extra-Bandwidth

Because checkbox values only hold "true | false", I'd like to use the
ToolTip attribute to hold the "value" attribute of the selection - like
a listitem in a checkboxlist or value in the radio button.

Are there any drawbacks to this? Browser issues?

Jan 6 '06 #1
2 2710

Huh?

Not to be mean, but that is a complete Hack.
I think what your missing is the "Text" property.
Here is a sample:

===============aspx code
<form id="Form1" method="post" runat="server">
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox id="chkA" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "friendlyname2") %>' Checked='<%#
DataBinder.Eval(Container.DataItem, "isCool") %>'></asp:CheckBox>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "friendlyname1") %>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>

== end .aspx code
========== code behind page (in vb.net)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here


If Not (Page.IsPostBack) Then

Me.Repeater1.DataSource = Me.GetDataSet1()
Me.Repeater1.DataBind()
End If
End Sub


Private Function GetDataSet1() As DataSet
Dim ds As New DataSet

Dim sb As New System.Text.StringBuilder
sb.Append("<?xml version=""1.0""?><items>")
sb.Append("<item>")
sb.Append("<itemid>300</itemid>")
sb.Append("<friendlyname1>Meats</friendlyname1>")
sb.Append("<friendlyname2>MT</friendlyname2>")
sb.Append(("<time>" + DateTime.Now.ToLongTimeString() +
"</time>"))
sb.Append("<isCool>true</isCool>")
sb.Append("</item>")
sb.Append("<item>")
sb.Append("<itemid>100</itemid>")
sb.Append("<friendlyname1>Vegetables</friendlyname1>")
sb.Append("<friendlyname2>VG</friendlyname2>")
sb.Append(("<time>" + DateTime.Now.ToLongTimeString() +
"</time>"))
sb.Append("<isCool>false</isCool>")
sb.Append("</item>")
sb.Append("<item>")
sb.Append("<itemid>200</itemid>")
sb.Append("<friendlyname1>Fruits</friendlyname1>")
sb.Append("<friendlyname2>FR</friendlyname2>")
sb.Append(("<time>" + DateTime.Now.ToLongTimeString() +
"</time>"))
sb.Append("<isCool>true</isCool>")
sb.Append("</item>")

sb.Append("</items>")

Dim ms As New System.IO.MemoryStream
Dim writer As New System.IO.StreamWriter(ms)
writer.Write(sb.ToString())
writer.Flush()
ms.Position = 0
ds.ReadXml(ms)
Return ds
End Function 'GetDataSet1

=== end vb.net code behind


PS

My method for generating a DS is for EXAMPLE's only.
It is not a good way to do it. (Just in case somebody sees this for a
non checkbox question)

...
LisaBigJax wrote:
I am using a series of checkbox's in a repeater -- (not the
checkboxlist) -- the problem I am encountering is that the checkbox
does not have a value attribute. I tried to add it via the
"InputAttribute" however it doesn't seem to hold state on a postback.

Is there any reason why I can't use the ToolTip attribute of the
CheckBox control to store data? Then retreive it via another page?

Here's a visualization of what I am trying to accomplish.

CHECK YOUR WEBSITE FEATURES
[x] Flash
[x] Streaming Video
[ ] Search Engine Optimization
[ ] Extra-Bandwidth

Because checkbox values only hold "true | false", I'd like to use the
ToolTip attribute to hold the "value" attribute of the selection - like
a listitem in a checkboxlist or value in the radio button.

Are there any drawbacks to this? Browser issues?


Jan 6 '06 #2
Actually, I can't use the TEXT attribute because that is dynamically
generated by conectation of several fields - the above example (which I
made up) did not illustrate that.

Anyway, I did solve the problem by adding an sub in the pre-render
event of the Repeater using the InputAttribute.Add("value").

Then I just recalled it via the next page.
checkboxvalue = checkbox.InputAttribute("value")

Jan 6 '06 #3

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

Similar topics

1
by: Stephen | last post by:
Is it possible to add a tooltip in the column of a Datagrid. Can someone please show me how I would do this for the datagrid column below. Thanks for any help anyone can give me. Here is the...
6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
8
by: Rachel Suddeth | last post by:
I have an application where some forms have many (say 100) UserControls on them (each of which contain a label, an image, and a data entry control), and each UserControl has a ToolTip provider...
3
by: Craig G | last post by:
what way do you code it? i tried the following but it wouldnt display it lblAdd_info is a hidden field in the cell itself that contains the data i want to display in the tooltip text. i added the...
3
by: Bill Nguyen | last post by:
I would like to display tooltip for the currenCell (selected). For example Col1 = storeID Col2 = Store name. Since Col2's width is 20 characters, some of the tore names are truncated. The...
0
by: Frenchie | last post by:
Hi, I have created a very neet menu from an example found on the MSDN library at: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitembinding.imageurlfield.aspx My...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
1
by: kcddoorman | last post by:
I have searched all over the internets for a solution to this problem and there are many ways to work around it but I'm wondering if there is a more simple solution. I have asp.net 2.0 working with...
2
by: =?Utf-8?B?Unlhbg==?= | last post by:
I have a winform with 20 text boxes; some text boxes have default values and some are blank. I have the following code to display ToolTip for each of the TextBox controls: ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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,...

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.