asp.net operates on the ASPNETDB database using Silverlight

  • 2020-05-07 19:31:10
  • OfStack

1. Add Silverlight-enabled WCF service on the Server end

[ServiceContract(Namespace = "")] 
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 
public class Service1 
{ 
[OperationContract] 
public void DoWork(string name,string pwd,string email,string question,string answer) 
{ 
MembershipCreateStatus status; 
Membership.CreateUser(name, pwd,email,question,answer,true,out status); 
} 

// Add more operations here and mark them with [OperationContract] 
} 

2. Add this Service reference to Silverlight

ServiceReference2.Service1Client client = new ServiceReference2.Service1Client(); 
client.DoWorkAsync("xxifusi", "xxifusi345","d22@we.com","q","a"); 

Related articles: