Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:26:16+00:00 2026-05-23T21:26:16+00:00

I have a visual studio website solution with the following structure A page called

  • 0

I have a visual studio website solution with the following structure

A page called Default.aspx in the root folder

and a folder called App_Code in which I have added a class called Test2.vb

I am wondering how I can call the methods from my class Tes2.vb in Default.aspx.vb

I have tried

Dim test1 As New Test2 (Which didnt work)
Dim test3 As New United_Site.Test2 (Adding site name also didnt work)

My Code for Test2 Class

Public Class Test2
Public Function ReplaceXSS(ByVal InputString As String) As String
    InputString = InputString.Replace("<script>", "")
    InputString = HttpUtility.HtmlEncode(InputString)
    InputString = InputString.Replace("</script>", "")
    InputString = InputString.Replace("&", "&#38;")
    InputString = InputString.Replace("<", "&#60;")
    InputString = InputString.Replace(">", "&#62;")
    InputString = InputString.Replace("%", "&#37;")
    InputString = InputString.Replace("|", "&#124;")
    InputString = InputString.Replace("$", "&#36;")
    InputString = InputString.Replace("'", "&#39;")
    InputString = InputString.Replace("""", "&#92;")

    ReplaceXSS = InputString
End Function

End Class

and my code for default.aspx

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
    Dim test As New Class1 ' Make an object of that class
    Dim test2 As New Spurs ' Make an object of that class
    Dim test3 As New Test2 <--- Error


End Sub

End Class

Ok one more thing I noticed is a follows, if I create a brand new folder and a new class I can call it no problems i.e. Dim test3 As New Test5 and test test5 class is in a folder called “Classes”. The issue seems to be my original folder classes called App_Code which is a .NET folder I believe and is grey compared to other folders, I also copied this folder in from a different site.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:26:17+00:00Added an answer on May 23, 2026 at 9:26 pm

    Probably have to do with the namespace declarations.

    Check the namespace on the test2.vb

    if you see something like

    namespace test2
    

    then go to the files that you like to use the functions of the test2.vb and add on the first lines

    Imports test2
    

    Also, visualstudio 2010 can help you add automatically this namespace. In the line that you see the error if you move the mouse over you see a red sign that suggest you what to do, for example can suggest to add the Imports test2

    Second possible reason

    You have an error on your class and they are not have been compiled, so your program can not find them. Check for errors on test2.vb. You can also make rightclick on the solution and select to compile your site to see the messages of errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual Studio you can create a Website, which doesn't have a solution or
I have a website which was created using Microsoft Visual Studio 2010. I want
Background: I have a Visual Studio solution consisting of a website + REST web-service
I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have
I have a Visual Studio Solution with 5 WCF services. They all are in
I have a Visual Studio 2008 solution with several projects. One project is a
I have a company website (Visual Studio / VB / ASP.NET 4.0). I localized
I have a Website Project in Visual Studio 2010 along with a Class Library
I'm having a visual studio 2008 solution with asp.net 2.0/C# website. When I press
I have a Visual Studio solution containing a web site project plus a bunch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.