What is asp.net?
Originally Posted by NextGen1How does ASP.net benefit this section and how does ASP.net have anything to do with VB.net?Originally Posted by Wiki
Again, ASP.net allows you to design full online applications with the option of using VB.net code behind to design your online application or site.
What does this mean?
This means that just about any application you can design in the windows environment can be designed to run as a online application (with minor changes, If at all).
Imagine taking an idea you already have or have developed and turning it into a online application that can be run from anywhere in the world on any machine.
A Asp.net application can run
Cross Browser
- Internet Explorer
- Google Chrome
- Opera
- Safari
- Fire Fox
- Others. (including User Created Browsers like Mnpeeps)
and Cross Platform
- Mac
- Linux (Mandrake, Ubuntu , Kubuntu , etc. etc.)
- Windows
- Just about any platform
Other Notes:
You can developer with almost no knowledge of html at all (though trust me from experience it helps alot)
Visual Web Developer 2008:>> is a fully visual IDE with drag and drop controls.
Visual Web Developer Visualy Supports any Web based language( HTMl, Java, XHTML, XML,CSS etc.)
Visual Web Developer also supports both client side and server side scripting and PHP (PHP is not visually supported).
Why have I created and stickied this thread?
To allow users to create and share projects that have been developed in Visual Basic yet are functional in the web environment and are cross platform.
Rules of this thread.
This thread can be used to:
Ask Questions
Post Tutorials
Share Releases
Or as a Discussion
The Thread Guidelines
All rules as already stated in this section (both coding and vb specific) are to be followed.
This thread is only for discussing vb.net/asp.net
If you have a release you must allow me to view and approve the release , source may be required .
Free ASP.Net Hosting
https://www.aspspider.com/
https://www.codefixer.com/asp-net/tut...et-hosting.asp
https://www.brinkster.com
https://www.somee.com
https://www.freeaspwebhosting.org
Not much storage or bandwidth, but great for small projects.
Free Domains
https://www.******/
Last edited by NextGen1; 04-02-2010 at 11:15 AM.
Introduction to ASP.net
Download and Install Visual Web Developer (if you have not already,download is available in post 1)
Open Visual web Developer and follow along
Create a New Project
[IMG]https://i111.photobucke*****m/albums/n121/golmor/image1-5.jpg[/IMG]
2. Call it Hello (or whatever you would like)
[IMG]https://i111.photobucke*****m/albums/n121/golmor/2-3.jpg[/IMG]
By Default (unless settings are changed by you) The starting point can look alitle confusing as you will be looking at the ASP.net source code part of the application
[IMG]https://i111.photobucke*****m/albums/n121/golmor/3-2.jpg[/IMG]
---
Here is the same code as the image above except with some notations so you can understand alittle of what you will be working with (not that it will be needed)
[IMG]https://i111.photobucke*****m/albums/n121/golmor/4.jpg[/IMG]
Note: In vb.net you set comments with " ' " , in the asp.net source code we use <!-- "Comment" -->
---- Moving On
3. Click on the designer tab to view the designer part (we will try and stay away from asp.net as much as possible)
[IMG]https://i111.photobucke*****m/albums/n121/golmor/5.jpg[/IMG]
Once in the designer you will feel alittle more comfortable as you will notice tremendous similarities to vb.net
[IMG]https://i111.photobucke*****m/albums/n121/golmor/6.jpg[/IMG]
The next step is for you to feal alittle more comfortable in this IDE
Right Click on the form and Click "View Code"
[IMG]https://i111.photobucke*****m/albums/n121/golmor/7.jpg[/IMG]
Once you are in the code part you should even feel more comfortable with coding as this is
what you will see
[IMG]https://i111.photobucke*****m/albums/n121/golmor/8.jpg[/IMG]
- Note the similiarites ,
If this were in vb.net you would see thisCode:Partial Public Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub End Class
and just like in vb.net here you can add your importsCode:Public Class Form1 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub End Class
Ok, let's go back to the designer part again you can do this by clicking the tab on the top that reads Default.aspx.Code:Imports System.IO Partial Public Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub End Class
Note: I will first show you how to add components and use them with vb.net (post to follow)
Continued....
ASP.Net allows drag and drop controls however unless the posistion and placement is specified with CSS/Styles or using tables
or Div's with manipulationCode:<Table> </tr> <td> </td> </tr> </Table>
I personally do not use the follwing method ( I create style sheets) but for the sake of giving you the feal of VB.net , I will teach you a method (absolute posisioning)Code:<Div> </Div>
Absolute posistion will allow you to move a element on the form freely and drop it where you like .
The way you do this is by
1. Lets add the components we need for this hello world application
- add a Div to your form, you will find it in the toolbox under the HTML Tab
[IMG]https://i111.photobucke*****m/albums/n121/golmor/12.jpg[/IMG]
- Now add a textBox
[IMG]https://i111.photobucke*****m/albums/n121/golmor/13copy.jpg[/IMG]
- Now Click the Manage Styles Tab
(If you dont see the styles by the toolbox or the solutions explorer, click view then manage styles)
[IMG]https://i111.photobucke*****m/albums/n121/golmor/new.jpg[/IMG]
- Once in the manage styles, give it a name
[IMG]https://i111.photobucke*****m/albums/n121/golmor/15.jpg[/IMG]
(I called mine textabs so I know that style will allow me to move my textbox with absolute positioning)
Now set the position to Absolute
[IMG]https://i111.photobucke*****m/albums/n121/golmor/16.jpg[/IMG]
Now click on the textbox and click apply style in the manage styles tab
[IMG]https://i111.photobucke*****m/albums/n121/golmor/17.jpg[/IMG]
Now do the same for 2 buttons
create buttononeabs and button2 abs
double click button one and use typical vb.net coding
andCode:'Button 1 Click Event Texbox1.Text = "You clicked Button1"
press F5 and test you application.Code:'Button 2 TextBox1.text = "You clicked Button2"
--- Hope this helps expand your vb.net options
--- Use one of the above free hostings plus a free domain to set up your own web
application
--Note: This was just an quick example of how you cna create a web based application using VB.net as the code behind for your website.
Thank you nextgen for this.
Easy to understand.
10/10
Also it's loads of tutorials on youtube: https://www.youtube.com/results?searc...y=asp.net&aq=f
Last edited by Zoom; 04-02-2010 at 01:00 PM.
NextGen1 (04-02-2010)
Not a problem, My goal here is to allow members to Create applications that can be run cross platform and cross browser in a web environment without having to learn to much of the different existing web applications, this can hopefully open this section to creating web services , and learning to use databases,
You can easily develop Forums, Portals, Online Operating Systems, anywhere you can take your imagination (just about)
Hopefully this thread will see some unique applications.
Obama (04-02-2010)
awesome thinking about watching some tutorials xD
Does any1 know a serie of asp.net tutorials?
Thanks in advance.
Last edited by Blubb1337; 04-02-2010 at 04:23 PM.
Thank you loads for this bro. I've been wanting to learn ASP.net and this is just the head start I need. Great job.
NextGen1 (04-02-2010)
Tutorials to get you started
Microsoft's Asp.net official site is loaded with Video Tutorials.
It pretty well organized, but they offer everything from hello world applications to creating your own web service (like Google SOAP/API/WSDL).
My suggestion would be to take it slow, don't try creating a fully functional application in one sitting, I have been working with asp.net since Asp.net 1.0 and I know html, asp, Css, Xhtml, Dynamic languages etc. etc. (not much php ) and I still come across some things I have to look up , so start from video 1 and work your way up.
The Official Microsoft ASP.NET Site
Getting Started - Get Started: The Official Microsoft ASP.NET Site
After that , You can use https://www.w3schools.com/aspnet/default.asp as a reference guide.
Plus obviously post questions and etc. in this thread.
Obama (04-02-2010)
You're my hero
NextGen1 (04-02-2010)
Lol wouldn't it take a lot of complex code to create a forum?
My first attempt at an ASP.Net program: I.C. Productions - Powered by ******
- Link approved by Nextgen1
It kinda' failed, but oh well.
Last edited by NextGen1; 04-02-2010 at 09:23 PM.
Remember to pass your links to me before posting them, I will remove and delete any link that is not approved. (that is one of the guidelines lex)
Yes, You can use error handling , you get some errors if fields are blank etc, but looks good other wise.
Last edited by NextGen1; 04-02-2010 at 09:30 PM.
A'ight, my bad. But yeah, I know how/where I screwed up, just too busy playing CoD: WaW to fix it at the moment.
Thanks.
Brings me to my next "Tut"
Note: To protect MPGH.net from Java/-/Script Coding, the word Java/-/Script (as one word without symbols) is censored, so if you see asterisks like *********** then replace that with the whole word [Java/-/Script] without the characters
--------------
Error Handling
Typically in Vb.net we will use Try , catch and exception and display it in a message box , in asp.net you can still use try, but msgbox is not allowed (outside of local host or IIS) , the reason for this is because there is no one sitting server side to click OK for you, and Websites are not direct server access (Dubbed Remote Arms in the Web Development industry) So how can we create a MsgBox for our errors,
Here is what I do .
A. I still use Try , so to handle, find, and display our errors, we will use
[php]
Try
' code
Catch Ex as exception
'code
end try
[/php]
and normally under
[php]
catch ex as exception
[/php]
we would add
[php]
msgbox (ex.message)
[/php]
for use with online applications we will have to use ********** Alert (yes Vb.net can call Java Script )
So lets create a new sub called msgbox2
[php]
Public Sub msgbox2(ByVal Msg2 As String)
End Sub
[/php]
Now we can call msgbox2 (though it won't do anything because msg2 is not yet declared and there is no code)
Next we need to add the code
[php]
Public Sub msgbox2(ByVal Msg2 As String)
Dim StringB As New StringBuilder()
Dim FO As System.Web.UI.Control
Msg2 = Msg2.Replace("'", "\'")
Msg2 = Msg2.Replace(Chr(34), "\" & Chr(34))
Msg2 = Msg2.Replace(vbCrLf, "\n")
Msg2 = "<script language=**********>alert(""" & Msg2 & """)</script>"
StringB = New StringBuilder()
StringB.Append(Msg2)
For Each FO In Me.Controls
If TypeOf FO Is HtmlForm Then
Exit For
End If
Next
FO.Controls.AddAt(FO.Controls.Count, New LiteralControl(sb.ToString()))
End Sub
[/php]
Now with this code we can generate a Java Based Message Box the same way we would anywhere.
So if you are on your local machine testing an application still use msgbox (ex.message)
If you are testing it on a production server, use MsgBox2(ex.message)
So after creating the above code, your trys should now look like this.
[php]
Try
'Code
Catch Ex As Exception
Msgbox2(ex.message)
' Msgbox (ex.message) Commented out for easy switching between production server and local host
End try
[/php]
Hope this helps
Last edited by NextGen1; 04-02-2010 at 10:38 PM.
why06 (04-09-2010)
That helps a lot in the long run. Thanks!