ASP.NET/VB.NET[Official Discussion Thread]

Posts 1–15 of 16 · Page 1 of 2
ASP.NET/VB.NET[Official Discussion Thread]
What is asp.net?

Quote Originally Posted by NextGen1
ASP.Net (for all practical reasons[for the sake of this section] allows rich Website and Web Application development using Web Based Languages and allows the use of both inline and code behind VB.net
Quote Originally Posted by Wiki
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
How does ASP.net benefit this section and how does ASP.net have anything to do with VB.net?

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

http://www.aspspider.com/
http://www.codefixer.com/asp-net/tut...et-hosting.asp
http://www.brinkster.com
http://www.somee.com
http://www.freeaspwebhosting.org

Not much storage or bandwidth, but great for small projects.

Free Domains

http://www.******/


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



2. Call it Hello (or whatever you would like)



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



---

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)



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)



Once in the designer you will feel alittle more comfortable as you will notice tremendous similarities to vb.net



The next step is for you to feal alittle more comfortable in this IDE

Right Click on the form and Click "View Code"



Once you are in the code part you should even feel more comfortable with coding as this is
what you will see



- Note the similiarites ,

Code:
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
If this were in vb.net you would see this

Code:
Public Class Form1
        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 imports

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
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.

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

Code:
<Table>
</tr>
<td>
</td>
</tr>
</Table>
or Div's with manipulation

Code:
<Div>
</Div>
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)
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



- Now add a textBox



- Now Click the Manage Styles Tab

(If you dont see the styles by the toolbox or the solutions explorer, click view then manage styles)



- Once in the manage styles, give it a name



(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



Now click on the textbox and click apply style in the manage styles tab



Now do the same for 2 buttons

create buttononeabs and button2 abs

double click button one and use typical vb.net coding

Code:
'Button 1 Click Event
Texbox1.Text = "You clicked Button1"
and

Code:
'Button 2 
TextBox1.text = "You clicked Button2"
press F5 and test you application.

--- 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.
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.
awesome thinking about watching some tutorials xD

Does any1 know a serie of asp.net tutorials?

Thanks in advance.
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.
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 http://www.w3schools.com/aspnet/default.asp as a reference guide.

Plus obviously post questions and etc. in this thread.


You're my hero
Lol wouldn't it take a lot of complex code to create a forum?
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.
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
That helps a lot in the long run. Thanks!
Posts 1–15 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us