Wrox Programmer Forums
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
Old 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
        <div id="mapDiv">    
            <% Html.RenderPartial("Map", Model.Dinner); %>

Last edited by flyinhawaiian; July 19th, 2011 at 10:59 AM..
Old 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"
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NerdDinner.Models.Dinner>" %>

<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"

<script src="/Scripts/Map.js" type="text/javascript"></script>

<div id="theMap" style="width:520px;">
<script type="text/javascript">
    $(document).ready(function() {
        var latitude  = '<%:Model.Latitude.ToString().Replace(',', '.') %>';
        var longitude = '<%:Model.Longitude.ToString().Replace(',', '.') %>';
        if ((latitude == 0) || (longitude == 0))
            LoadMap(latitude, longitude, mapLoaded);
   function mapLoaded() {
        var title = "<%: Model.Title %>";
        var address = "<%: Model.Address %>";
        LoadPin(center, title, address);
Old 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.
NerdDinner.MapDivId = 'theMap';
Old December 9th, 2011, 02:59 PM
Posts: n/a
Default 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.
Received Infraction
Old October 3rd, 2015, 08:09 AM
Registered User
Join Date: Oct 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default I am have been looking for this forever!

Originally Posted by Ole F View Post
When updating the Latitude/Longitude Textboxes to hidden boxes it should not be done as in page 133:

<%: Html.Hidden("Latitude", Model.Dinner.Latitude)%>
<%: Html.Hidden("Longitude", Model.Dinner.Longitude)%>
but as this instead:

<%: 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!


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I acheive this logic? OnDistantShores XSLT 3 February 26th, 2010 04:16 AM
Heat Map over Google Map ajit Javascript 0 March 7th, 2008 09:01 AM
And/Or Logic??? ninel SQL Server 2000 2 February 9th, 2007 11:33 AM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.