Wednesday, 29 January 2014

MVC 4 - Dynamic Output

Leave a Comment
The whole point of a Web application platform is to construct and display dynamic output. In MVC, it is the controller’s job to construct some data and pass it to the view, which is responsible for rendering it to HTML. One way to pass data from the controller to the view is by using the ViewBag object, which is a member of the Controller base class. ViewBag is a dynamic object to which you can assign arbitrary properties, making those...
Read More...

MVC 4 - Rendering web Pages

Leave a Comment
The output from the previous post wasn’t HTML—it was just the string "Hello World, This is my first MVC Application". To produce an HTML response to a browser request, we need to create a view. Creating And Rendering a View Modify the Controller to render a View (please refer the previous post before you do this).         public ViewResult Index()         {            ...
Read More...

Creating Your First MVC 4 Application

Leave a Comment
In this tutorial i will show the example on MVC 4. Follow this step to create new MVC Application on Microsoft Visual Studio 2010. Creating MVC 4 Project File >> New Project Choose ASP.NET MVC4 Web Application. (If you dont have MVC 4, Install it here) On Project Template, choose Empty if you want to start from zero or choose Internet Application to start developement with default template. Choose View engine Razor. Click OK...
Read More...

Decimal Manipulation in C#

Leave a Comment
This post will  show manipulation on the Data Type Decimal. //This is the hard code value for decimal   //without suffic m or M, the compiler thread the object as a double hence will cause error   decimal price = 10.1654M;   //Convert decimal to double   double priceInDouble = Convert.ToDouble(price); //output : 10.1654   priceInDouble = (double)price;//output : 10.1654   //convert to double with 2 decimal point,           priceInDouble =...
Read More...

Tuesday, 28 January 2014

How to send email in ASP.NET- C# example

Leave a Comment
This is example how to send email from asp,net web application. Refer this post if you want to send email in java code . This example will use google smtp email server. The aspx Page <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">     <asp:Label ID="LErrorMessage" runat="server" ></asp:Label>     <asp:Button ID="Button1" runat="server" Text="Send Email"...
Read More...

How to send email in java - example

Leave a Comment
This is a example code to send email in java. This example will use 3rd party library JavaMail  . The Code Example import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; /**  *  * @author zulkamal  */ public...
Read More...

How to create XML File In Java

Leave a Comment
This is a example of creating XML file in java application. The Main Class Code import java.io.File; import java.util.ArrayList; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import...
Read More...

The ASP.NET developer checklist

Leave a Comment
The post is just a checklist for developers when they a re building a website/web application/ portal . The list are the common step that need to execute before it is actually done. The developer checklist Fix broken link Spelling and grammar Check website in all browser Custom 404 Traffic analysis (Google analytics) Favicon Optimize Image  Optimize HTTP Header Use friendly URL HTML Validation CSS Validation Secure Connection (optional) Add Search feature (optional) Cache static page SEO Optimze (robot.txt , XML sitemap) By...
Read More...

Wednesday, 22 January 2014

Top Programming Langguage 2014

Leave a Comment
The technical sector is booming. If you are working with smartphone or or a computer tablet etc, you should probably notice about this.As a result, coding skills are in high demand, with programming jobs paying significantly more than the average position. Even beyond the technical world, an understanding of at least one programming language makes an impressive addition to any resume. 1. Java Java is a class-based, object-oriented...
Read More...

Tuesday, 21 January 2014

Jquery - Basic function for beginner

Leave a Comment
This is a jQuery basic fucntion that developers need to know. Do something after page load successfully $(document).ready(function() {   //do something }); Select Element by id / class var element = $("#idOfElement"); var elementByClass = $(".className"); if have more than one element with same class name var elementByClass = $(".className")[0]; Get selected value (drop down) var selectedValue = $("#isDropdown").val(); //return selected value Or var selectedValue = $("#isDropdown option:selected").val(); //return...
Read More...

Iguazu Falls - Amazing Waterfalls

Leave a Comment
This is a Iguazu  Falls are waterfalls of the Uguazu River on the border of the Brazil. By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks ...
Read More...

How to remove previous append value JQuery

Leave a Comment
From my previous post to append dropdownlist value using jQuery .If you follow the step by step. The code actually work. But what will happen if the previous value are not remove and the first dropdown keep changed. The second dropdown value will keep increasing without remove the append  value. Here is my solution to remove the previous append value to the dropdownlist. <script type="text/javascript">         $(document).ready(function () {            ...
Read More...

[SOLVED] JQuery - AJAX 500 Internal Server Error - JSON - jQueryAjax

Leave a Comment
The above error always occur if you work with jQuery + Ajax. The error above may have several reason why the error occur and one of the reason is you are using the different parameter name to post to the server. Let say the method getState in webservice require one parameter which will represent country name, you must use the exactly name parameter to request from webservice. The Other Reason Not using JSON.stringify...
Read More...

How to append dropdownlist using jquery

Leave a Comment
If you want to create 2 dropdown list which the second dropdown value will depend on selected value from the first dropdown, you need to Implement JSON + Webservice+ JQuery . In my solution i will create the JSON Webservice , and I will use Jquery Ajax to request data from webservice and append the value to the second dropdown. Scenario Let say the first dropdown will list all Country, and the second dropdown will list all state from selected country. Solution Create JSON Webservice, you can refer to this link Create...
Read More...

How to create JSON webservice in ASP.NET

Leave a Comment
This example will show how to create Webservice using asp.net and the result will return in format JSON(JavaScript Object Notation). Below is the step by step to create webservice: Open Visual studio. Create New Project Add New File in the solution and choose Web Service file( .asmx) Copy paste code below to create your own JSON webservice The Web Service Code /// <summary>     /// Summary description for KenticoJSONTest     /// </summary>     [WebService(Namespace...
Read More...

Sunday, 19 January 2014

JQuery Height not correct

Leave a Comment
JQuery have method to get the window height : - $(window).height()  , and document height : - $(document).height() ; Problem window height and document height give the same result which is wrong. If you resize the browser , the window height  should give smaller or bigger than document height. The Full HTML Code <html> <head>   <script type='text/javascript' src='http://code.jquery.com/jquery-1.10.1.js'></script> <script type='text/javascript'>$(document).ready(function(){    ...
Read More...

Print GridView Header On Each Page While On Printing : ASP.NET

Leave a Comment
This example will show how you can include Table header on each page when you print the html document. You need to have the css, and javascript to do this objective. Let see the full example. The ASPX Page <!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">     <title></title>    ...
Read More...

Multiple select button in one gridview

Leave a Comment
GridView Multiple Select Buttons this is the keyword when i used to searching in Mr. Google and end up with several link to solve this problem. This was my solution to have a multiple select button in one GridView Controller The ASPX Page   <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" ...
Read More...

C#: Check if an application is already running

Leave a Comment
This is the snippet code to check if application running or not in C# using System.Diagnostics; bool IsApplicationAlreadyRunning(string processName) { Process[] processes = Process.GetProcessesByName(processName); if (processes.Length >= 1) return true; else return false; } By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks ...
Read More...

RegisterForEventValidation can only be called during Render()[SOLVED]

Leave a Comment
Today i do my routine by developing / testing / and debuggig and found error on my web page : RegisterForEventValidation can only be called during Render(); The code actually for get html code from server side inside panel ...  var sb = new StringBuilder();  Panel1.RenderControl(new HtmlTextWriter(new StringWriter(sb)));  string htmlToConvert = sb.ToString(); So i do some googling and found the causes of this error occur.. The Causes occurs when you try to render a control to Response. Generally some...
Read More...

C# coalesce operator : Question Mark In C# and Double Question Mark

Leave a Comment
A not so common, but very useful operator is the double question mark operator (??). This can be very useful while working with null able types. Lets say you have two nullable int: int? numOne = null; int? numTwo = 23; Note : int? (data type with question mark used to declare variable with null able type) Scenario: If numOne has a value, you want it, if not you want the value from numTwo, and if both are null you want the number ten (10). Old solution: if (numOne != null)     return numOne; if (numTwo...
Read More...

Friday, 17 January 2014

Pinging in ASP.NET Example

Leave a Comment
This tutorial will show you how to ping a hostname/ip using the .NET System.Net class, ASP.NET 2.0 and C#.NET. The .NET Framework offers a number of types that makes accessing resources on the network easy to use. To perform a simple ping, we will need to use the System.Net, System.Net.Network.Information, System.Text namespaces. using System.Net; using System.Net.NetworkInformation; using System.Text; ASPX Page  <asp:ScriptManager...
Read More...

Dynamically Add/Remove rows in HTML table using JavaScript

Leave a Comment
This is very often for web developer when we need to use dynamically generate HTML table using JavaScript. The example will spare the first row(cannot delete) and you can dynamically add new row by clicking the button Add Row or delete the row by clicking the button Delete Row. The Code <!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>    ...
Read More...

Subscribe to our newsletter to get the latest updates to your inbox.

Your email address is safe with us!




Founder of developersnote.com, love programming and help others people. Work as Software Developer. Graduated from UiTM and continue study in Software Engineering at UTMSpace. Follow him on Twitter , or Facebook or .



Powered by Blogger.