Tuesday, January 31, 2012

Send and Catch (Get) Query String in ASP.NET MVC



Hey, in this post i will share about sending and getting query string in ASP.NET MVC. It's very simple. First, create a controller method that accept parameter and make sure that the parameter’s name is same with the query string that you have defined. Here is the example.

   1: public ActionResult MyPage(string name, int age)
   2: {
   3:     string MyPageModel = "Hello.. I'm " + name + ". I'm " + age + " years old";
   4:     return View("MyPage", "_Layout", MyPageModel);
   5: }

And then, you can send the URL to this controller like below :

<a href="/Home/MyPage?name=Steve&age=20">Go To Steve's Page</a>

It’s very simple, isn’t it ?

In the example above, i create an <a/> (anchor) tag to make a link that refers to the controller method (MyPage). I give two data as query string (name and age). You can see that the query string in the link is like the standard query string. And in the controller method, i accept two parameters with same name (name and age). After that, you can process the data as you wish (In the example above, i create a sentence from the data that was obtained from query string and make it a model for the view).

One thing to remember, you must ensure that the query string variable name must exactly same with parameter in the controller. Otherwise, the query string won’t be obtained by the controller.

Thanks for visiting my blog. Hopefully it will be a useful post for you. Regards…

Friday, December 2, 2011

Bing Maps Ajax Control Material Part 1

Hey.. In this post i will share my presentation material and the source code sample for developing Bing Maps. I'm using Bing Maps Ajax Control 7.0. It's because this Bing Maps version is javascript based and will run in every web platform that support Javascript.



Bing Maps is an Online Mapping Services that provided by Microsoft. You can discover, explore, search and share location with this service. You can also add location and local search features for your web. You can visit the Bing Maps Website and if you want to learn and use the service, you can visit Bing Maps Portal.

You can download my presentation materials about Bing Maps Ajax Control 7 here. I used this presentation material when i'm sharing about Bing Maps in MUGI STIKOM Surabaya. You can learn from this presentation, try the code example and create your own. This is the 1st Part and there will be more material for the advanced features.

If you have more questions, you can contact me.. Thanks for your visit and wait for the next materials.. Regards..!!

Monday, October 10, 2011

Installing Windows 8 Developer Preview on Virtual Box

Virtualization is a best way to test a new Operating System. It's because you can easily install and remove it without worrying your physical storage for OS installation. In this post, i will share about the brand new operating system from Microsoft, Windows 8 Developer View, and install it on Virtual Box, the virtualization software from Oracle. Before you start the installation you need to download :
First, install your virtual box and create new virtual machine.

Friday, October 7, 2011

Object Oriented Javascript - Object, Constructor and Methods

Hey, in this post, i will share something great and incredible. Have you heard about Object Oriented Programming with Javascript? At first, maybe you think that's impossible because javascript is a very simple language. Now, you must change your mind because javascript is a very powerful language and will be mostly used by many programmers in the future. Before you read further, you must having some knowledge about javascript and object oriented programming.

Okay, let's move to the explanation. Actually, everything in javascript is an Object. There is no class in javascript. You don't need to define a class to create an object. All you have to do is create the constructor, its properties and its methods. Here's the code :


Saturday, October 1, 2011

Loading page asynchronously with JQuery Ajax Load( )

Have you ever seen an interesting website that can change its content dynamically without reloading the entire page ?


I've found a simple way to doing that, thanks to JQuery Ajax load().

JQuery Ajax load() will load data from the server and place the returned HTML into the matched element (by : JQuery). To doing that, you simply need a <div> element that will be the container of the returned HTML and then define the script that will load the HTML into that <div>.



First, you need the jquery.js.. You can download the newest version of JQuery here.


After that, you must add the jquery.js to your page. Add the script reference into the head part of your page like this :

Cloud Computing Seminar - The Future of IT Generation


Hey.. I want to share my great experience about Cloud Computing Seminar that was held on Saturday, 01 October 2011, placed at Tenth of November Institute of Technology Surabaya (ITS Surabaya).The keynote speakers are  Norman Sasono (Architect Advisor of Microsoft) and Joddy Hernady (EGM of Telkom's Multimedia Division). They are very inspiring people. They give a great understanding of Cloud Computing and its future in Indonesia. I will share with you all.. Enjoy it.. ^_^

Cloud Computing is the next generation of Information Technology (IT). Previously, if we want to build a business that using IT, we need a great amount of resources for the database, operating system, applications, technician, etc. IT has become an expensive thing to some business, especially for Mid or Low level Business. Now, that problem has been solved. There are some company that provide a services using the internet, to share resources for the other companies and maintain it so the companies that using it won't be confused because of the IT resources problem. That's the one of some reasons that make Cloud Computing will become a very important thing in the future.

So what is the Cloud Computing ? Cloud Computing  is the next generation of IT that makes computing as a services, not a product, and is available through a network, in this case the internet.

Wednesday, September 28, 2011

Using Google Maps Javascript v3 Street View with Panorama

Google Maps Street View is a Google's service that provides panoramic 360 degree on several street in several location (hopefully, in the short time, it will provide all street in the world.. ^_^). It's very useful for displaying photos, scenery or panoramic of a specific place in the map that you can't see clearly even with maximal zooming. You can see the location with any Point of View. All you must to do is only specify a StreetViewPanorama object with its options.

By default, Google Maps provides the Street View display. All you must to do is drag the Pegman of the map on a StreetView-enabled street. It's often marked by blue lines. Drag the Pegman in that place, drop it and your map become the Street View of that place..

Drag the Pegman