aspx.vb file question

  • Thread starter Thread starter Shapper
  • Start date Start date
S

Shapper

Hello,

I have an aspx page which in its script has:

Sub Page_Load(...)
...
End Sub

And 2 functions:

A DataSet Function:

Function dsContent(ByVal page As String) As System.Data.DataSet
...
Return dataSet
End Function

And a function created by me:

Sub changeCulture(culture As String)
Session("culture") = culture
Thread.CurrentThread.CurrentCulture = New CultureInfo(culture)
End Sub

Can and should I move all them to an aspx.vb file?
What changes should be made?

I never used an aspx.vb file.
An example or tips of how to move these functions to an aspx.vb file it
would be of great help.

Thank You Very Much,
Miguel
 
If you are using Visual Studio you can simply open the .aspx page, then click
View--Code from the menu. This will automatically take you to a aspx.vb page
and regisiter it on the .aspx page.

Whether or not you choose to use an aspx.vb file is up to you. As a general
rule, it is probably a good practice as it helps extract your business logic
from your presentation logic.
 
Hello,

I am using Web Matrix.
So Visual Studio generates the aspx.vb file?

Could someone do it for one of my aspx files so I get a reference that I
can look to? Or maybe give me the basic structure and rules of how to do
this.

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top