Friday, September 10, 2010

ve: geoservice working from detailsview

Posted by david on 13. February 2009 10:50

ASP.NET Resources - .NET Collection Madness - Part I

I am still trying to figure out an update progress problem.  I ran into this a few posts back – what’s happening is that I’ve got the POIGrid which lists all points acting as a master for the detailsview grid, which displays details for selected POI.

I’ve also got a little label or literal sitting outside of the grids that is supposed to grab an address from the detailsview after it has changed. 

The problem is that when the POIgrid selection is changed, all my code is firing before the actual detailsview is updated. So I need to find a better event to hook up with.

http://forums.asp.net/p/992493/1291946.aspx

good stuff on

ASP.NET AJAX  The UpdateProgress Control  Introduction to the UpdateProgress Control

ASP.NET AJAX  The UpdatePanel Control  Working with PageRequestManager Events

ASP.NET AJAX  Server Reference  System.Web.UI Namespace  Timer Class

Linq to return the address info, using the new ID

LINQ to Label or Textbox - Visual Basic .NET

LINQ To SQL Samples

LINQ C# SamplesIntroduction to LINQ Queries

I was trying to build a conditional on the detailsview. If detailsview latitude field is empty, then do something ( for now, fill a literal with the word “geo” )

After struggling with it for a while –

if (DetailsView1.Rows[7].Cells[1].Text = string.empty)   did not work

if (DetailsView1.Rows[7].Cells[1].Text == “ “) did not work

if (DetailsView1.Rows[7].Cells[1].Text == ““) did not work

finally decided to look at what was actually going on in that text field, by checking it’s length. Turns out that there are 6 characters in there.  So, this conditional works:

if (DetailsView1.Rows[7].Cells[1].Text.Length == 6)

& it’s OK, for the most part, because the lat longs are nearly always more than 6 characters.  But, I will have to come back and fix this.

We have some success now -

if a POI is selected, the detailsview databound event fires, which checks if there is a lat long in the record. If yes, it just says “already geocoded'”, if not, it passes the address to the geoservice, get’s the lat long, updates the DB, & then says “geocoded”

next i would like to control the style of the POI grid, so that the name of the item is greyed out if it is not geocoded.

also I’ve some sort of pagerequest error on the page, but it’s apparently not critical cuz everything seems to be working.

2009 02 12

Comments

Add comment


 

biuquote
Loading