This code:
private void Submit_Click(object sender, RoutedEventArgs e)
{
user temp = new user();
temp.Username = UserName.Text;
temp.Password = Password.Text;
dataBase.AddTouser(temp);
IAsyncResult result = dataBase.BeginSaveChanges(new AsyncCallback (OnSaveChangesCompleted), temp);
}
void OnSaveChangesCompleted(IAsyncResult result)
{
try
{
string name = ((user) result.AsyncState).Username.ToString();
dataBase.EndSaveChanges(result);
}
catch (DataServiceRequestException ex)
{
MessageBox.Show("OnSaveChangesCompleted Error: " + ex.ToString());
}
}
produces this error:
The HTTP verb POST used to access path '/Membership/user/' is not allowed
I think it may have something to do with this being incorrect:
public static void InitializeService(IDataServiceConfiguration config)
{
config.SetEntitySetAccessRule("*", EntitySetRights.All);
config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
}
Or it may have something to do with the ASP.NET configuration, but I am not sure what to do in there.
I am trying to use Silverlight, DataEntityFramework, and a WCF Service all together (for the first time) and have no idea where exactly the solution to this problem lies.