Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2008, 03:00 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default [Resolved] Call JScript tootip function

I have problems calling the JScript tooltip function. See code below.

This line works: e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip()")

This line does not work: e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip()" & myControl1.Text)
VB Code

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

Code:
If e.Row.RowType = DataControlRowType.DataRow Then
Dim myControl1 As Label = e.Row.FindControl("Label2")
 If (Not myControl1 Is Nothing) Then
  e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip()")
  e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip()" & myControl1.Text)
  e.Row.Cells(3).Attributes.Add("onmouseout", "hideToolTip(this)")
 End If
End If
End Sub
Mark up code:

Code:
<script type="text/javascript" language="javascript">
        function showToolTip(ctrSource, text) 
        { 
            alert('Event got fired');    
               var toolTip = document.getElementById("spnTip"); 
            toolTip.style.top = window.event.clientY + 20; 
            toolTip.style.left = window.event.clientX; 
            toolTip.innerText = text; 
            toolTip.style.visibility = "visible"; 
        } 
        function hideToolTip() 
        { 
            document.getElementById("spnTip").style.visibility = "hidden"; 
        }
    </script>

    <span id="spnTip" style="border-right: gray 1px solid; padding-right: 2px; border-top: gray 1px solid;
        padding-left: 2px; font-size: 8pt; z-index: 106; background: lightyellow; visibility: hidden;
        padding-bottom: 2px; border-left: gray 1px solid; padding-top: 2px; border-bottom: gray 1px solid;
        font-family: Verdana; position: absolute" onmouseout="hideToolTip()">
    </span>
 
Old August 21st, 2008, 04:04 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Why would you expect it to work???

When you do
    "showToolTip()" & myControl1.Text
and assuming the the .Text of that control is "zamboni", you will end up with
    "showToolTip()zamboni"

I hope you can see that is nonsense.

So...

Note that the JavaScript showToolTip() function is declared to take *TWO* arguments:
    function showToolTip(ctrSource, text)

I don't understand the reason for the first argument [ctrSource] as it is never used, at all, inside the function. Were this my code, I'd get rid of that bogus argument. But...

Anyway, if you want to pass in the text, you must either pass a JavaScript reference to it or pass in a JavaScript literal string. Since the text here is the text of a label, and since presumably a label's text remains unchanged, you can pass the literal string. But you still need to pass a first argument for ctrSource, though it can be a dummy one since it's not used.

So...

e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip(null,'" & myControl1.Text & "')" )

Untested, but feels right. (But if your text might contain an apostrophe, then we have to get a tad fancier.)

The null will become the argument for ctrSource and the 'xxxxx' (where xxxxx is the text from your control) will be the argument for text.

***********************

It's no big deal, but your onmouseout is wrong, too. You are passing a this argument to hideToolTip, but that function is not declared to take any arguments, at all. With JavaScript, it doesn't hurt to pass extra arguments, which is why the code is working.


 
Old August 21st, 2008, 04:08 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I hope you know this code will *ONLY* work in MSIE browsers!

window.event does not exist in other browsers.
 
Old August 21st, 2008, 06:31 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi Old Pedant,

Thank you for your input. This is my very first attempt to use JSCript. We are using IE6 and IE7

Here is the modified vb code:

Code:
If e.Row.RowType = DataControlRowType.DataRow Then
 Dim myControl1 As Label = e.Row.FindControl("Label2")
 If (Not myControl1 Is Nothing) Then
    e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip('" & myControl1.Text & "')")
    e.Row.Cells(3).Attributes.Add("onmouseout", "hideToolTip()")
End If
Markup:

Code:
script type="text/javascript" language="javascript">
        function showToolTip(text) 
        { 
            alert('Event got fired');    
               var toolTip = document.getElementById("spnTip"); 
            toolTip.style.top = window.event.clientY + 20; 
            toolTip.style.left = window.event.clientX; 
            toolTip.innerText = text; 
            toolTip.style.visibility = "visible"; 
        } 
        function hideToolTip() 
        { 
            document.getElementById("spnTip").style.visibility = "hidden"; 
        }
    </script>

    <span id="spnTip" style="border-right: gray 1px solid; padding-right: 2px; border-top: gray 1px solid;
        padding-left: 2px; font-size: 8pt; z-index: 106; background: lightyellow; visibility: hidden;
        padding-bottom: 2px; border-left: gray 1px solid; padding-top: 2px; border-bottom: gray 1px solid;
        font-family: Verdana; position: absolute" onmouseout="hideToolTip()">
    </span>


Running the code, no tooltip shows.

I have included value of the variable myControl1. This is basically a word document template that user modifies and stored in a table (up to 4000 characters long). As you can see, it contains apostrophes (and carriage return caharacters formating the document - not shown))

DIARY WEATHER: Start of Day 75 degrees End of Day 65 degrees WORK PERFORMED (BRIEF SUMMARY): LTL 1/1 7484-7915 R-1 1/1 7791-7916 R-1 1/1 8983-9508 LTL 1/1 9159-9508 TOTAL SY 2060.43 2.5" EROSION CONTROL PUMPS: DELAYS (WEATHER / GROUND CONDITIONS, EQUIP. DOWN, DOT SHUTDOWN) Hours lost due to delay: EXTRA WORK: Cost Code Established: (type YES or NO in line below) DIRECTIVE, CONVERSATIONS, COMMENTS FROM INSPECTOR OR GC: TEST RESULTS: (Note test performed and pass / fail results) DAMAGE TO PROPERTY OR UTILITIES: MOT INSPECTION: (type YES or NO in line below) Comments: VISITORS JOB: ACCIDENTS or INJURIES: SUBCONTRACTORS ALL OTHER INFORMATION: FOREMAN: joe johnson SUPERVISOR :zach hortan CUSTOMER: lane construction (byrone)


For your info, I started out using this:

Code:
<asp:Label ID="Label3" runat="server" Text='<%# Bind("diary") %>' ToolTip='<%# Bind("diary1") %>'></asp:Label>
and it looked great, formated like a word document (see below) The problem was that tool tip was not able to show the complete document/text. I could not find a way to increase the size of the tool tip.

DIARY
WEATHER:
Start of Day 75 degrees
End of Day 65 degrees

WORK PERFORMED (BRIEF SUMMARY):
LTL 1/1 7484-7915 R-1 1/1 7791-7916 R-1 1/1 8983-9508 LTL 1/1 9159-9508 TOTAL SY 2060.43 2.5"



EROSION CONTROL PUMPS:



DELAYS (WEATHER / GROUND CONDITIONS, EQUIP. DOWN, DOT SHUTDOWN)



Hours lost due to delay:


EXTRA WORK:


Cost Code Established: (type YES or NO in line below)



DIRECTIVE, CONVERSATIONS, COMMENTS FROM INSPECTOR OR GC:



TEST RESULTS: (Note test performed and pass / fail results)



DAMAGE TO PROPERTY OR UTILITIES:



MOT INSPECTION: (type YES or NO in line below)

Comments:



VISITORS JOB:


ACCIDENTS or INJURIES:



SUBCONTRACTORS



ALL OTHER INFORMATION:



FOREMAN: joe johnson

SUPERVISOR :zach hortan

CUSTOMER: lane construction (byrone)
 
Old August 21st, 2008, 06:52 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

** TRY NEXT POST FIRST! **


Okay, to handle the embedded apostrophes AND QUOTE MARKS! (which are there, though you didn't mention them), you can do this:

Dim txt As String = Replace( myControl1.Text, "'", "\'" )
txt = Replace( txt, """", "&quot;" )
txt = Replace( txt, CHR(10), "<br>" )
txt = Replace( txt, CHR(13), "" )

e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip(null,'" & txt & "')" )

See why it works? Now the generated HTML code should look like
    ...
    onmouseover="showToolTip(null,'Joe\'s words:<br>&quot;Got it!&quot;')"
    ...

If it still doesn't work, bring up the page in the browser, click on the VIEW menu, click on the SOURCE menu item, and then look at the HTML that the browser sees. Find this onmouseover code in the HTML and copy/paste all of it (including the complete HTML control in use) here.
 
Old August 21st, 2008, 07:10 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

This is silly.

We are going about this all wrong.

Instead of picking up the text of that label at compile time, in the VB code, let's pick it up at runtime, right out of the HTML!!!

This is 100% *UNTESTED*, but give it a try:

First, change the VB code, thus:

Code:
If e.Row.RowType = DataControlRowType.DataRow Then
    Dim myControl1 As Label = e.Row.FindControl("Label2")
    If (Not myControl1 Is Nothing) Then
        e.Row.Cells(3).Attributes.Add("onmouseover", "showToolTip('" & myControl1.ClientID & "')")
        e.Row.Cells(3).Attributes.Add("onmouseout", "hideToolTip()")
    End If
End If
and then change your showToolTip code slightly:

Code:
        function showToolTip(id) 
        { 
            alert('Event got fired');    
            var toolTip = document.getElementById("spnTip"); 
            toolTip.style.top = window.event.clientY + 20; 
            toolTip.style.left = window.event.clientX; 
            toolTip.innerText = document.getElementById(id).innerHTML;
            toolTip.style.visibility = "visible"; 
        }

See? Now all we do is let the JS code go get all the contents of the label and display it. Voila.

If that doesn't work, perhaps because you have multiple labels all with same ClientID, then bring up your page in the browser, do the VIEW-->>SOURCE, and show me what the HTML looks like for one of these things.
 
Old August 21st, 2008, 07:41 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Tried your latest post (time:8:10:58)

The alert fired but not the tool tip. Source view:

Code:
<script type="text/javascript" language="javascript">
        function showToolTip(id) 
        { 

            var toolTip = document.getElementById("spnTip"); 
            toolTip.style.top = window.event.clientY + 20; 
            toolTip.style.left = window.event.clientX; 
            toolTip.innerText = document.getElementById(id).innerHTML;            toolTip.style.visibility = "visible"; 
        }
        function hideToolTip() 
        { 
            document.getElementById("spnTip").style.visibility = "hidden"; 
        }
    </script>

    <span id="spnTip" style="border-right: gray 1px solid; padding-right: 2px; border-top: gray 1px solid;
        padding-left: 2px; font-size: 8pt; z-index: 106; background: lightyellow; visibility: hidden;
        padding-bottom: 2px; border-left: gray 1px solid; padding-top: 2px; border-bottom: gray 1px solid;
        font-family: Verdana; position: absolute" onmouseout="hideToolTip()">
    </span>
   
    &nbsp; &nbsp;
    <div>
        <div id="ctl00_ContentPlaceHolder1_Panel1" style="height:510px;left: 1px; position: relative;
            top: -48px">

            &nbsp;&nbsp;
            <div>
                <div id="ctl00_ContentPlaceHolder1_Panel2" style="height:33px;width:949px;border-right: gray thin solid;
                    border-top: gray thin solid; left: 0px; border-left: gray thin solid; border-bottom: gray thin solid;
                    position: relative; top: 57px; background-color: #ffffcc;">

                    <span id="ctl00_ContentPlaceHolder1_Label1" style="font-size: 25px; left: 272px; color: blue;
                        position: relative; top: -30px">J O B</span>
                    <span id="ctl00_ContentPlaceHolder1_Label2" style="display:inline-block;width:194px;font-size: 25px; left: 286px; color: blue;
                        position: relative; top: -31px">R E P O R T I N G </span>&nbsp;
                    <span id="ctl00_ContentPlaceHolder1_Label4" style="font-size: 25px; left: 291px; color: blue;
                        position: relative; top: -32px">-</span>
                    <span id="ctl00_ContentPlaceHolder1_Label5" style="font-size: 25px; left: 305px; color: blue;
                        position: relative; top: -32px">Diary Inquiry</span>&nbsp;
                    <span id="ctl00_ContentPlaceHolder1_Label6" style="display:inline-block;width:127px;font-size: 15px; left: -406px; color: blue;
                        position: relative; top: -3px">Selected Job Number</span>&nbsp;
                    <span id="ctl00_ContentPlaceHolder1_Label8" style="display:inline-block;width:87px;left: -403px; position: relative; top: -3px;
                        font-size: 15px; color: blue;">3505048</span>
                    <span id="ctl00_ContentPlaceHolder1_Label7" style="display:inline-block;height:19px;width:125px;left: -230px; position: relative;
                        top: -1px; font-size: 15px; color: blue;">Select Date  From/To</span>
                    <input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" id="ctl00_ContentPlaceHolder1_TextBox1" style="width:91px;left: -225px; position: relative;
                        top: 0px; font-size: 12px;" />&nbsp;
                    <input type="image" name="ctl00$ContentPlaceHolder1$ImageButton2" id="ctl00_ContentPlaceHolder1_ImageButton2" src="Icons/Calendar_Icon.png" style="height:24px;width:23px;border-width:0px;left: -230px; position: relative; top: 6px" />
                    <input name="ctl00$ContentPlaceHolder1$TextBox2" type="text" id="ctl00_ContentPlaceHolder1_TextBox2" style="width:99px;left: 685px; position: relative;
                        top: -30px; font-size: 12px;" />
                    <input type="image" name="ctl00$ContentPlaceHolder1$ImageButton3" id="ctl00_ContentPlaceHolder1_ImageButton3" src="Icons/Calendar_Icon.png" style="height:24px;width:24px;border-width:0px;left: 684px; position: relative; top: -25px" />
                    <input type="submit" name="ctl00$ContentPlaceHolder1$Button1" value="Go" id="ctl00_ContentPlaceHolder1_Button1" style="width:71px;left: 728px; position: relative; top: -30px;
                        color: blue;" />

    </div>
                &nbsp;
                <div>
                    &nbsp;</div>
                <div>
                    <div>
        <table cellspacing="2" align="Left" rules="all" border="1" id="ctl00_ContentPlaceHolder1_GridView1" style="border-color:LightGrey;border-style:None;font-size:Small;height:20px;width:951px;z-index: 10px; position: relative;
                        top: 21px; border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid;
                        border-bottom: gray thin solid; font-size: 12px; left: 1px;">
            <tr style="background-color:#FFC080;height:35px;">
                <th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$date')">Date</a><img src="Icons/down.gif" style="border-width:0px;" /></th><th scope="col">Batch Name</th><th scope="col">Foreman</th><th scope="col">Diary Text</th>
            </tr><tr style="height:20px;white-space:nowrap;">
                <td align="left" style="width:60px;white-space:nowrap;">4/7/2008</td><td align="left" style="width:200px;">RGWGJPJ-4 Mon 4/7/08</td><td style="width:160px;">Johnson, Joseph P.            </td><td align="left" onmouseover="showToolTip('ctl00_ContentPlaceHolder1_GridView1_ctl02_Label2')" onmouseout="hideToolTip()" style="width:600px;">
                                    <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_Label1">DIARY
WEATHER:
Start of Day    75 degrees
End of Day    </span>
                                    <!-- <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_Label3" title="DIARY
WEATHER:
Start of Day    75 degrees
End of Day    65 degrees

WORK PERFORMED (BRIEF SUMMARY):
LTL 1/1  7484-7915    R-1  1/1  7791-7916    R-1  1/1   8983-9508   LTL  1/1  9159-9508    TOTAL SY 2060.43  2.5&quot;



EROSION CONTROL PUMPS:



DELAYS  (WEATHER / GROUND CONDITIONS, EQUIP. DOWN, DOT SHUTDOWN)



Hours lost due to delay:


EXTRA WORK:


Cost Code Established: (type YES or NO in line below)



DIRECTIVE, CONVERSATIONS, COMMENTS FROM INSPECTOR  OR GC:



TEST RESULTS: (Note test performed and pass / fail results)



DAMAGE TO PROPERTY OR UTILITIES:



MOT INSPECTION: (type YES or NO in line below)

Comments:



VISITORS JOB:


ACCIDENTS or INJURIES:



SUBCONTRACTORS



ALL OTHER INFORMATION:



FOREMAN: joe johnson

SUPERVISOR :zach hortan

CUSTOMER: lane construction  (byrone)
Will try the other post.
 
Old August 21st, 2008, 08:03 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Your previous to last post (7:52:21)

This worked. I can now see the tool tip with it's complete content. What will happen if user enters additional special characters in the future (that we did not handle), just a question. Is it now possible to format the tool tip a little better (without the <br>s) with line breaks etc. Now it shows, like you explained like a long text string.

Good job !!!!!!!

Code:
<script type="text/javascript">
<!--
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
// -->
</script>


        <div>
            &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;<table border="1" style="left: 2px;
                width: 1088px; position: relative; top: -26px; height: 1px; border-right-style: none;
                border-bottom-style: none;">
                <tr>
                    <td style="width: 95px; height: 86px">
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        <img id="ctl00_Image1" src="Icons/RangerConstr.jpg" style="height:61px;width:174px;border-width:0px;z-index: 100; left: 10px; position: absolute; top: 14px" />
                        &nbsp;
                        <span id="ctl00_Label3" style="display:inline-block;width:714px;font-size: 15pt; z-index: 101; left: 271px;
                            letter-spacing: 5px; position: absolute; top: 67px; text-align: center">Corporate      Web      Portal      for      Information     and        Reporting </span>
                        <span id="ctl00_Label2" style="display:inline-block;font-size:X-Large;width:94px;font-weight: bold;
                            font-size: 40px; z-index: 104; left: 592px; color: blue; font-style: italic;
                            position: absolute; top: 12px">N  e  t</span>
                        &nbsp;
                        <span id="ctl00_Label1" style="display:inline-block;font-size:X-Large;width:100px;font-weight: bold;
                            font-size: 40px; z-index: 103; left: 496px; color: blue; font-style: italic;
                            position: absolute; top: 11px">A  p  p  </span>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
        <table style="z-index: 102; left: 41px; position: absolute; top: 241px">
            <tr>
                <td style="width: 100px">
                </td>
            </tr>
        </table>
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        <table style="z-index: 103; left: 6px; width: 1089px; position: relative; top: -35px;
            height: 347px; border-top-style: none; border-right-style: none; border-left-style: none;
            border-bottom-style: none;">
            <tr>
                <td style="width: 11%; height: 500px; border-top-width: thin; border-left-width: thin;
                    border-left-color: gray; border-bottom-width: thin; border-bottom-color: gray;
                    border-top-color: gray; border-right-width: thin; border-right-color: gray;">
                    <div>
                        <br />
                        <a style="font-weight: bold; font-size: 19px; font-style: italic; z-index: 100; left: 0px;
                            color: blue;" href="JobInquiry.aspx">Job Reporting Home</a>&nbsp;&nbsp;<br />
                        <br />
                        <br />
                        <a style="font-weight: bold; font-size: 19px; font-style: italic; z-index: 100; left: 0px;
                            color: blue;" href="http://webapps.vecelliogroup.com/jobreporting/home.aspx"></a>
                        &nbsp;
                        <br />
                        <br />
                        <br />
                        <a style="font-weight: bold; font-size: 19px; font-style: italic; z-index: 100; left: 0px;
                            color: blue;" href="http://webapps.vecelliogroup.com/asphalt/home.aspx"></a>
                        &nbsp;
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </div>
                    &nbsp;&nbsp;
                </td>
                <td style="border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid;
                    width: 85%; border-bottom: gray thin solid; height: 500px">
                    &nbsp;


    <script type="text/javascript" language="javascript">
        function showToolTip(text) 
        { 

               var toolTip = document.getElementById("spnTip"); 
            toolTip.style.top = window.event.clientY + 20; 
            toolTip.style.left = window.event.clientX; 
            toolTip.innerText = text; 
            toolTip.style.visibility = "visible"; 
        } 
        function hideToolTip() 
        { 
            document.getElementById("spnTip").style.visibility = "hidden"; 
        }
    </script>

    <span id="spnTip" style="border-right: gray 1px solid; padding-right: 2px; border-top: gray 1px solid;
        padding-left: 2px; font-size: 8pt; z-index: 106; background: lightyellow; visibility: hidden;
        padding-bottom: 2px; border-left: gray 1px solid; padding-top: 2px; border-bottom: gray 1px solid;
        font-family: Verdana; position: absolute" onmouseout="hideToolTip()">
    </span>

    &nbsp; &nbsp;
    <div>
        <div id="ctl00_ContentPlaceHolder1_Panel1" style="height:510px;left: 1px; position: relative;
            top: -48px">

            &nbsp;&nbsp;
            <div>
                <div id="ctl00_ContentPlaceHolder1_Panel2" style="height:33px;width:949px;border-right: gray thin solid;
                    border-top: gray thin solid; left: 0px; border-left: gray thin solid; border-bottom: gray thin solid;
                    position: relative; top: 57px; background-color: #ffffcc;">

                    <span id="ctl00_ContentPlaceHolder1_Label1" style="font-size: 25px; left: 272px; color: blue;
                        position: relative; top: -30px">J O B</span>
                    <span id="ctl00_ContentPlaceHolder1_Label2" style="display:inline-block;width:194px;font-size: 25px; left: 286px; color: blue;
                        position: relative; top: -31px">R E P O R T I N G </span>&nbsp;
                    <span id="ctl00_ContentPlaceHolder1_Label4" style="font-size: 25px; left: 291px; color: blue;
                        position: relative; top: -32px">-</span>
                    <span id="ctl00_ContentPlaceHolder1_Label5" style="font-size: 25px; left: 305px; color: blue;
                        position: relative; top: -32px">Diary Inquiry</span>&nbsp;
                    <span id="ctl00_ContentPlaceHolder1_Label6" style="display:inline-block;width:127px;font-size: 15px; left: -406px; color: blue;
                        position: relative; top: -3px">Selected Job Number</span>&nbsp;
                    <span id="ctl00_ContentPlaceHolder1_Label8" style="display:inline-block;width:87px;left: -403px; position: relative; top: -3px;
                        font-size: 15px; color: blue;">3505048</span>
                    <span id="ctl00_ContentPlaceHolder1_Label7" style="display:inline-block;height:19px;width:125px;left: -230px; position: relative;
                        top: -1px; font-size: 15px; color: blue;">Select Date  From/To</span>
                    <input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" id="ctl00_ContentPlaceHolder1_TextBox1" style="width:91px;left: -225px; position: relative;
                        top: 0px; font-size: 12px;" />&nbsp;
                    <input type="image" name="ctl00$ContentPlaceHolder1$ImageButton2" id="ctl00_ContentPlaceHolder1_ImageButton2" src="Icons/Calendar_Icon.png" style="height:24px;width:23px;border-width:0px;left: -230px; position: relative; top: 6px" />
                    <input name="ctl00$ContentPlaceHolder1$TextBox2" type="text" id="ctl00_ContentPlaceHolder1_TextBox2" style="width:99px;left: 685px; position: relative;
                        top: -30px; font-size: 12px;" />
                    <input type="image" name="ctl00$ContentPlaceHolder1$ImageButton3" id="ctl00_ContentPlaceHolder1_ImageButton3" src="Icons/Calendar_Icon.png" style="height:24px;width:24px;border-width:0px;left: 684px; position: relative; top: -25px" />
                    <input type="submit" name="ctl00$ContentPlaceHolder1$Button1" value="Go" id="ctl00_ContentPlaceHolder1_Button1" style="width:71px;left: 728px; position: relative; top: -30px;
                        color: blue;" />

    </div>
                &nbsp;
                <div>
                    &nbsp;</div>
                <div>
                    <div>
        <table cellspacing="2" align="Left" rules="all" border="1" id="ctl00_ContentPlaceHolder1_GridView1" style="border-color:LightGrey;border-style:None;font-size:Small;height:20px;width:951px;z-index: 10px; position: relative;
                        top: 21px; border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid;
                        border-bottom: gray thin solid; font-size: 12px; left: 1px;">
            <tr style="background-color:#FFC080;height:35px;">
                <th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$date')">Date</a><img src="Icons/down.gif" style="border-width:0px;" /></th><th scope="col">Batch Name</th><th scope="col">Foreman</th><th scope="col">Diary Text</th>
            </tr><tr style="height:20px;white-space:nowrap;">
                <td align="left" style="width:60px;white-space:nowrap;">4/7/2008</td><td align="left" style="width:200px;">RGWGJPJ-4 Mon 4/7/08</td><td style="width:160px;">Johnson, Joseph P.            </td><td align="left" onmouseover="showToolTip('DIARY&lt;br>WEATHER:&lt;br>Start of Day    75 degrees&lt;br>End of Day    65 degrees&lt;br>&lt;br>WORK PERFORMED (BRIEF SUMMARY):&lt;br>LTL 1/1  7484-7915    R-1  1/1  7791-7916    R-1  1/1   8983-9508   LTL  1/1  9159-9508    TOTAL SY 2060.43  2.5&amp;quot;&lt;br>&lt;br>&lt;br>&lt;br>EROSION CONTROL PUMPS:&lt;br>&lt;br>&lt;br>&lt;br>DELAYS  (WEATHER / GROUND CONDITIONS, EQUIP. DOWN, DOT SHUTDOWN)&lt;br>&lt;br>&lt;br>&lt;br>Hours lost due to delay:&lt;br>&lt;br>&lt;br>EXTRA WORK:&lt;br>&lt;br>&lt;br>Cost Code Established: (type YES or NO in line below)&lt;br>&lt;br>&lt;br>&lt;br>DIRECTIVE, CONVERSATIONS, COMMENTS FROM INSPECTOR  OR GC:&lt;br>&lt;br>&lt;br>&lt;br>TEST RESULTS: (Note test performed and pass / fail results)&lt;br>&lt;br>&lt;br>&lt;br>DAMAGE TO PROPERTY OR UTILITIES:&lt;br>&lt;br>&lt;br>&lt;br>MOT INSPECTION: (type YES or NO in line below)&lt;br>&lt;br>Comments:&lt;br>&lt;br>&lt;br>&lt;br>VISITORS JOB:&lt;br>&lt;br>&lt;br>ACCIDENTS or INJURIES:&lt;br>&lt;br>&lt;br>&lt;br>SUBCONTRACTORS&lt;br>&lt;br>&lt;br>&lt;br>ALL OTHER INFORMATION:&lt;br>&lt;br>&lt;br>&lt;br>FOREMAN: joe johnson&lt;br>&lt;br>SUPERVISOR :zach hortan&lt;br>&lt;br>CUSTOMER: lane construction  (byrone)&lt;br>&lt;br>&lt;br>&lt;br>&lt;br>&lt;br>')" onmouseout="hideToolTip(this)" style="width:600px;">
                                    <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_Label1">DIARY
WEATHER:
Start of Day    75 degrees
End of Day    </span>
                                    <!-- <span id="ctl00_ContentPlaceHolder1_GridView1_ctl02_Label3" title="DIARY
WEATHER:
Start of Day    75 degrees
End of Day    65 degrees

WORK PERFORMED (BRIEF SUMMARY):
LTL 1/1  7484-7915    R-1  1/1  7791-7916    R-1  1/1   8983-9508   LTL  1/1  9159-9508    TOTAL SY 2060.43  2.5&quot;



EROSION CONTROL PUMPS:



DELAYS  (WEATHER / GROUND CONDITIONS, EQUIP. DOWN, DOT SHUTDOWN)



Hours lost due to delay:


EXTRA WORK:


Cost Code Established: (type YES or NO in line below)



DIRECTIVE, CONVERSATIONS, COMMENTS FROM INSPECTOR  OR GC:



TEST RESULTS: (Note test performed and pass / fail results)



DAMAGE TO PROPERTY OR UTILITIES:



MOT INSPECTION: (type YES or NO in line below)

Comments:



VISITORS JOB:


ACCIDENTS or INJURIES:



SUBCONTRACTORS



ALL OTHER INFORMATION:



FOREMAN: joe johnson

SUPERVISOR :zach hortan

CUSTOMER: lane construction  (byrone)
 
Old August 21st, 2008, 08:51 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

If you don't use HTML to format the stuff inside the label(s), then it won't be formatted in the tool tip.

There's no reason you can't use HTML tags (such as <B> and <BR> and and so on) inside the "text" that you put into each label. If you do so, then when that it copied to the tooltip it will display using those HTML tags and be much prettier.
 
Old August 21st, 2008, 09:09 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

You lost me a little. How would I go about formating it with HTML tags to look pretty? The way the tool tip displays the text is "kinda" ugly. I thought the <br>'s I see in the tool tip were HTML tags and the tool tipe would format these accordingly. Can you please guide me? Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] [2005] Call Outlook in vb application snufse .NET Framework 2.0 1 February 12th, 2008 04:58 PM
[Resolved] [2005] Call Outlook with attachment snufse .NET Framework 2.0 4 February 12th, 2008 09:59 AM
Call to function Awkuzu BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 September 19th, 2007 06:13 PM
Call a Function stealthdevil Access VBA 2 November 2nd, 2006 10:38 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.