I have been programming with PHP for some time before. And as of yet I am looking to get started with VB.NET by looking into the URL routing (or also the "http" protocol system) of it.
The intention is to build a "HelloWorld" web application, where the message should be printed on the screen by pressing the button.
Here is an example with PHP to showcase it:
A showcase of this PHP example can be seen here: http://zikanti.com/myroot/helloworldmessage.php
This is how I imagined it with VB.NET:
FrontPage.vbhtml
HelloWorldController.vb
The Folder Directory
The aim was to have the module "HelloWorld" called up after the button is pressed, so the "HelloWorld" message does get printed on the screen.
This is where the URL routing does take place.
I tried the command "Url.action" as it can be seen above, though when testing the web application on the localhost server the message would not get printed after pressing the button.
Though, by this I am also looking now for a way to be able to tell if the URL routing has been done correctly. Is there a way for this?
Basically, to sum it up - I am not sure:
- if this example has been approached right and perhaps a different approach may be recommended
- if there is a way to make sure the URL routing is correct, before investigating why the "HelloWorld" message does not get printed on the screen.
The intention is to build a "HelloWorld" web application, where the message should be printed on the screen by pressing the button.
Here is an example with PHP to showcase it:
HTML:
<body>
<form action="" method="POST">
<button name="button">Press It!</button>
</form>
<?php
$button = $_POST['button'];
if(isset($button)) {
echo "Hello World Message!";
}
?>
</body>
A showcase of this PHP example can be seen here: http://zikanti.com/myroot/helloworldmessage.php
This is how I imagined it with VB.NET:
FrontPage.vbhtml
VB.NET:
<h1>Cause the HelloWorld Line...</h1>
<form name="hello_world_button" action="[COLOR=#ff0000]@Url.Action("HelloWorld", "~/~/Models/HelloWorldController.vb")[/COLOR]" method="post">
<button type="button" name="button">Press it!</button>
</form>
HelloWorldController.vb
VB.NET:
Module HelloWorld
' Every console application starts with Main
Sub Main()
System.Console.WriteLine("Hello world!")
End Sub
End Module
The Folder Directory
VB.NET:
Models/HelloWorldController.vb
Views/Home/FrontPage.vbhtml
The aim was to have the module "HelloWorld" called up after the button is pressed, so the "HelloWorld" message does get printed on the screen.
This is where the URL routing does take place.
I tried the command "Url.action" as it can be seen above, though when testing the web application on the localhost server the message would not get printed after pressing the button.
Though, by this I am also looking now for a way to be able to tell if the URL routing has been done correctly. Is there a way for this?
Basically, to sum it up - I am not sure:
- if this example has been approached right and perhaps a different approach may be recommended
- if there is a way to make sure the URL routing is correct, before investigating why the "HelloWorld" message does not get printed on the screen.
Last edited: