473,385 Members | 1,844 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,385 software developers and data experts.

Why the geomap not working inside updatepanel?

Hi,

I am using geomap-linechart api in my application.. I want to view the map and the chart on a drop down selected index changed event.. It doesn't work if i put it inside update panel.. it becomes blank.. but it woks fine if i put the control outside the update panel.. Is there any reason or suggestion for this prob?? is it not possible to use the geomap inside update panel??

Pls help if you have any idea..

Thank you..
Feb 16 '11 #1
4 2861
acoder
16,027 Expert Mod 8TB
From the terminology you're using, it seems you're using ASP.NET. Is that correct?
Feb 16 '11 #2
s u r correct am using asp.net and javascript for creating the map and the chart..
Feb 17 '11 #3
acoder
16,027 Expert Mod 8TB
Can you post some code or perhaps a link to a test page.
Feb 17 '11 #4
this is my code..

Expand|Select|Wrap|Line Numbers
  1. <script src="Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
  2. <script type='text/javascript' src='http://www.google.com/jsapi'></script>
  3. <script src='http://maps.google.com/maps?file=api&v=2&key=ABCDEFG' type='text/javascript'></script>
  4. <script type='text/javascript'>
  5.  
  6. google.load('visualization', '1', { 'packages': ['geomap'], 'language': 'fr'});        
  7.  
  8.     var countryCode;
  9.  
  10. // map function
  11.  
  12.     function DrawWorldMap(country, lat, lang, name, count, usercount, user, bandwidth, vtitle, htitle, title1, title2) {
  13.         try {
  14.             var data = new google.visualization.DataTable();
  15.             data.addRows(count);
  16.             data.addColumn('string', 'Country');
  17.             data.addColumn('number', 'BandWidth');
  18.             var contry = country.split(',');
  19.             var band = bandwidth.split(',');
  20.  
  21.             for (var i = 0; i < count; i++) {
  22.                 data.setValue(i, 0, contry[i]);
  23.             }
  24.             for (var h = 0; h < count; h++) {
  25.                 data.setValue(h, 1, Number(band[h]));
  26.             }
  27.             var options = {};
  28.             options['dataMode'] = 'regions';
  29.  
  30.             var container = document.getElementById('<%=map_canvas.ClientID%>');
  31.             var geomap = new google.visualization.GeoMap(container);
  32.             geomap.draw(data, options);
  33.             var lati = lat;
  34.             var langi = lang;
  35.             var loop = count;
  36.             google.visualization.events.addListener(
  37.     geomap, 'regionClick', function (e) {
  38.         countryCode = e['region'];
  39.         CreateCountryMap(lati, langi, name, loop, usercount, country, user, bandwidth, vtitle, htitle, title1, title2);
  40.  
  41.     });
  42.  
  43.         }            
  44.         catch (exception) {
  45.             alert('drawworldmap: ' + exception);
  46.         } 
  47.         drawVisualization(user, bandwidth, usercount, vtitle, htitle, title1, title2); // here am calling the chart function..
  48.     }
  49.  
  50. //chart function
  51.  
  52.    function drawVisualization(User, Bandwidth, counts, vtitle, htitle, title1, title2) {
  53.         try {
  54.             // Create and populate the data table.
  55.             var data = new google.visualization.DataTable();
  56.             data.addColumn('string', title1);
  57.             data.addColumn('number', title2);
  58.             var username = User.split(',');
  59.             var BandWidth = Bandwidth.split(',');
  60.             for (var i = 0; i < counts; i++) {
  61.                 data.addRow([String(username[i]), Number(BandWidth[i])]);
  62.             }
  63.  
  64.             // Create and draw the visualization.
  65.             new google.visualization.LineChart(document.getElementById('<%=visualization.ClientID%>')).
  66.         draw(data, { curveType: "function", pointSize: 5, title: 'User Chart', titlePosition: 'out',
  67.             width: 400, height: 350, backgroundColor: 'AliceBlue',
  68.             vAxis: { maxValue: 100, title: vtitle }, fontSize: 8, hAxis: { title: htitle }
  69.         }
  70.             );
  71.         }
  72.         catch (exception) {
  73.             alert(exception);
  74.         }
  75.     }       
  76.  
  77. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  78. <ContentTemplate>
  79.  
  80. <asp:DropDownList ID="ddlusername" runat="server" AutoPostBack="true" 
  81.         OnSelectedIndexChanged="ddlusername_SelectedIndexChanged" Height="17px" 
  82.         Width="132px">   </asp:DropDownList>    
  83.  
  84. <div id="visualization" align="center" style="border: thin solid grey;" runat="server"> </div>
  85.  
  86. <div id='map_canvas' style="border: thin solid grey;" align="center" runat="server"> </div>
  87.  
  88. <asp:Label ID="lblmap" runat="server"></asp:Label>
  89.  
  90. </ContentTemplate>
  91. </asp:UpdatePanel>
  92.  
  93. and i'm calling the drawworldmap function from code behind like this..
  94.  
  95.    ScriptManager.RegisterStartupScript(lblmap, this.GetType(), "js2", "google.setOnLoadCallback(DrawWorldMap('" + contry + "','" + city + "','" + langitude + "','" + longitude + "'," + count + "," + usercount + ",'" + username + "','" + bandwidth + "','Bandwidth','UserName','User','BandWidth'));", true);
Pls help if you have any idea..

Thank you..
Feb 17 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Prashant Majhwar | last post by:
<atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <contenttemplate> <-------webpartcontro------l> </contenttemplate> </atlas:UpdatePanel> My webpart contains a dropdown list and...
5
by: mister-Ed | last post by:
I need to look into a database table (cats) to see if a certain category and its resulting resultset should be shown to users if it is deemed "universal" , or the column 'ur' is tagged with the...
1
by: durga2005 | last post by:
hi i have a textbox and regular expression validator control .i have placed these control inside update panel. just im validating the textbox with regular expression validator control when i...
0
by: Don | last post by:
I have a GridView inside an UpdatePanel. This GridView has a command field (edit, update, cancel). When I click edit I go into update mode, refreshing only the GridView, as you would expect. ...
2
by: lynx129 | last post by:
Hi there , I have php script that works fine under my server but I dont know how to put the html code inside my site. feedback.html <html dir="rtl"> <head> <title> ????? ??? </title>...
3
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, "And the link to Microsoft's site on that blog says: "The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside an...
5
by: Pselus | last post by:
I have a dynamically created page. The page creates an UpdatePanel (created at Design time) which has an ASP:Table (design time) in it. The table has rows with a textbox (run time) that runs some...
9
by: jayvi | last post by:
I used this code inside of a javascript file to switch out an 'add to cart' button: var addDisplay = document.getElementById('cart-add'); addDisplay.innerHTML = "<a class='item_add'...
3
by: fishnfrogs | last post by:
Hi, I can't figure out why this isn't working. I'm trying to loop through an array and do a mysql update. However, it doesn't work. for($i = 0; $i < $len; ++$i) { $param = $array . '%';...
3
by: elyfrank | last post by:
The title tag works fine in Firefox, but the alt tag or title tag doesn't work in ie. This is my iframe in file1.html <iframe src="file1.php" frameborder="0" scrolling="no" width="560"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.