my site I want to calculate the distance between two areas of same city.Like I am using a search criteria where I have a drop down list. In which options are as below.
100km-70km
70km-50km
50km-10km
When user selects any one of the options the schools or shops in the specified area should be displayed. Is it possible to dynamically calculate the distance,
Seems simple but users have no internet access. The application will be hosted internally on as Intranet site. The application will be able to make webservice calls to the internet. I tested and tried Mapquest. However all the other providers seems to assume the users are able to access the internet so their API's are javascript based with src tags pointing to internet URL's
var from_Lati = 19.132324234 // from latitude var from_longi = 19.11233334 // from longitude
and I have TO latitude and Longitude in Array as
var To_Lati = [18.132323,18.90941,18.31232423] // to latitude in array var To_Longi = [18.2132123,18.242423,18.43243] // to longitude in array
I have gone through many reference on internet but can't find the solution for calculating the distance with respect to array.. Now I want to find the distance between them using JavaScript...
I want to create a google maps that it can Calculate Distance, Travel Duration, draw (plot) Route between two locations and display Directions. Now I want to hide Directions Panel.
I am using a Website application,In that website i have created dropdownlist and textboxes as dynamically... That dropdown list contains fees list... I select one type of fees in Drop downlist and enter some amount in textbox.. then i select again one type of fees in Dropdownlist and enter some amount in textbox... and finally i select a text named as Total amount in Dropdownlist it have to automatically generate the total value of the all the textboxes(beforeCreated) in the end of the textbox...
How shall i get the total value at end of the textbox..
my code is calculate to current rowafter update quantity but other rows don't affect and not calculate i need to calculate all rows i think i need to use for loops but i dont know how to do it
I am using below link to get direction:[URL] wheb i hit above url in browser then i get xml response, can anyone tell me how to fetch shortest distance from that response(XML). i need distance only, not direction.
the problem is Math funcation here calculate the things in radian i want it in degree. so i just found a formula to convert radian into degree but that formula does'nt convert the calculation correctly..
what to do bcoz there is'nt any other option to convert radian into degree..
Im looking for the functionality seen in most commercial websites like google maps to get approximate distance between cities and zip codes. Im guessing these sites are using huge databases with all this information already in them. It would be interesting to learn how to create this functionality myself but Im sure that would require a great deal of time. So Im looking for a package where someone has already done the work(an API) that would allow me to enter two different zip codes or maybe two different city,state combinations and take actions from there.
Following the series of question, this is the code as of now has been developed and working fine. Now need to make some more tweek with this
1. Instead of distance from source to destination in KM can we have it in Miles
2. I need to show the distance between source and destinace only if destination falls under 25 mile radius from source else need to show the label message that no record found.
Here is the code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="sqlmap.aspx.cs" Inherits="sqlmap" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">
[Code] ....
C# file ----- using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient;
I used a Google Maps Distance Finder API that comes with two textboxes, one for the source, and one for the destination. It also comes with a button, that when clicked, will find the distance between the two locations using the funciton GetDistance(). The code before the function initializes the map. I created another button and used VB.Net to run SQL code first, and then to automatically populate the two textboxes, then I had it call the function GetDistance().
The issue I ran into is that the function won't calculate the distance, and the map never changes from its default state. I believe it's because it's not running the code that initializes the map. (I could be wrong) I have tried WebBrowser1, to call the click of the button, but I had to Inherit Forms, which I can't do, and I have also tried adding the top code into the GetDistance() function. Is it possible to call the initializing code before GetDistance()?
Here is the JS function code:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script> <script type="text/javascript"> var source, destination; var directionsDisplay; var directionsService = new google.maps.DirectionsService(); google.maps.event.addDomListener(window, 'load', function () {
[Code] ....
Here is the VB Code I use to call the JS Function:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Dim cn As New OleDb.OleDbConnection("Provider = Microsoft.ACE.OleDb.12.0;" & _ "Data Source=|DataDirectory|Address Database One Calculation.mdb") cn.Open() Dim cmd1 As OleDb.OleDbCommand Dim sqlconnection1 As String
[Code] .....
For reference, here is the explanation of the full API Code: [URL] ....
I just had to moved a site of mine from a hosting service here in the states to an offshore host located in Malaysia. My database is still located on the east coast of north america and I am wondering if the distance between the database and the file system might be to blame for slow load times or if moving my database as well would be a waste of time.
I'm following this blog post about setting up ELMAH with MVC: [URL] I've only done part 1. Everything works correctly if I simply go to the Home controller, and then cause an error. I can view /elmah.axd as well, and my errors are logging in the database correctly.
However, I've added an area to my application named Admin. If I navigate to /Admin, I receive the following error:
System.MissingMethodException: No parameterless constructor defined for this object. public override IController CreateController(RequestContext requestContext, string controllerName) { var controller = base.CreateController(requestContext, controllerName); //Error here var c = controller as Controller;
I'm assuming this has something to do with my Area.
EDIT for jfar:
For instance, I have an Employees controller in my Admin area:
public class EmployeesController : Controller { private IEmployeesRepository employeesRepository; public EmployeesController(IEmployeesRepository employeesRepository) { this.employeesRepository = employeesRepository; } //... }
To use separation of concern and to optimize the clearness of the controllers we decided to split each action of a controller into different controllers (FunctionalLocationEditController, FunctionalLocationCreateController and such).
Problem now is the Global.asax is currently a bit big for just a few pages registered in routes.
We would need to use an area type of mechanism but for business reason we are not ready to upgrade just yet to MVC2.
Basically, is there a way in MVC1 to map the Urls to something like <folder>/<controller>/<action> ?
Been starting a new project (MVC 2) based on the first version of the same application (MVC 1).In the first we breaked out Controllers and Views into seperate projects, which resuted in a clean and organized structure.Now with version 2, I've been reading about this "Areas".Keeping the old structure and using areas sounds like overkill to me. Keeping the old way OR use Areas is what I'm trying to decide on.Just wanted to hear your thoughts about this.... Is it really that usefull (ie have other benifits)? No use to make some major changes just because something is there IMHO
I am wondering if MVC offers a handy function to iterate through all areas. I know I can search the sub-directories of Areas to achieve this. I am just curious.
I'm starting a new ASP.NET MVC project, and I decided to put my controllers in a different assembly. Evertyhing works fine, but I have hit a problem: I created a new area in my MVC Project, called Administration. I have an AdminController Class in my seperate assembly which is supposed to return views from my Admin area, but everytime it tries to return a view, it looks for it in the wrong place (~/Admin/SomeView.cshtml Instead of ~/Administration/Admin/SomeView.cshtml) How can I tell the controller to look for views in the wanted area?
is there some way to share a partial razor view between areas? For example a login partial, it is found if i use @Html.Partial("_LoginPartial") but the URLs Html.ActionLink generates are local to the calling area (even though the partial itself is not part of the area).
_LoginPartial.cshtml is in /Views/Shared/_LoginPartial.cshtml Calling view is inside /Areas/Somearea/Views
Links generated are like: [URL] But should always be: [URL]
If I create an Area, does it have to reside off of the root? Or can I create it in a sub-folder? If so, how to you set the MapRoute so you can navigate to rootSecureAreasAdmin?
I created an Area in my application named Admin. It's pretty basic, looks like this: Areas
Admin
Controllers
CompaniesController.cs
Models Views
Companies Index.aspx AdminAreaRegistration.cs
When I try to view my Index page by going to /Admin/Companies, I get a "The resource cannot be found" message. I find it weird that I don't get any sort of error message.