I have created an empty web application project in visual studio 2010 and have addd the following model class:
namespace MessageTest
{
public class Message
{
private String msg;
public Message(String m)
{
this.msg = m;
}
public String getMessage()
{
return this.msg;
}
public void setMessage(String m)
{
this.msg = m;
}
public bool isEmpty()
{
return (this.msg.Length == 0);
}
}
}
A very simple model class.....but I keep getting the following error when trying to build:
Missing partial modifier on declaration of type 'MessageTest.Message'; another partial declaration of this type exists c:\users\d\documents\visual studio 2010\Projects\MessageTest\MessageTest\Message.cs
EDIT: Here is where I use the Class:
namespace MessageTest
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Submit_Click(object sender, EventArgs e)
{
Message m = new Message(UserMessage.Text);
if (m.isEmpty())
{
//alert user
}
else
{
//submit data
SubmitData(m);
}
}
private void SubmitData(Message msg)
{
//submit the data to database
var dataContext = new DataClasses1DataContext();
}
}
}
EDIT:
My .dbml has a table in it called Messages:
Messages
ID (PK) int(10) auto_inc
Message varchar (100)
Could this be the issue?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)