I'm using ASP.NET MVC 3 Framework and I want to use Google Maps (v3) to display the location of my customers. I can take the value of their addresses/City from the database, but how can I combine these two? I'm using Razor engine.
If you are new to Google Maps I would suggest reading through their documentation and looking over the examples to get an idea on how the API works.
Another good tutorial to look at is the 4 guys from Rolla article on implementing a store locator application. The article was originally written in Web Forms and then later updated to MVC. There is relevant information in both. They do not use Razor views, but they do a good job at showing how to query the Google Maps API on the server side and packaging the results in a JSON object to display on the map.
Your View will be pretty simple if you just want markers on a map. The only HTML you would need is a div to store the map.
I suggest getting your addresses through AJAX. MVC has a lot of good JSON stuff (like JsonResult), so you'll be able to send objects instead of parsing HTML. Since you're doing AJAX, I'm obliged to mention JQuery, I don't make AJAX calls without it. You can add the HttpPost attribute to your JSON response function too, and even make it secure!
Related
I wish to use the results of the Google translation that results from right clicking on a web page in Chrome, as opposed to using the API. These results I will use as part of a web language learning tool. I have read this page: https://cloud.google.com/translate/attribution about adding a logo, and have also read the HTML markup requirements at https://cloud.google.com/translate/markup.
My question is as these terms and conditions pages are referring to the API, do they also apply to using the translation results of using the Chrome menu item? I could use the API but this is much simpler for my temporary need.
Yes, when you're using the Google Translate Tool in a page by using the right-click, you can see that it send a request to the Google Translate API.
In definition, you have to add Google Attribution.
I guess for a personal website or non-commercial use it might not be that big of an issue but still, it will avoid future ones.
Im new to using angularjs with webforms.
i am using asp.net 4.0 webforms project. It have a usercontrol(uc.ascx) with a textbox and I dynamically multiple of the usercontrols on a page(Default.aspx)..on this aspx page i have a text box which should display the sum of the values in the textboxes of the dynamically added usercontrol..
can some one help me on how i can achieve this?
I researched all over the internet but could find a proper tutorial that works with usercontrols and angularjs
Well I think your are looking into the wrong direction angularJs isn't similar to knockoutJS probably both of them have double binding, but definitely they are very different.
Angular is a Single page application that's built mostly for CRUD's applications, the typical architecture is to use a restFul web service behind angular (which is going to be your front end) and they communicate using JSON as the communitacion format, been that said, I'd suggest to move on ASP.NET web API and angular
this video could be helpful for you to get the whole picture.
EDIT:
Unfortunately i don't have an specific example for your scenario but I've found a couple of articles that may help you on your journey.
A good example of how to use knockout.js and asp.net definetelly you can look at it and take that as a good source for learn it and apply it to your case.
This is another example using a usercontrol with knockoutjs
take a look to this gibhub repo with and example of the proposed architecture
At every question posting on websites like ASP.NET and Stack Overflow there's an option to select tags for questions. These tags are from a database, I need exactly the same solution fir my website. Can anyone suggest some an example?
I am using ASP.NET with a SQL Server database.
This may be the thing you wanted and then you can use jqueryUI autocomplete to achieve the autocomplete behavior as suggested by Kevin B
for storing tags in database definitely you have to manage it in database based on TAG -User relationship
While the server-side code is PHP, this tutorial shows you how you can build your own jQuery powered tag cloud that gets its data from the server (either the database or some other source).
the best solution present on internet ,exactly I wanted
https://github.com/harindaka/ASPTokenInput
Its uses the jqueryui API but it modifies it to fit perfectly to be able to adjust with C# code , to get the text on fly it process a url of an aspx page like a web service and retrieves the results from db on every key down event . you can code every thing you want in suggestion their ItemList.aspx.cs code and there you go , perfect harmony of C# code with power of Jquery
Assuming I'm stuck with asp.net web forms (I'd love to use MVC partial views), are there any good alternatives to asp.net AJAX 4.0 client-side templates?
In other words, is there some way to specify some html, with placeholders for data properties, to which I could then bind a JSON result. Are there any good jQuery plugins to do this?
I ask because based on the results I'm seeing from Google, this library doesn't seem to be widely used—most search results are from 2008-2010. This question seems to confirm that suspicion.
EDIT
I despise answering my own question, but this link (jQuery Templates) seems to me to be the best bet. If anyone else has any input, please post.
Definitely consider jQuery Templates. We use them quite extensively in WebForms with ScriptServices as a data provider. There is a very small learning curve.
Also check out KnockoutJS, which integrates seamlessly.
Adam, coincidentally, I am using JQuery to retrieve some server side data calling Web Services via Ajax and binding the result on the client side. On my particular case, I am only showing data in a tabular manner, so I am using the jquery datatables plugin (which is fantastic, in my opinion; the API is well documented and easy to extend if you need to).
If you need to show data differently, I think you'll need to write quite a good amount of boilerplate javascript code.
EDIT: I just saw your link reagarding Jquery Templates and looks really cool. I didn't know it existed :) Thanks!
i am creating a registration form for that i want to implement the captcha image.can i get the source code or any reference.Thanking you
Your best bet is to use reCAPTCHA. It's free, widely used, and well documented. And by using it you'll be helping the project along digitizing old books.
They have code samples for asp.net HERE
Take a look at this article (first result of search string asp.net captcha).