Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
Points: 539, Level: 8
Points: 539, Level: 8 Points: 539, Level: 8 Points: 539, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Location: Seattle
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
Default

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..
 
Old July 19th, 2011, 10:59 AM
Registered User
 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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>
 
Old July 19th, 2011, 11:07 AM
Friend of Wrox
Points: 539, Level: 8
Points: 539, Level: 8 Points: 539, Level: 8 Points: 539, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Location: Seattle
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
Default

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';
 
Old December 9th, 2011, 02:59 PM
pori99
Guest
 
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
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default I am have been looking for this forever!

Quote:
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:

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




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.