Showing posts with label Microsoft Technology. Show all posts
Showing posts with label Microsoft Technology. Show all posts

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.

Wednesday, September 21, 2011

C# - Call SQL Server's Stored Procedure with Data Reader

Hey.. In this post, i will share about How to Call SQL Server's Stored Procedure from C# Console Application. You can do this in Windows Form, Web Form, ASP.NET MVC, etc. The concept is same but for simplicity, i will use Console Application for this example.

First, you must create the Stored Procedure inside your database. In this example, i will create a stored procedure that accepts numeric score for its input parameter, and return letter score for its output. Here is the syntax :

Tuesday, September 20, 2011

Get Hour:Minute Format from DATETIME data type in SQL Server 2008


I found a problem when i want to display TIME data in hour:minute format. When i display TIME data types, the result is hour:minute:second : milisecond. The display is very annoying for me.
After doing some experiment, i have solve the problem in a simple way. To get the hour:minute format, you only have to convert the TIME data to VARCHAR(5). And the format is automatically changed to hour:minute format.
ex :
SELECT s.Days,CONVERT(VARCHAR(5),s.Hour) AS Hour
And the result will be like this :


Hopefully this post will solve your problem... ^_^

Add CrystalReports to Windows Form project in Visual Studio 2010


Many people ask me about crystal reports in Visual Studio 2010. It isn’t same with the previous versions. In Visual Studio 2010, we must get the Crystal Reports installation package and install it. You can download Crystal Reports for Visual Studio in the link below for free..

Download Crystal Reports for Visual Studio


After download and install this, we still can’t add CrystalReport element to our Windows Form Application projects. It’s because when you create new .net 4 Windows Form Application Projects, it uses the .net 4 Client Profile Framework. To add Crystal Reports component, we must change the framework to the standard .net 4 Framework. It can be accomplished by open (Projects – Your Application Properties – Application) and change the Target Framework to the standard .net 4 framework.

After that, you will see CrystalReportViewer and CrystalReportDocument in the toolbox.. You can easily drag that control to your form like other control..

Hopefully it will help solving your problem.. Regards.. ^_^

Monday, September 19, 2011

Microsoft Exchange Server 2010 High Availability Workshop 17 September 2011


Saturday, 17th September 2011, i was attending a great workshop from Microsoft User Group Indonesia Surabaya (MUGI Surabaya). It was about high availability of Microsoft Exchange Server 2010 with Mr. Raymond Engelbert, one of the Microsoft Exchange MVP. It was the first time for me for attending MUGI's workshop. They were very great. They made the workshop cozy and fun.

Mr. Raymond shared many things to me. He taught me what is Microsoft Exchange Server is, What the difference with another products, how to install it and how to make it high available for the user. He was very inspiring people because he shared everything he knows.

Microsoft Exchange Server 2010 is the solution from Microsoft for business class mail server. It gives great solution for a company that want to have their own mail server with high quality and reliability.