 |
BOOK: Professional ASP.NET MVC 2
 | This is the forum to discuss the Wrox book Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil Haack, Scott Guthrie, Rob Conery; ISBN: Professional ASP.NET MVC 2 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional ASP.NET MVC 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 19th, 2011, 10:56 AM
|
Friend of Wrox
|
|
Join Date: Oct 2010
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
|
|
Also in Dinner.ascx (or DinnerForm.ascx or whatever you name it) and see if the div tag has matching id
Code:
<div id="mapDiv">
<% Html.RenderPartial("Map", Model.Dinner); %>
</div>
Last edited by flyinhawaiian; July 19th, 2011 at 10:59 AM..
|

July 19th, 2011, 10:59 AM
|
Registered User
|
|
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ya map.ascx have the div tag with same ID "theMap"
Code:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NerdDinner.Models.Dinner>" %>
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"
type="text/javascript"></script>
<script src="/Scripts/Map.js" type="text/javascript"></script>
<div id="theMap" style="width:520px;">
</div>
<script type="text/javascript">
$(document).ready(function() {
var latitude = '<%:Model.Latitude.ToString().Replace(',', '.') %>';
var longitude = '<%:Model.Longitude.ToString().Replace(',', '.') %>';
if ((latitude == 0) || (longitude == 0))
NerdDinner.LoadMap();
else
LoadMap(latitude, longitude, mapLoaded);
});
function mapLoaded() {
var title = "<%: Model.Title %>";
var address = "<%: Model.Address %>";
LoadPin(center, title, address);
map.SetZoomLevel(14);
}
</script>
|

July 19th, 2011, 11:07 AM
|
Friend of Wrox
|
|
Join Date: Oct 2010
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
|
|
How does it work? DinnerForm.ascx contains the mapDiv div tag. Within it, it tries to load the partial page map.ascx.
map.ascx - Another div tag here with id "theMap". The embedded javascript in map.ascx calls NerdDinner.LoadMap() (in map. js)
map. js - Load map javascript code. This is where we tell the map where to render to.
Code:
NerdDinner.MapDivId = 'theMap';
|

December 9th, 2011, 02:59 PM
|
|
ipad development
Android is unlike any other mobile development platform or Java-based environment. *Triple Bottom Lineâs Android webinar *will immerse students in the Android platform, leveraging their existing Java expertise, and allowing them to walk away from the class ready to build Android GUIs and related components.On the first class you will write your first Android Activities. Through the rest of the week you will be progressively introduced to more and more of what Android has to offer â services, multitouch, and system search services. You will apply this knowledge with working code every step of the way. Be ready to work hard and learn a lot in this intensive, hands-on, five day introduction to programming with the Android platform.
|

October 3rd, 2015, 08:09 AM
|
Registered User
|
|
Join Date: Oct 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am have been looking for this forever!
Quote:
Originally Posted by Ole F
When updating the Latitude/Longitude Textboxes to hidden boxes it should not be done as in page 133:
Code:
<%: Html.Hidden("Latitude", Model.Dinner.Latitude)%>
<%: Html.Hidden("Longitude", Model.Dinner.Longitude)%>
but as this instead:
Code:
<%: Html.Hidden("Dinner.Latitude", Model.Dinner.Latitude)%>
<%: Html.Hidden("Dinner.Longitude", Model.Dinner.Longitude)%>
|
Thank you sooooooooooooooooooooooooooooo much!!! I couldn't figure out why the lat/lon wouldn't save to the table.
You would think that someone would actually test the tutorials before publishing them!
James
|
|
 |
|