13 Replies - 56516 Views - Last Post: 28 March 2011 - 09:43 AM Rate Topic: -----

#1 frankdavidmartinez   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-March 11

Can I run a VB.net application on website?

Posted 25 March 2011 - 04:20 PM

Hi my name is Frank.

I'm constructing a temporary website at http://frankmarti.site90.com. I would like to know if I can run an application from Visual Basic 2008 Express Edition on my website. It is a Table design from DataGridView which I can run successfully from my desktop but I want to upload for use on my website.

I'm using Dreamweaver to build my web pages and FileZila to ftp. Do I need to convert the vb code to another language? Do I need to create a web page and embed as an object?

I also saw a posting that a vb.net application could be coded for use on the web or do I need to convert the vb.net app to another type language or something to use on my website.

Public Class Form1

    Dim mRow As Integer = 0
    Dim newpage As Boolean = True

    Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click

        Dim newMargins As System.Drawing.Printing.Margins
        newMargins = New System.Drawing.Printing.Margins(5, 5, 20, 20)
        PrintDocument1.DefaultPageSettings.Margins = newMargins
        PrintDocument1.DefaultPageSettings.Landscape = False
        PrintPreviewDialog1.Document = PrintDocument1
        PrintPreviewDialog1.ShowDialog()

    End Sub

    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        newpage = True

        With DataGridView1
            Dim fmt As StringFormat = New StringFormat(StringFormatFlags.LineLimit)
            fmt.LineAlignment = StringAlignment.Center
            fmt.Trimming = StringTrimming.EllipsisCharacter
            Dim y As Single = e.MarginBounds.Top
            Do While mRow < .RowCount
                Dim row As DataGridViewRow = .Rows(mRow)
                Dim x As Single = e.MarginBounds.Left
                Dim h As Single = 0
                For Each cell As DataGridViewCell In row.Cells
                    Dim rc As RectangleF = New RectangleF(x, y, cell.Size.Width, DataGridView1.ColumnHeadersHeight)

                    If (newpage) Then
                        e.Graphics.DrawRectangle(Pens.Black, rc.Left, rc.Top, rc.Width, DataGridView1.ColumnHeadersHeight)
                        e.Graphics.DrawString(DataGridView1.Columns(cell.ColumnIndex).HeaderText, DataGridView1.ColumnHeadersDefaultCellStyle.Font, Brushes.Black, rc, fmt)
                    End If

                    rc = New RectangleF(x, (y + Math.Max(h, rc.Height)), cell.Size.Width, cell.Size.Height)
                    e.Graphics.DrawRectangle(Pens.Black, rc.Left, rc.Top, rc.Width, rc.Height)
                    e.Graphics.DrawString(DataGridView1.Rows(cell.RowIndex).Cells(cell.ColumnIndex).FormattedValue.ToString(), DataGridView1.RowsDefaultCellStyle.Font, Brushes.Black, rc, fmt)

                    x += rc.Width
                    h = Math.Max(h, rc.Height)
                Next
                newpage = False
                y += h
                mRow += 1
                If y + h > e.MarginBounds.Bottom Then
                    e.HasMorePages = True
                    mRow -= 1
                    newpage = True
                    Exit Sub
                End If
            Loop
            mRow = 0
        End With
    End Sub

    Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged

    End Sub

    Private Sub PrintPreviewDialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewDialog1.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class



Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Can I run a VB.net application on website?

#2 Amrykid   User is offline

  • D.I.C Lover
  • member icon

Reputation: 150
  • View blog
  • Posts: 1,589
  • Joined: 16-December 08

Re: Can I run a VB.net application on website?

Posted 25 March 2011 - 04:24 PM

View Postfrankdavidmartinez, on 25 March 2011 - 06:20 PM, said:

Hi my name is Frank.

I'm constructing a temporary website at http://frankmarti.site90.com. I would like to know if I can run an application from Visual Basic 2008 Express Edition on my website. It is a Table design from DataGridView which I can run successfully from my desktop but I want to upload for use on my website.

I'm using Dreamweaver to build my web pages and FileZila to ftp. Do I need to convert the vb code to another language? Do I need to create a web page and embed as an object?

I also saw a posting that a vb.net application could be coded for use on the web or do I need to convert the vb.net app to another type language or something to use on my website.

Public Class Form1

    Dim mRow As Integer = 0
    Dim newpage As Boolean = True

    Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click

        Dim newMargins As System.Drawing.Printing.Margins
        newMargins = New System.Drawing.Printing.Margins(5, 5, 20, 20)
        PrintDocument1.DefaultPageSettings.Margins = newMargins
        PrintDocument1.DefaultPageSettings.Landscape = False
        PrintPreviewDialog1.Document = PrintDocument1
        PrintPreviewDialog1.ShowDialog()

    End Sub

    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        newpage = True

        With DataGridView1
            Dim fmt As StringFormat = New StringFormat(StringFormatFlags.LineLimit)
            fmt.LineAlignment = StringAlignment.Center
            fmt.Trimming = StringTrimming.EllipsisCharacter
            Dim y As Single = e.MarginBounds.Top
            Do While mRow < .RowCount
                Dim row As DataGridViewRow = .Rows(mRow)
                Dim x As Single = e.MarginBounds.Left
                Dim h As Single = 0
                For Each cell As DataGridViewCell In row.Cells
                    Dim rc As RectangleF = New RectangleF(x, y, cell.Size.Width, DataGridView1.ColumnHeadersHeight)

                    If (newpage) Then
                        e.Graphics.DrawRectangle(Pens.Black, rc.Left, rc.Top, rc.Width, DataGridView1.ColumnHeadersHeight)
                        e.Graphics.DrawString(DataGridView1.Columns(cell.ColumnIndex).HeaderText, DataGridView1.ColumnHeadersDefaultCellStyle.Font, Brushes.Black, rc, fmt)
                    End If

                    rc = New RectangleF(x, (y + Math.Max(h, rc.Height)), cell.Size.Width, cell.Size.Height)
                    e.Graphics.DrawRectangle(Pens.Black, rc.Left, rc.Top, rc.Width, rc.Height)
                    e.Graphics.DrawString(DataGridView1.Rows(cell.RowIndex).Cells(cell.ColumnIndex).FormattedValue.ToString(), DataGridView1.RowsDefaultCellStyle.Font, Brushes.Black, rc, fmt)

                    x += rc.Width
                    h = Math.Max(h, rc.Height)
                Next
                newpage = False
                y += h
                mRow += 1
                If y + h > e.MarginBounds.Bottom Then
                    e.HasMorePages = True
                    mRow -= 1
                    newpage = True
                    Exit Sub
                End If
            Loop
            mRow = 0
        End With
    End Sub

    Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged

    End Sub

    Private Sub PrintPreviewDialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewDialog1.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class



Thanks


You could convert it to another language like PHP, or Flash. Or you could port your VB.NET to Silverlight. Silverlight is .NET framework equivalent Flash (so you can use VB.NET, C# or whatever to write it).

EDIT: Oh and you could use ASP.NET (like smohd said below).

This post has been edited by Amrykid: 25 March 2011 - 04:52 PM

Was This Post Helpful? 1
  • +
  • -

#3 smohd   User is offline

  • Critical Section
  • member icon


Reputation: 1824
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: Can I run a VB.net application on website?

Posted 25 March 2011 - 04:32 PM

You can code your site in vb using ASP.NET, it is cool something like vb run in browser!
Was This Post Helpful? 2
  • +
  • -

#4 frankdavidmartinez   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-March 11

Re: Can I run a VB.net application on website?

Posted 25 March 2011 - 06:07 PM

View Postsmohd, on 25 March 2011 - 04:32 PM, said:

You can code your site in vb using ASP.NET, it is cool something like vb run in browser!

Can you please elaborate on your recommendation. I am new in Visual Basic, I know I can start a blank page Dreamweaver as a ASP.NET page type but I don't know how to import the VB application using Dreamweaver?

I just need to a little help in direction and maybe I can get things going.

Thanks
Was This Post Helpful? 0
  • +
  • -

#5 Amrykid   User is offline

  • D.I.C Lover
  • member icon

Reputation: 150
  • View blog
  • Posts: 1,589
  • Joined: 16-December 08

Re: Can I run a VB.net application on website?

Posted 25 March 2011 - 07:45 PM

View Postfrankdavidmartinez, on 25 March 2011 - 08:07 PM, said:

View Postsmohd, on 25 March 2011 - 04:32 PM, said:

You can code your site in vb using ASP.NET, it is cool something like vb run in browser!

Can you please elaborate on your recommendation. I am new in Visual Basic, I know I can start a blank page Dreamweaver as a ASP.NET page type but I don't know how to import the VB application using Dreamweaver?

I just need to a little help in direction and maybe I can get things going.

Thanks

You would create the ASP.NET website from inside VB Express (or Visual Studio). When you go to Create a Project, there should be something called ASP.NET page or something, if I remember correctly.

This post has been edited by Amrykid: 26 March 2011 - 06:47 PM

Was This Post Helpful? 0
  • +
  • -

#6 smohd   User is offline

  • Critical Section
  • member icon


Reputation: 1824
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: Can I run a VB.net application on website?

Posted 26 March 2011 - 02:31 PM

Just simple instead of create new project click on create new website beside it in Visual Studio. It will create new website page.asp and you will design as like you design your VB.Net apps. Most of the VB.NET books also talks about ASP.Net at the end or you may visit the ASP.NET tutorial session here.
I think you may get an introductory part and many issues are somehow related to vb with the same syntax
Was This Post Helpful? 0
  • +
  • -

#7 Jack Eagles1   User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 187
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: Can I run a VB.net application on website?

Posted 26 March 2011 - 06:29 PM

Interesting that comodo really doesn't like your website... keeps saying it's phishing... I assume that's because your host has a bad rating or something...
Was This Post Helpful? 0
  • +
  • -

#8 leadfirelf   User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 189
  • Joined: 11-February 11

Re: Can I run a VB.net application on website?

Posted 27 March 2011 - 12:36 AM

Just a quick post to save you the trouble I think that those servers don't allow you to use them as file hosting. They took down one of my sites because it was an aspx that had a mail form on it that used another server. :| not too kind
Was This Post Helpful? 0
  • +
  • -

#9 frankdavidmartinez   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-March 11

Re: Can I run a VB.net application on website?

Posted 27 March 2011 - 02:17 AM

View Postleadfirelf, on 27 March 2011 - 12:36 AM, said:

Just a quick post to save you the trouble I think that those servers don't allow you to use them as file hosting. They took down one of my sites because it was an aspx that had a mail form on it that used another server. :| not too kind


Thanks for saving me a possible headache. I kinda figured that but it's free for testing my website for now. Being a beginner in VB, especially for the programmers, you can't build web applications using Visual Basic Express Edition 2008, not sure about 2010 version. Meaning using a VB.net application on a web browser, you can upload the application but a user would have to install the application on their computer, and that's not what I want for my website. I need something to be more user friendly where browsers can access the application on my website.

It requires some sort of a net framework Visual WebGUI component to port winforms applications to the web. Does anyone know how i can add A Visual WebGUI component to the Express toolbox, where I can download it, to or to code?

I'll be glad to share my experience when I get this application up.

I tried to download Visual Web Developer but my system would let me install the program, but that's another issue.

Thanks again.
Was This Post Helpful? 0
  • +
  • -

#10 _HAWK_   User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Can I run a VB.net application on website?

Posted 27 March 2011 - 04:09 AM

If you downloaded the WebGUI, then all the components are loadable. When you select choose toolbox items, I believe they will be in the Com components. I think you will want all the components to be WebGUI including the form to make it work like you do.
Was This Post Helpful? 0
  • +
  • -

#11 Amrykid   User is offline

  • D.I.C Lover
  • member icon

Reputation: 150
  • View blog
  • Posts: 1,589
  • Joined: 16-December 08

Re: Can I run a VB.net application on website?

Posted 27 March 2011 - 05:57 AM

View Postfrankdavidmartinez, on 27 March 2011 - 04:17 AM, said:

View Postleadfirelf, on 27 March 2011 - 12:36 AM, said:

Just a quick post to save you the trouble I think that those servers don't allow you to use them as file hosting. They took down one of my sites because it was an aspx that had a mail form on it that used another server. :| not too kind


Thanks for saving me a possible headache. I kinda figured that but it's free for testing my website for now. Being a beginner in VB, especially for the programmers, you can't build web applications using Visual Basic Express Edition 2008, not sure about 2010 version. Meaning using a VB.net application on a web browser, you can upload the application but a user would have to install the application on their computer, and that's not what I want for my website. I need something to be more user friendly where browsers can access the application on my website.

It requires some sort of a net framework Visual WebGUI component to port winforms applications to the web. Does anyone know how i can add A Visual WebGUI component to the Express toolbox, where I can download it, to or to code?

I'll be glad to share my experience when I get this application up.

I tried to download Visual Web Developer but my system would let me install the program, but that's another issue.

Thanks again.


Sorry, I was thinking of Visual Studio... If you have VB Express installed with Web Developer, You can write ASP.NET (.aspx) pages with VB.NET.
Was This Post Helpful? 0
  • +
  • -

#12 frankdavidmartinez   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-March 11

Re: Can I run a VB.net application on website?

Posted 27 March 2011 - 08:58 PM

View PostAmrykid, on 27 March 2011 - 05:57 AM, said:

View Postfrankdavidmartinez, on 27 March 2011 - 04:17 AM, said:

View Postleadfirelf, on 27 March 2011 - 12:36 AM, said:

Just a quick post to save you the trouble I think that those servers don't allow you to use them as file hosting. They took down one of my sites because it was an aspx that had a mail form on it that used another server. :| not too kind


Thanks for saving me a possible headache. I kinda figured that but it's free for testing my website for now. Being a beginner in VB, especially for the programmers, you can't build web applications using Visual Basic Express Edition 2008, not sure about 2010 version. Meaning using a VB.net application on a web browser, you can upload the application but a user would have to install the application on their computer, and that's not what I want for my website. I need something to be more user friendly where browsers can access the application on my website.

It requires some sort of a net framework Visual WebGUI component to port winforms applications to the web. Does anyone know how i can add A Visual WebGUI component to the Express toolbox, where I can download it, to or to code?

I'll be glad to share my experience when I get this application up.

I tried to download Visual Web Developer but my system would let me install the program, but that's another issue.

Thanks again.


Sorry, I was thinking of Visual Studio... If you have VB Express installed with Web Developer, You can write ASP.NET (.aspx) pages with VB.NET.

Can't install Web Developer in VB Express, why?
Was This Post Helpful? 0
  • +
  • -

#13 _HAWK_   User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Can I run a VB.net application on website?

Posted 28 March 2011 - 04:06 AM

You have to be more specific, what error or message does it give you - which you could search and find out why.
Was This Post Helpful? 0
  • +
  • -

#14 leadfirelf   User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 189
  • Joined: 11-February 11

Re: Can I run a VB.net application on website?

Posted 28 March 2011 - 09:43 AM

You actually can't test it on the 000webhost servers because they are linux servers so you actually couldn't run it if you wanted to. I recommend that you set up an apache server that can handle it(host it on a windows platform) cheers
--LF
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1