RadToolTipManager unable to show tooltip from asmx webservice.

5 posts, 0 answers
  1. Harendra
    Harendra  avatar
    9 posts
    Member since:
    Jun 2013

    Posted 05 Sep 2013 Link to this post

    Hi,

    I had a usercontrol in which world imagemap is made. And a asmx webservice which will populate data from database whenever the mouse is hover onto specific countries of the world-map image. 
    But instead of the data i am getting an error  :

    RadToolTipManager response error. Exception = The server method <MethodName> failed.

    the .cs code is  :

     foreach (PolygonHotSpot spot in SaleCountriesMap.HotSpots) // SaleCountriesMap - world-image.png
            {
                string value = spot.AlternateText.Trim(new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' });

                // The format is "country name{#}EmployeeID"
                string tooltipValue = value + "{#}" + EmployeeID.ToString();
                this.RadToolTipManager1.TargetControls.Add(spot.AlternateText, tooltipValue, true);

                mapTitle.Text = "Ship Countries for " + Employee.FirstName + " " + Employee.LastName;
            }

    and the aspx source code is :

     <telerik:RadAjaxLoadingPanel ID="MapLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
       
        <div class="imageMap">
            <asp:ImageMap ID="SaleCountriesMap" class="map" ImageUrl="~/Images/world_map.gif" runat="server">
           <asp:PolygonHotSpot AlternateText="United States of America7" Coordinates="28,82, 27,82, 26,82, 26,82, 27,81, 27,81, 28,82, 28,82, 28,82, 28,82" />
           <asp:PolygonHotSpot AlternateText="Austria" Coordinates="431,180,433,183,436,184,439,184,441,183,443,181,443,179,444,177,443,176,441,175,438,176,435,177,434,178,434,180,431,180,431,181" />
           <asp:PolygonHotSpot AlternateText="Denmark" Coordinates="423,147,424,143,428,141,429,142,428,143,428,145,428,146,427,149,426,150,426,152,425,153,424,150,423,150,423,147" />
           <asp:PolygonHotSpot AlternateText="Finland" Coordinates="466,74,470,74,472,74,473,77,472,79,471,83,472,86,474,90,473,95,474,99,474,105,475,109,475,112,477,115,477,118,474,122,470,125,468,127,464,127,462,129,460,130,458,129,456,128,455,127,454,121,454,119,454,116,456,114,459,112,461,108,463,106,463,105,464,105,464,102,463,101,461,99,460,97,460,93,459,92,459,88,459,85,458,83,457,82,459,82,463,82,464,81,465,78,465,75,466,74" />
           <asp:PolygonHotSpot AlternateText="France" Coordinates="410,169,411,169,414,171,416,173,419,173,420,175,422,176,422,179,420,180,419,182,418,184,418,185,420,185,420,188,420,190,421,193,420,194,419,195,418,195,414,194,412,195,411,195,411,197,411,198,408,196,404,196,401,195,401,193,401,188,402,188,402,187,401,185,400,184,400,183,399,181,398,180,394,179,394,177,397,176,399,177,400,177,400,175,400,174,401,173,401,173,404,174,405,174,405,173,406,172,409,172,408,171,409,168" />
           <asp:PolygonHotSpot AlternateText="Germany" Coordinates="425,153,425,156,425,158,422,159,420,160,420,163,418,166,417,167,418,170,418,172,419,174,422,176,422,176,422,178,422,179,427,179,432,179,433,179,433,178,434,177,435,176,434,174,433,173,432,171,432,170,436,169,438,167,438,165,437,162,436,162,436,160,436,157,435,155,434,154,432,155,431,156,429,156,428,155,427,154,426,153,426,153" />
           <asp:PolygonHotSpot AlternateText="Ireland" Coordinates="385,156,389,156,390,160,389,164,386,164,383,166,380,165,382,163,383,162,382,159,381,159,381,158,381,156" />
           <asp:PolygonHotSpot AlternateText="Italy" Coordinates="420,186,420,189,420,191,421,192,423,192,424,191,425,191,427,192,428,193,429,195,430,197,431,198,432,199,434,200,437,202,439,204,440,205,441,207,441,209,441,210,441,211,440,211,439,211,433,211,433,213,436,213,436,213,437,214,438,215,439,215,440,212,441,211,441,211,442,211,444,208,445,207,443,206,443,204,445,204,446,206,447,205,446,203,444,202,441,200,438,199,437,197,436,194,435,194,435,193,434,193,434,192,433,188,435,187,436,185,436,184,434,183,432,182,430,182,428,183,427,183,425,185,423,185,421,186,420,186,420,186" />
           <asp:PolygonHotSpot AlternateText="Norway" Coordinates="423,139,424,137,427,134,428,133,429,131,430,132,432,129,432,127,432,124,432,122,432,117,431,112,433,110,436,108,436,106,437,104,438,101,437,98,440,95,441,91,441,88,444,85,446,83,447,82,449,82,451,79,453,79,457,82,459,82,461,81,462,82,465,80,465,75,467,74,472,74,475,72,476,71,475,68,472,68,469,69,466,68,463,73,462,72,463,69,462,67,461,70,458,73,456,73,456,75,453,75,452,77,450,76,447,79,445,82,444,83,441,87,440,89,436,96,436,100,434,104,431,106,430,107,428,109,427,111,429,112,428,113,424,114,421,116,420,118,419,119,415,120,416,125,420,124,421,123,421,125,416,126,416,130,417,129,419,128,420,128,418,130,418,134,417,136,418,138,420,139" />
           <asp:PolygonHotSpot AlternateText="Poland" Coordinates="438,162,439,166,440,168,442,169,445,170,447,172,449,173,453,174,457,174,458,172,459,170,460,168,459,167,459,162,460,161,459,158,458,155,448,155,446,154,444,153,443,154,440,156,438,156,437,159,437,162" />
           <asp:PolygonHotSpot AlternateText="Portugal" Coordinates="382,199,389,199,389,201,388,201,388,205,387,206,387,212,386,214,383,213,383,210,382,209,382,207,383,204,383,200,383,199" />
           <asp:PolygonHotSpot AlternateText="Spain" Coordinates="384,193,397,194,400,195,402,196,408,197,412,199,409,201,405,203,404,206,403,208,404,209,402,212,400,213,399,215,393,215,391,217,390,217,389,215,386,214,387,213,387,211,387,206,388,204,388,202,389,201,389,199,389,198,383,198,382,196,383,195,385,193" />
           <asp:PolygonHotSpot AlternateText="Sweden" Coordinates="453,80,451,80,450,83,447,83,446,85,444,87,442,89,442,92,440,96,437,99,437,103,436,106,437,108,434,110,432,112,432,117,432,122,433,124,433,129,431,133,431,135,431,139,432,143,432,145,434,146,432,149,436,151,438,149,438,148,441,148,443,146,443,136,446,135,447,132,448,131,445,127,444,127,444,122,445,118,450,113,454,110,454,108,455,102,458,100,460,100,460,93,459,91,459,86,458,84,455,81,453,80" />
           <asp:PolygonHotSpot AlternateText="Switzerland" Coordinates="421,179,419,181,418,183,418,184,420,184,420,186,422,186,423,185,425,185,426,184,428,183,429,183,431,182,430,180,426,180,423,180,421,180" />
           <asp:PolygonHotSpot AlternateText="UK" Coordinates="384,153,385,155,390,155,391,155,392,153,396,152,396,153,396,154,396,155,397,156,397,158,395,159,394,160,394,163,391,165,393,166,396,166,397,167,393,168,391,171,390,172,393,171,395,170,396,169,403,169,406,168,406,166,406,165,408,163,408,161,404,160,404,156,401,152,400,150,398,148,397,148,397,146,399,145,400,143,400,140,395,141,395,139,397,138,396,136,392,136,391,138,391,139,390,143,389,145,390,147,392,148,392,151,392,153,390,154,389,151,385,151,384,152,384,153" />
           <asp:PolygonHotSpot AlternateText="Belgium" Coordinates="411,168,412,169,415,172,417,172,418,172,418,169,417,168,417,166,412,166,411,167,411,168" />
           <asp:PolygonHotSpot AlternateText="Mexico" Coordinates="127,227,132,228,137,230,143,230,148,229,152,230,154,233,156,235,159,236,162,234,167,240,171,245,174,246,172,247,172,254,174,260,177,264,180,265,183,264,187,264,189,261,190,258,194,257,197,257,196,260,195,263,193,265,188,265,187,267,188,269,184,273,181,270,177,270,175,271,163,266,161,265,158,264,154,261,155,256,154,253,148,248,148,247,146,246,145,243,140,239,138,235,136,231,134,230,131,229,132,234,136,239,139,244,141,245,141,248,145,251,145,253,142,253,139,249,138,245,136,243,133,242,132,241,133,239,132,236,130,233,129,232,128,230,127,227,127,227" />
           <asp:PolygonHotSpot AlternateText="Brazil" Coordinates="245,306,248,307,250,305,253,303,253,302,251,300,252,299,257,299,259,298,260,296,262,297,262,304,263,305,267,305,271,304,274,303,277,303,279,303,283,299,285,306,282,310,283,311,286,309,288,309,289,310,288,313,291,311,295,311,300,315,302,314,306,315,311,316,315,319,317,321,321,322,321,327,320,332,313,339,312,341,311,353,309,358,305,363,303,364,297,365,292,368,289,371,289,379,286,383,283,388,278,392,275,387,271,385,268,383,268,382,273,378,276,375,277,372,275,370,274,365,270,362,266,361,266,355,266,350,264,347,261,347,260,342,260,340,257,340,253,338,250,337,249,332,245,331,243,335,237,334,236,330,233,331,232,331,229,328,229,324,230,322,234,319,238,318,239,314,239,310,238,308,239,306,238,305,239,303,244,304,245,305" />
           <asp:PolygonHotSpot AlternateText="Canada" Coordinates="71,129,75,131,78,133,80,135,82,132,84,135,88,142,91,146,94,149,96,154,98,161,100,163,102,166,103,169,106,170,109,172,112,174,115,176,179,176,181,177,185,178,191,180,195,177,198,176,200,178,202,180,203,182,204,184,208,186,213,187,215,190,214,191,211,191,210,193,210,195,209,197,208,199,209,200,212,198,215,197,216,195,218,193,222,193,225,191,227,189,232,189,236,189,238,187,238,184,240,182,242,182,243,183,244,185,244,188,246,189,247,189,249,188,251,187,252,188,249,191,248,193,249,195,252,192,256,190,259,189,261,187,262,185,260,184,257,186,255,188,252,186,251,184,250,181,251,180,247,179,250,178,252,177,251,175,247,175,242,177,240,179,237,182,237,183,237,181,239,179,242,176,245,173,249,171,257,172,263,170,266,168,269,167,271,167,268,172,266,176,264,180,266,181,270,180,273,181,272,183,275,182,276,181,277,183,278,184,280,183,279,181,277,179,277,176,272,174,270,172,272,168,270,166,272,165,272,160,269,158,268,156,266,157,261,160,260,159,263,157,267,155,268,153,262,152,260,149,257,147,255,145,258,145,258,143,255,139,254,136,252,133,251,130,249,131,248,135,247,137,246,137,244,139,242,138,242,137,240,136,238,137,239,135,240,132,237,130,239,130,239,126,235,125,232,121,229,119,226,120,221,118,218,120,220,123,219,126,220,130,221,133,218,135,218,138,220,140,222,145,223,148,221,150,218,153,216,155,216,157,218,160,218,163,218,165,217,168,214,169,213,166,212,165,210,161,209,156,208,152,202,152,198,149,193,146,188,143,185,145,185,141,183,137,180,137,179,135,179,129,180,126,181,123,183,121,185,119,186,117,189,116,189,114,183,111,187,111,190,113,191,111,192,110,194,110,196,107,197,105,197,104,193,103,191,101,192,100,195,102,198,102,199,100,201,102,200,105,200,109,198,111,198,113,199,113,201,112,201,114,203,115,206,112,207,110,209,111,211,113,213,113,214,111,211,109,209,107,205,104,203,102,200,100,199,98,199,96,202,96,203,98,205,98,206,96,208,97,211,92,211,90,209,84,211,84,211,81,208,78,209,75,211,73,214,74,217,75,217,74,216,71,218,71,220,74,222,77,225,80,223,81,225,82,226,82,228,83,230,86,227,87,224,85,221,87,221,90,222,92,225,92,227,89,228,88,229,87,231,86,232,87,232,90,232,93,231,96,228,98,229,101,229,103,225,103,222,103,219,106,219,107,220,109,223,109,224,108,226,107,227,106,229,107,231,110,234,112,235,114,236,117,239,117,242,119,244,121,247,121,248,121,246,118,241,113,241,112,245,114,247,116,250,117,251,116,251,114,251,113,250,109,250,108,246,106,245,104,244,102,243,101,244,99,243,97,245,96,246,98,249,100,250,102,253,105,254,105,254,102,256,101,256,100,257,98,258,98,258,96,257,93,253,92,250,87,247,87,243,84,243,81,242,79,243,77,245,75,243,72,241,73,240,72,242,71,240,69,237,70,236,68,236,67,234,67,236,65,233,62,230,64,229,63,228,60,225,57,224,55,223,51,220,48,217,47,213,47,213,49,214,51,215,54,218,54,221,54,222,55,219,55,217,57,214,58,212,59,212,58,213,55,212,51,211,49,210,46,207,46,205,49,203,50,202,52,201,54,201,56,201,59,201,61,202,63,203,66,202,64,199,60,199,57,198,53,199,51,201,48,202,46,197,45,195,48,191,53,191,57,190,62,191,65,194,66,196,67,192,67,193,70,195,72,199,72,199,72,202,74,205,74,208,75,208,76,203,76,201,78,202,80,203,81,202,83,201,84,199,86,198,86,199,89,198,91,195,90,195,87,196,84,194,80,192,79,191,81,190,84,189,81,188,78,186,77,184,76,186,73,186,70,184,68,184,65,182,63,180,61,181,59,182,57,181,54,186,53,187,49,190,46,190,44,184,42,181,42,179,43,179,46,178,47,177,51,177,53,178,55,179,56,179,59,180,60,178,61,175,62,175,55,172,53,171,52,172,50,174,45,170,46,167,45,165,48,166,51,167,52,165,55,163,52,161,54,163,58,166,59,168,61,169,64,171,65,174,63,175,62,177,63,177,64,176,65,176,69,177,70,175,71,175,74,177,76,180,77,182,78,180,81,180,83,182,82,182,84,181,86,178,87,178,91,176,91,176,87,175,85,176,83,178,82,173,75,170,78,168,81,169,82,174,84,174,85,171,85,171,87,174,89,166,88,161,89,159,86,155,86,154,83,152,80,152,78,156,81,160,82,162,80,162,78,160,78,160,77,162,75,165,75,165,73,158,69,156,66,155,58,154,53,155,50,156,47,153,45,151,47,148,50,148,55,150,59,148,61,146,56,144,53,143,55,141,56,139,57,139,54,136,52,134,54,133,55,132,55,133,52,133,49,131,49,129,52,128,50,130,47,125,41,121,43,117,38,114,38,111,40,110,40,110,44,110,45,108,49,107,52,108,53,107,56,106,59,107,61,109,61,112,66,114,65,116,64,118,64,119,62,120,58,122,56,123,54,127,51,128,52,125,54,124,56,124,59,122,60,122,63,124,63,124,65,129,63,127,66,125,67,125,70,129,71,134,69,136,71,137,72,132,72,127,73,126,76,128,78,133,80,135,82,138,84,143,83,146,82,150,80,151,81,150,82,148,84,147,85,151,85,153,85,150,87,148,88,149,91,150,92,149,94,147,94,147,91,143,88,141,87,139,89,133,89,131,88,131,86,133,84,131,82,130,81,127,81,125,81,119,79,116,76,112,76,111,78,109,79,110,77,108,74,107,76,106,78,105,78,103,75,102,72,101,71,100,73,98,75,95,76,93,79,90,80,91,78,94,77,96,75,97,73,95,73,91,76,88,78,86,77,84,78,85,81,84,83,83,83,78,81,75,79,73,77,71,76,70,76,71,129" />
           <asp:PolygonHotSpot AlternateText="USA1" Coordinates="68,76,63,72,58,73,50,70,44,70,40,67,35,66,32,64,24,69,18,75,15,80,9,82,10,86,15,91,16,93,20,94,25,96,19,99,14,96,5,101,10,107,16,107,22,106,22,113,13,117,10,122,12,127,15,131,17,132,19,128,20,136,26,136,30,137,29,143,12,154,15,154,30,146,38,138,39,135,39,133,48,120,48,125,44,131,45,134,51,129,53,124,61,129,69,130,69,75" />
           <asp:PolygonHotSpot AlternateText="USA2" Coordinates="114,175,177,175,182,177,190,180,186,184,190,184,194,181,197,184,204,184,203,186,197,187,195,191,196,200,198,199,199,191,204,187,206,189,206,193,208,194,207,200,211,201,217,195,223,194,224,191,227,189,234,189,237,186,239,181,243,182,244,190,242,192,239,192,236,198,236,200,231,202,228,204,228,208,226,211,223,211,223,207,222,213,224,216,223,221,218,224,214,227,210,233,214,244,212,247,208,240,207,236,203,235,200,234,190,233,191,236,191,237,187,237,179,236,178,237,175,239,173,241,174,246,171,245,165,237,163,234,159,236,156,235,153,231,149,229,143,230,137,230,133,228,126,227,121,222,118,222,113,213,114,211,111,210,109,204,109,187,111,185,109,180,107,178,112,178,113,180,114,175" />
           <asp:PolygonHotSpot AlternateText="Argentina" Coordinates="251,363,252,361,256,363,259,367,262,367,266,371,265,375,273,376,269,380,267,383,266,390,265,394,268,398,269,403,267,407,263,407,256,408,255,414,251,414,249,414,249,417,250,420,248,427,243,431,245,435,247,435,248,439,243,443,242,445,240,446,239,449,241,453,243,460,248,463,249,464,246,465,241,463,241,460,241,457,241,455,240,453,233,452,232,448,229,448,230,443,233,436,234,427,234,424,234,418,235,405,236,400,238,394,238,391,237,389,237,384,239,377,242,374,241,369,244,367,245,362,250,362,251,362" />
           <asp:PolygonHotSpot AlternateText="Venezuela" Coordinates="234,284,237,282,241,282,243,284,245,283,247,284,248,285,252,284,254,283,257,286,259,287,260,290,259,292,259,296,258,298,256,299,254,299,251,299,250,298,250,299,251,302,252,303,251,305,248,306,246,306,245,304,245,302,244,298,245,297,244,294,239,294,238,292,234,292,232,290,231,287,232,286,234,286,235,287,235,286,235,284,234,284,235,283" />
                <asp:PolygonHotSpot AlternateText="BAHRAIN" Coordinates="519, 241, 5"/>
           <asp:PolygonHotSpot AlternateText="BHUTAN" Coordinates="602, 227, 612, 235"/>
           <asp:PolygonHotSpot AlternateText="INDIA" Coordinates="674, 366, 679, 398, 716, 385, 743, 408, 759, 406, 769, 375, 744, 336, 739, 349, 731, 343, 724, 338, 716, 334, 708, 342, 699, 346, 695, 350, 673, 361"  />
           <asp:PolygonHotSpot AlternateText="AUSTRALIA" Coordinates="412, 219, 384, 221, 373, 239, 363, 259, 363, 279, 370, 295, 386, 303, 412, 299, 423, 304, 426, 313, 431, 323, 432, 340, 430, 364, 443, 398, 467, 398, 487, 366, 487, 359, 495, 352, 496, 327, 512, 306, 526, 283, 503, 277, 485, 245, 459, 230, 447, 232, 428, 226, 432, 215" />
           <asp:PolygonHotSpot AlternateText="AFRICA" Coordinates="585, 208, 576, 187, 576, 163, 575, 162, 600, 159, 611, 152, 611, 128, 639, 130, 646, 148, 667, 164, 683, 175, 692, 173, 705, 150, 692, 121, 682, 123, 691, 104, 721, 110, 728, 136, 740, 124, 740, 138, 743, 139, 731, 151, 742, 162, 745, 183, 745, 198, 734, 192, 735, 176, 722, 194, 713, 199, 715, 215, 703, 219, 694, 208, 696, 225, 693, 245, 660, 257, 664, 277, 657, 290, 644, 276, 628, 264, 614, 219, 588, 206" />
           <asp:PolygonHotSpot AlternateText="CHINA" Coordinates="565, 250, 569, 260, 575, 261, 588, 294, 596, 274, 602, 264, 619, 259, 622, 252, 615, 239, 601, 235, 592, 224, 582, 208, 578, 196, 569, 202, 560, 197, 565, 215, 570, 222, 560, 238"  />


            </asp:ImageMap>
        </div>
    </div>
    <telerik:RadToolTipManager ID="RadToolTipManager1" ShowCallout="true"
        RelativeTo="Mouse" HideEvent="LeaveTargetAndToolTip" MouseTrailing="true" Position="TopRight"
        Animation="None" Width="100px" Height="100px" ContentScrolling="None" runat="server" ShowDelay="0">
        <WebServiceSettings Method="GetOrdersCountByCountry" Path="~/ToolTipWebService.asmx" />
    </telerik:RadToolTipManager>


    In the WebService.asmx,  the  GetOrdersCountByCountry event is created as explained below :

     [WebMethod]
        public string GetOrdersCountByCountry(object context)
        {
            OrderService orderService = new OrderService(miserptest);

            IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;
            string tootltipValues = ((string)contextDictionary["Value"]);

            if (string.IsNullOrEmpty(tootltipValues))
                return "Missing parameter!";

             //Split the parameters. The '{#}' is used to separate the country name and the EmployeeID
             string[] parameters = tootltipValues.Split(new string[] { "{#}" }, StringSplitOptions.RemoveEmptyEntries);
             string country = parameters[0]; // The first parameters is the country
             string employeeID = parameters[1]; // The second one is the employee's ID

            // The count of all orders for the country

            
            double salesCount = orderService.Count(country, employeeID);  // Count is the event in the OrderServices Class designed to handle // the BL

            string htmlOutput =
                "<div style=\"width: 90px;\">" +
                    "<h6 style=\"font-size: 12px; margin: 0; padding: 5px 0 0 5px;\">" + country.ToUpper() + "</h6>" +
                    "<div style=\"margin:15px 0 0 0; padding-right: 3px; text-align: right; \"><strong style=\"font-size: 20px;\">" + salesCount + "</strong> Orders</div>" +
                "</div>";

            return htmlOutput;
        }

    Thanks in Adanvce guys..!!
    and let me know any other detail is required.


  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 05 Sep 2013 Link to this post

    Hi Harendra,

    This alert means there is a server error during the execution of the Web service. You need to attach a debugger to the server and step through the service code to determine what is the exact exception and fix it. You can take a look at this blog posts for the basics on making a "manual" request to the service to see what is going on and to debug it easier: http://blogs.telerik.com/aspnet-ajax/posts/13-03-21/different-ways-to-make-a-request-to-the-server.

    Since the same code runs live (http://demos.telerik.com/aspnet-ajax/salesdashboard/ go to the Countries tab) the reason is something in the current project, e.g. a connection string does not take into account an SQL server name, or a database is missing, or something entirely different.

    The same logic works in this demo that you can examine as well (you can download an offline project with the entire demo site from your account): http://demos.telerik.com/aspnet-ajax/tooltip/examples/imagemaptooltipmanager/defaultcs.aspx.

    Also, you need to make sure the path to the service is correct, the sample application's code uses
     <WebServiceSettings Method="GetOrdersCountByCountry" Path="ToolTipWebService.asmx" />
     without the root symbol at the beginning, so if you have copied the project you need to make sure the paths are correct for your case.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Harendra
    Harendra  avatar
    9 posts
    Member since:
    Jun 2013

    Posted 24 Sep 2013 Link to this post

    Sorry for replying so late but yes thanks for your support. i tried debugging the web service and found the context object was getting converted to dictionary object with specific key - value pair.

    error was at : in ToolTipWebService.cs

     [WebMethod]
        public string GetOrdersCountByCountry(object context)
        {
            try
            {
               
    // error at this bold location
                IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;
                string tooltipValues = ((string)contextDictionary["Value"]);

                if (string.IsNullOrEmpty(tooltipValues))
                    return "Missing parameter!";

                string[] parameters = tooltipValues.Split(new string[] { "{#}" }, StringSplitOptions.RemoveEmptyEntries);
                string country = parameters[0]; // The first parameters is the country
                string employeeID = parameters[1]; // The second one is the employee's ID



                double salesCount = orderService.Count(country, employeeID);

                string htmlOutput =
                    "<div style=\"width: 90px;\">" +
                        "<h6 style=\"font-size: 12px; margin: 0; padding: 5px 0 0 5px;\">" + country.ToUpper() + "</h6>" +
                        "<div style=\"margin:15px 0 0 0; padding-right: 3px; text-align: right; \"><strong style=\"font-size: 20px;\">" + salesCount + "</strong> Orders</div>" +
                    "</div>";
                return htmlOutput;
            }
            catch (Exception ex)
            {
                throw ex;            
            }
            
            

        }

    and in order to remove it, i passed the string as a Dictionary object to the webservice : in the Countries.cs (usercontrol)

     foreach (PolygonHotSpot spot in SaleCountriesMap.HotSpots)
            {
             
                string value = spot.AlternateText.Trim(new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' });
     
                string tooltipValue = value + "{#}" + EmployeeID.ToString();

    // this is what i did
                Dictionary<string, object> contextDictionary = new Dictionary<string, object>();
                contextDictionary.Add("Value", tooltipValue);

                this.RadToolTipManager1.TargetControls.Add(spot.AlternateText, tooltipValue, true);

                mapTitle.Text = "Ship Countries for " + Employee.FirstName + " " + Employee.LastName;
            }
            
     The webservice is working fine and  there is  no error  now.

    Thanks for your support.
  5. Harendra
    Harendra  avatar
    9 posts
    Member since:
    Jun 2013

    Posted 24 Sep 2013 Link to this post

    i have another problem, i want to have the world-map image with hotspots of all the countries. Like in the SalesdashBoard demo (http://demos.telerik.com/aspnet-ajax/salesdashboard/ ), we have only few countries listed in the image map.
    Can i have a sample world image with all countries with their co-ordinated.
    I tried doing the same using Expression Web 4 using HTML image map and drawaing the ploygon hotspots but it wasn't accurate.

    Thanks in advance..!!

  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 24 Sep 2013 Link to this post

    Hi,

    It is good to hear you have managed to fix the webservice.

    On the image map question - here is the other demo we have a ready image map over a political map: http://demos.telerik.com/aspnet-ajax/tooltip/examples/imagemaptooltipmanager/defaultcs.aspx. These are the two such resources we have.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017