Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #21 (permalink)  
Old July 19th, 2011, 11: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 11:59 AM.
  #22 (permalink)  
Old July 19th, 2011, 11: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>
  #23 (permalink)  
Old July 19th, 2011, 12:07 PM
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';
  #24 (permalink)  
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
  #25 (permalink)  
Old October 3rd, 2015, 09: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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 03:33 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.