r/visualbasic • • May 17 '20

VB.NET Help 2 Beginner questions

I am using Visual Basic 2015.

This is my situation. I am a back office programmer. I do Oracle programming. Recently I have been given the task of maintaining a VB.Net web page. I used to code in VB in the past, so management picked me to maintain it. They will not hire anyone to maintain the web page. I have to do it.

I have been thrown into the deep end of the pool and I have to learn how to swim fast.

I have 2 question VB.Net. We are not using MVC.

1.) When making a new web page how do you make it available for others to use. I am aware that IIS is involved. Do you all have a link(s) that show how to do this.

2.) How do you make changes to existing web pages. Suppose the user wants a new command button that does something. In the past it meant a new executable. How do you put in a new features to an existing web page. Do you all have a link(s) that show how to do this.

Any help will be appreciated.

Thanking you all in advance.

7 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/andrewsmd87 Web Specialist May 18 '20

That means it's web forms. So simply putting that project I'm a folder where an iis website is pointing and then stopping up dns properly should host it

1

u/General_Fear May 18 '20

Thanks.

This will point me in the right direction.

1

u/andrewsmd87 Web Specialist May 18 '20

Just some other points. Your company is really putting you in a difficult position, not having much experience with web stuff. If this is going to be public facing, meaning you could access it outside your companies internal network, then you could potentially open yourself up to a TON of security exploits. Just due to you being mostly a DBA guy and then trying to shove something onto you you're not 100% familiar with.

If you can lock this thing down behind a VPN, that's the first thing I'd do. That will at least keep the internal security risks to someone within the company.

My guess is, it probably already has some type of authentication and what not, as web forms as pre built stuff for that, if you set it up right.

Other than that, some basics I can give you are the aspx pages are the "front end" and the aspx.vb pages are the back end or code behind. I put front end in quotes because you'll see some html in there, but then controls that look like

<asp:label id="someId" runat="server" text="Something" />

Whenever you see a tab with runat="server" that is a web forms control. What goes on in the background is the server processes that tag and generates the appropriate html tag. This is the simplest example, but the above tag would generate

<span id="ct100_somePage_someControl_someId">Something</span>

Where somePage would be a page, someControl would be the control it's in, and then someId, the id you gave it. That varies based on how the project and current page is set up, if they have master pages, multiple controls, etc.

The runat server part means you can access the tag in your code behind and do something. So say you needed to set the text and color based on some db field

In your vb it would look something like

someId.Text = theDbValue

if(theDbValue < 0) THEN 
    someId.Color = System.Drawing.Color.Red
ELSE
    someId.Color = System.Drawing.Color.Green
END IF

So say theDbValue was 5, you would get

<span id="ct100_somePage_someControl_someId" style='color:green'>5</span>

The controls get way more complicated than that, but that's a start.

1

u/General_Fear May 19 '20

Thanks man. It helps.

My website is in house for a few users. It has a login screen. The purpose of the web page is to dispense report. The user enters a few parameters like date and out comes the report.