Articles from March 2007

Lat/Long on Live Maps

By Michael Flanakin @ 3:16 PM :: 217 Views :: 2 Comments :: Other :: Digg it!

Question

Is it possible to enter directly map coordinates on Live Local? I'd like to see what we show at 38°13'36.38"N, 112°17'56.59"W, but can't find way to do it.

Answer

I don’t think you can do that via the Live website, but you can definitely do it pretty easily with the public service. Check out the attachment for an example (code listed below).

<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
var map = null;
var 
pinID 1;
function 
showMap() { 
  map 
= new VEMap('map');
  
map.ShowDashboard();
  
map.LoadMap();
  var 
ll = new VELatLong(38.13, -112.17);
  
map.AddPushpin(new VEPushpin(pinID, ll, null'My pushpin''This is pushpin number '+pinID));
  
pinID++;
  
map.SetCenterAndZoom(ll, 10);
}
-->
</script>
...
<body onload="showMap();">
...
<div id="map"></div>

Dynamically Loading Controls in .NET 1.1

By Michael Flanakin @ 1:34 AM :: 145 Views :: 0 Comments :: .NET :: Digg it!

Question

I have seven user controls developed. I have a aspx page which has seven tabs, based on each tab click, I'm loading the user controls dynamically. I'm doing this from the page_load event of my aspx page.

All my user controls have a common method called "Save". I need to call these methods from the aspx page dynamically when navigating between the tabs. Say, If I'm in tab1 and navigate to tab2, I want to call the save method in Tab1. The save methods basically saves the state of the controls in user control.

I'm not sure how to do this.

Answer

There are a number of ways to do this. Perhaps the easiest way would be to use the Panel control to determine what tab content is visible and what isn't. Of course, if this was .NET 2.0, I'd suggest the AJAX Control Toolkit's TabContainer control.

Page Loads Slowly

By Michael Flanakin @ 9:24 PM :: 148 Views :: 0 Comments :: .NET :: Digg it!

Question

When I first enter the ASP.NET website it displayed very very slow...sometime 30 seconds and more... How can I detect the reason for that?

Answer

Can you give us more details about your scenario? What server are you running on? What type of project? What compilation options are you using? There are countless factors that go into application performance. For a detailed list of those, check out Improving Application Performance and Scalability.

When is Application_Start Called?

By Michael Flanakin @ 9:18 PM :: 155 Views :: 0 Comments :: .NET :: Digg it!

Question

When does Application_Start get called? I have the following code in the Application_Start function and but it does not seem to run. I would like to Flush the cache on application start up. When I debug my program in Visual Studio shouldn't the Application_Start event run everytime I debug?

Answer

As the others mentioned, Application_Start is called when the application is first started or, more specifically, when the application receives the first request. Typically, this only happens once, but there are some events which may require the application to restart, such as a change to the web.config file, as mentioned before. To answer your second question, yes, the event is fired before you even get to the UI of the app. If you're not seeing this behavior, make sure your breakpoints are setup appropriately.

Designing a Domain Model

By Michael Flanakin @ 8:59 PM :: 152 Views :: 0 Comments :: Patterns & Practices :: Digg it!

Question

In a real time projects, what do you all do? Do you guys first design the OO Business layer with classes and then design the database layer or its the other way around?

Answer

I haven't really delved into the formal theories around domain driven design, but I'd have to say I use this same approach. In my experience, the best approach is really going to depend on the experience of you and your team. Most people seem to start in the database, but I personally think that can cause problems. In the same breath, I have to say I don't think this is a steadfast rule, tho; it really depends on skills and experience. With all that said, my approach tends to start by forming a domain model based on use cases. This domain model represents the data your system will manage. Next, I like to identify the business services that correspond to the domain model; the data access layer, which essentially mimics the business logic layer; and, finally, I wrap it all up by formulating the data model, which is loosely based on the domain model.

The only thing I like to stress here is that the application's domain model should be designed independently of the data model. The reasoning behind this primarily lies within the fact that you don't want your application domain model held to restrictions of the data store, which could possibly change over time. As far as I'm concerned, the data store is merely an end-point -- an end-point that can (or, perhaps should support the ability to) be replaced with no change to the application, outside of the data access layer.

Google Maps Gets Traffic... Finally

By Michael Flanakin @ 2:04 PM :: 148 Views :: 0 Comments :: Other :: Digg it!
Perhaps this is just a bit snippy of me, but LifeHacker Mobile-ready link posted a bit about how Google Maps now has traffic information Mobile-ready link and I had to say something Mobile-ready link. Don't get me wrong, Google Maps is very nice, but this is something Live Maps has had for quite some time. It's nice to see Google catching up with someone else for a change.





Archives Archives

Categories Categories

Related Links Related Links

 Sightings

ASP.net

CodeProject Gold Level Member