473,661 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2732

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.Data Item, "friendlyname2" ) %>' Checked='<%#
DataBinder.Eval (Container.Data Item, "isCool") %>'></asp:CheckBox>
</td>
<td>
<%# DataBinder.Eval (Container.Data Item, "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.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here


If Not (Page.IsPostBac k) Then

Me.Repeater1.Da taSource = Me.GetDataSet1( )
Me.Repeater1.Da taBind()
End If
End Sub


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

Dim sb As New System.Text.Str ingBuilder
sb.Append("<?xm l version=""1.0"" ?><items>")
sb.Append("<ite m>")
sb.Append("<ite mid>300</itemid>")
sb.Append("<fri endlyname1>Meat s</friendlyname1>" )
sb.Append("<fri endlyname2>MT</friendlyname2>" )
sb.Append(("<ti me>" + DateTime.Now.To LongTimeString( ) +
"</time>"))
sb.Append("<isC ool>true</isCool>")
sb.Append("</item>")
sb.Append("<ite m>")
sb.Append("<ite mid>100</itemid>")
sb.Append("<fri endlyname1>Vege tables</friendlyname1>" )
sb.Append("<fri endlyname2>VG</friendlyname2>" )
sb.Append(("<ti me>" + DateTime.Now.To LongTimeString( ) +
"</time>"))
sb.Append("<isC ool>false</isCool>")
sb.Append("</item>")
sb.Append("<ite m>")
sb.Append("<ite mid>200</itemid>")
sb.Append("<fri endlyname1>Frui ts</friendlyname1>" )
sb.Append("<fri endlyname2>FR</friendlyname2>" )
sb.Append(("<ti me>" + DateTime.Now.To LongTimeString( ) +
"</time>"))
sb.Append("<isC ool>true</isCool>")
sb.Append("</item>")

sb.Append("</items>")

Dim ms As New System.IO.Memor yStream
Dim writer As New System.IO.Strea mWriter(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.InputA ttribute("value ")

Jan 6 '06 #3

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

Similar topics

1
2978
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 datagrid coloum which I want to put the tooltip when the user hovers over it. <asp:BoundColumn DataField="ID" SortExpression="ID" HeaderText="ID"> <HeaderStyle ForeColor="White" CssClass="dgHeader"> </HeaderStyle>
6
2694
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 http://www.lebans.com/DownloadFiles/A2kTooltip.zip So far the classes work perfectly, except that now I need to extend it to support other controls besides the ones given in the example form. I have gotten it to work with some controls, but not others. I...
8
3061
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 (although really we don't assign ToolTips to most of the controls), and then the UserControl exposes a ToolTipText property which sets the same ToolTip for all 3 contained controls. It would be possible to have one ToolTip provider on the form...
3
2538
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 following into the ItemDatabound event for the grif but it wont display If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
3
2907
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 tooltip should help showing the full store name when user hover the the mouse over the currencell. Any help is greatly appreciated.
0
1827
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 ASP:MENU uses images to create the buttons. Unfortunately, I can't get the buttons to link to pages. Also I can't remove the "sitemap" from the left of my menu.
53
4654
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, and .Net2005 code. I'm developing in vb.net 2005. This test sub just reads an input text file, writing out records to another text file, eliminating records that have a '99' in them (it is similar to a CSV file). Some of my concerns are:
1
2971
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 SQL Server 2005 Express and IIS 5.0. I made a page that contains the CreateUserWizard so people can get access to rest of my applications. Using the default (asp:CreateUserWizard) allows us to store data such as username, email address, and password...
2
2686
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: System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip(); foreach (Control ctrl in this.Controls) { if (ctrl is TextBox) {
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7362
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1740
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.