Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Wednesday, March 28, 2012

Virtual Earth - Pushpin Layer not Updated

i'm trying to implement geotagging on my website that allow my blog reader to add themselves to the map using pushpin.under my map i've several field for the users to key in their details then upon clicking the "add" button... their details will be appended to a georss xml file... and this step works fine as the details can be appended without problem... but when the page refreshes after my user hav clicked the "add" button... the details added are not shown... and even click "refresh" on IE wont help... all i got to do to get the newly added details shown is to close the current IE and re-request the page in a new IE... then all the pushpins(including the last pushpin added) can be shown... y is this problem occuring? am i doing anything wrong??Thanks,Any chance you can post the code so I can see if you are doing anything wrong?

Thanks for your fast reply...well... here's my code:

to load the map:

1 var map = null;2 var layerid = 1;34 function AddMyLayer()5 {6 var veLayerSpec = new VELayerSpecification();7 veLayerSpec.Type = VELayerType.GeoRSS;8 veLayerSpec.ID = layerid;9 veLayerSpec.LayerSource = 'Location.xml';10 veLayerSpec.Method = 'get';11 map.AddLayer(veLayerSpec);12 }
to add pushpin and get the position:
1 function AddPin()2 {3 var pin = new VEPushpin(4 pinID,5 map.GetCenter(),6 null,7 null,8 null9 );10 map.AddPushpin(pin);1112 if (pinID != 1)13 {14 var intpin = pinID - 1;15 map.DeletePushpin(intpin);16 }1718 document.getElementById('<%=lblPosition.ClientID%>').innerText = map.GetCenter();19 pinID++;20 }
asp.net code to store position and details to XML
1Protected Sub btnAdd_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)2Dim xmldocAs New XmlDocument3 xmldoc.Load(Server.MapPath("Location.xml"))4Dim eleItemAs XmlElement = xmldoc.CreateElement("item")5Dim eleTitleAs XmlElement = xmldoc.CreateElement("title")6Dim textTitleAs XmlText = xmldoc.CreateTextNode(txtName.Text)7Dim eleBlogAs XmlElement = xmldoc.CreateElement("link")8Dim textBlogAs XmlText = xmldoc.CreateTextNode(txtBlog.Text)9Dim elePositionAs XmlElement = xmldoc.CreateNode(XmlNodeType.Element,"georss","point","http://www.georss.org/georss")10Dim strPositionAs String = Request.Form("lblPosition") // to get position11Dim textPositionAs XmlText = xmldoc.CreateTextNode(strPosition)12Dim eleDescAs XmlElement = xmldoc.CreateElement("description")13Dim textDescAs XmlText = xmldoc.CreateTextNode(txtDesc.Text)1415 eleItem.AppendChild(eleTitle)16 eleTitle.AppendChild(textTitle)17 eleItem.AppendChild(eleBlog)18 eleBlog.AppendChild(textBlog)19 eleItem.AppendChild(elePosition)20 elePosition.AppendChild(textPosition)21 eleItem.AppendChild(eleDesc)22 eleDesc.AppendChild(textDesc)2324Dim rootAs XmlElement = xmldoc.Item("feed")25 root.AppendChild(eleItem)2627 xmldoc.Save(Server.MapPath("Location.xml"))2829 Response.Redirect("Map.aspx?Session=" + DateTime.Now.Millisecond.ToString + DateTime.Now.Second.ToString + DateTime.Now.Minute.ToString)3031End Sub
so what do you think? is that the XML is being cache by Virtual Earth? so even the XML is updated... but VE is still refering to the cache data?
thanks... 

Actually I do not see anything wrong as far as I can tell. What do you get on this line?:
document.getElementById('').innerText = map.GetCenter();My only guess is you don't get the right Client ID? Otherwise I'm lost sorry

document.getElementById('').innerText = map.GetCenter();
this line is to get the position of the pushpin to be stored in the XML file...

actually as you said... the code has no problem and is working fine... it can add pushpin on the map... and after clicking "Add" button... all the information such as Name, position etc. can be appended to the XML file...

but now the problem is... even all the information are appended correctly... but the appended information cannot be shown...

let say i've one set of information in my XML file... then when the first time i start my page... the pushpin can be shown on the map... then i add another pushpin... and click "Add"... the page refreshes... appending the XML file... but the map(or the pushpin layer) is not updated...

i have to close my IE and restart it to get my second pushpin to be shown... refreshing wont help... neither does CTRL + F5... that is the only problem which i think is VE's problem... haha...

any clue? haha...

Monday, March 26, 2012

Visibility problem with ajax control

hi,

I have a textbox and required field validator control.when the page is 1st loaded the Textbox is invisible and after clicking a button it becomes visible but

the problem is that the validator control is not working though the text box is visible now? why any idea pls?

Hi,

Can you post sample code to illustratete problem? I cannot get the same problem just by placing textbox and required validator in update panel and makeing TextBox invisible initially.

-yuriy


If you are using Validators inside UpdatePanel, then it is not compatible with it

http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

You can download compatible validators control from here

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx


hi,

I have used the usual asp validators.Now I have add the tag mapping required in web.config file and add reference to validation.dll.But when I run the program it shows error in my user controls which are in another folder with a custom namespace.any idea pls? the pages are not showing error but the user controls are showing error.By the By the Pages where these user controls are imported are also in a folder.

pls reply...


I have put the error messags given in my User Controls below:

pls see this and reply quickly............

Error 150 Could not load file or assembly 'Validators, Version=1.0.0.0' or one of its dependencies. The system cannot find the file specified. (D:\SSDTracker\Tracker\web.config line 92) D:\SSDTracker\Tracker\User Controls\CompetencyDatabase\CompetencySectionUI.ascx 32


Hi,

I think the error message explained the issue clear.Make sure Validators.dll is in the right folder and the version of it is right. Make sure you made the right setting in the config file.

Good luck!