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 8747803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:25:04+00:00 2026-06-13T12:25:04+00:00

So an ASP.net project that someone else built about four years ago in Visual

  • 0

So an ASP.net project that someone else built about four years ago in Visual Studios 2008 now needs some of its hard coded values changed, and it’s my task to rebuild it. I am using visual studios 2012.

I do not have a good grasp of ASP, as this is not what I normally do. I am having issues with the following bit of (redacted) code:

<%@ Page Language="C#" AutoEventWireup="True" 
CodeBehind="CourseList.aspx.cs" Inherits="ah.CourseList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>

<body>
<form id="form1" runat="server">
<% writeCourseList(); %> <!--Compiler complains -->
</form>
</body>
</html>

Visual studios says that “The name ‘writeCourseList’ does not exist in the current context”

I am confused, as writeCourseList is a public method in class CourseList. Also, this code must have compiled at one point since it works on the live server. CourseList class:

namespace ah{
    public partial class CourseList: System.Web.UI.Page{
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void writeCourseList()
        { //do stuff}
    }
}

Any help would be appreciated. Also, please feel free to advise me on how to better ask this question. Thank you!

  • 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-06-13T12:25:05+00:00Added an answer on June 13, 2026 at 12:25 pm

    Try

    public string writeCourseList()
    {
        return "this is a course list";
    }
    

    You need to return a string from the method when you want to use inline asp.net tags.

    inline asp.net tags… sorting them all out (<%$, <%=, <%, <%#, etc.)

    But instead i would not use this classis asp style. You should use web databound controls like GridView, Repeater, ListView,DataList or a simple ListBox instead.

    For example:

    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
         {
              listBox1.DataSource = getAllListCourses(); // f.e. a DataTable
              listBox1.DataTextField  = "TextColumn";
              listBox1.DataValueField = "IdColumn";
              listBox1.DataBind();
         }
    }
    

    You can also add ListItems manually:

    listBox1.Items.Add(new ListItem("Course-name","ID"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET project that contains many classes. I am thinking about creating
I've inherited an ASP.NET project that uses a single Default.aspx file in the public_html
I have accumulated an ASP.NET project that was running everything off of one page
I'm planning a new ASP.NET project that will become a product that is installed
I am researching a new ASP.Net project that we would like to host in
I'm currently working on an C#/ASP.NET project that will host several differents e-commerce websites,
We have an ASP.Net MVC project that will start with a single web server
I have an Asp.net MVC project that modestly uses jQuery scripts. My views also
Background : I have a asp.net webapplication project that should contain a public and
I have an ASP.NET VB.NET web project that references a VB.NET class library. I

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.