I'm getting a compiler error on my ASP.NET page and I can't see the
cause. I have a simple C# class compiled into a DLL and placed in my
bin directory which has a public property QuestionText. When I try
and set the property the compiler throws up
Compiler Error Message: CS1519: Invalid token '=' in class, struct, or
interface member declaration
If I don't try and set the property it prints out the default value of
the property fine.
my code is below
<%@ Page Language="C#" %>
<%@ import Namespace="MyNamespace" %>
<script runat="server">
PollQuestion pollQ = new PollQuestion();
pollQ.QuestionText = "My New Question";
</script>
<html>
<head>
</head>
<body>
<%=pollQ.QuestionText %>
</body>
</html>
The C# class is
[code:1:29c46e8760]
using System;
namespace MyNamespace
{
public class PollQuestion
{
// private members
string strQuestionText;
// empty constructor
public PollQuestion ()
{
}
// public accessors
public string QuestionText
{
get { return strQuestionText;}
set { strQuestionText = value; }
}
}
}
[/code:1:29c46e8760]
I've been trying to find the problem for a while now and so far
nobodys been able to help me.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com