Rabu, 02 Oktober 2013

Example Project of Condition in ASP.Net

Condition on ASP.Net, there's 2 divisions: using if() and switch()
using switch seems like selection program, there's the example Project:

1. Make a New Project and name it VolumeObjects, or whatever you want:

2. Insert this scripts:
3. and the output will be seen like this:
you can add your menu with your style, good luck :)

Design And Validation Form ASP.Net

  On this thread i want to share ASP.Net tutorial about Validation Form, follow 
the tutorial carefully :)

1. Make a New Project, choose Windows Forms Application, give it name FormVal 
   or whatever do you want, locate it on your folder project.

2. On Left side you'll see the Toolbox and add any components: Label, TextBox, Button, ProgressBar and ErrorProvider.
3. And then we'll inputing scripts inside Button, with Right Click it and Choose View Code or F7.
4. Write this scripts inside button Execute :
5. Try to input with complete:
6. But when you not complete the inputing you'll get the notice
//Explaning about the Scripts:
- decimal NIS; decimal mean the input only for Numbers, NIS is a name of variable string inside setError mean for notice when error input, like

Kamis, 19 September 2013

Example Project of Condition

this thread contained an Example Project of Condition, before following this
tutorial, if you not knowing about Condition, read my post before about 
Condition, Array and Looping.

1. Create new HTML Document on your Site, Right Click on Site -> New File ->
name it "conditional_form.html" or what ever you want.

2. Insert this in your HTML form:
3. Create new PHP Document on your site, Right Click on Site -> New File -> name it "conditional".php" or what ever you want.
4. we create a variable to store the data sent, then checks whether the data is sent empty or not. If you do not check the selected gender, Add this code inside 'conditional.php.
5. Before test for Run, if you use Dreamweaver, please check 'Follow Links Con- tinously' and 'Use testing server for Document Source' first, this needed when you want appear in Live, that setting at "conditional_form.html".
6. And try to Run it in Live mode :
7. So the output will be seen like this :)

Rabu, 11 September 2013

Condition, Array and Looping at PHP

1. Condition
There's 3 way to make Condition at PHP: if, else, elseif. Every Condition
starting with if :

if(codition) {
//do something
}

if included else:

if(codition) {
//do something
}
else {
//do something else
}

else can be used to add more condition:

if(codition1) {
//do activity1
}
elseif(condition2) {
//do activity2
}
else {
//do other activity
}

*if the condition correct or true values of the existing code in the curly
braces {} will be executed.

2. Array
not seems like string and number only can hold a single value, array can
store/save more than one value. Values ​​can be accommodated, like string,
number, or other arrays. To make arrays in PHP as follows:

$country=array("Indonesia","Japan", "Singapore", "Australia");

or

$country[0]="Indonesia"; 
$country[1]="Japan"; 
$country[2]="Singapore";


-> to create an empty array:

$country=array();

-> to access the value inside array:

$var=$country[1];
echo $var; //the output is Japan
echo $country[0]; //the output is Indonesia

-> sorting array can using with function sort():


sort($country); //array sorted ascending
$var=$country[1]; 
echo $var; //the output is Japan
echo $country[0]; //the output is Indonesia


-> to knowing a lot of elements / or stored values array, using function
   count():

$Amount = count($country);
echo $Amount; //the output is 3


3. Looping
In PHP there are two forms of repetition that is often used, for and while,

-> Looping using for:

for(initial expression; condition; final expression){
//do something
}

Example:
for($i=1; $i<=10; $i++){
echo "Output >,<" ;
}
*this looping will outputing word "Output >,<" ten times.

-> Looping using while:

while(condition){
//do something
}

Example:
$i=1;
while($i<=10){
echo "Output >,,<";
$i++;
}
*this looping will outputing word "Output >,,<" ten times.

"as long as the conditions TRUE, the loop will continue to do"

Rabu, 04 September 2013

Input and Output data Biodata Project ASP.NET

Read my post before about Inputing and Output data, on this Thread, i want to share about
make Biodata using Input and Output, put this method and you can modify with your own style :


and Run it Ctrl + F5, input your data and see the Output :)


NB: this Input and Output Without TryParse()

Selasa, 03 September 2013

Input and Output on ASP.Net

There's 2 kinds of Input and Output on ASP.Net, Without TryParse() and with
TryParse()

1. Without TryParse();

Try to practice it with make a New Project, you can use your old Folder project
with right clicking on 'Solution'

Name it 'InputOutput' and you will focused on Program.cs part of InputOutput
Insert this method, or whatever with your own style
and Run it Ctrl + F5, input your form and look the output
2. With TryParse(); Try to practice it again make a New Project, you can use your old Folder project with right clicking on 'Solution'. Becouse we want use TryParse, make it different than before Name it 'InputOut putTryParse' and you will focused on Program.cs part of InputOutputTryParse
Insert this method, or whatever with your own style
and Run it Ctrl + F5, input your numbers and look the output
float.TryParse(input, out height); is function used to be string values can converted to desired type.

Comment, Variable and Type Data on ASP.NET

1. Comment
1. Function main()
   Include command/statement that will process with computer, example
Function main() on C# languange:

static void Main (string[]args)

2. Command(statement)
   Use for commanding computer to do specific task, example
command inside C# language:

Console.WriteLine("Hello World. . .");

3. Keyword (using)
   If you use function Console.WriteLine(), you must give sign to computer
library file which recorded Console.WriteLine(). to give sign write using
System; on early of program code. command using System; indicates that user
will use all things inside library System.

4. Comment
   for including words without process with computer, you must give a comment
statement. comment usefull when the programming forget about his/her made,

// comment for 1 line

/* comment for more than 1 line*/
5. Parenthesis Brace Parenthesis brace using for start and stop the statement, example class Program { static void Main (string[]args) // this function of main() { Console.WriteLine("Hello World. . ."); } } 2. Variable and Type Data Variable is a place for keep the data. for example, when you want caculate block volume, long, width, height and volume from that will saved inside variable. Declaration of Variable is a command for computer to provide the variable which will be used. for example user commanding computer for provide variable of long, width, height and volume. that Variable will be use for saving data number (integer)/ 3. Rule of naming Variable 1. name of Variable consist of letters, number, and underscore "_". 2. the First character of name, must letter. 3. uppercase and lowercase is different (case Sensitive) 4. can't use Program keywords (ex. using)