Question: Please add a new WebMethod to GetReply.aspx.cs. This method should: Accept a user name as input Scramble the letters of the user name into random
- Please add a new WebMethod to GetReply.aspx.cs. This method should:
- Accept a user name as input
- Scramble the letters of the user name into random order.
- Return the scrambled user name to the web page.
- Why does the WebMethod have to be public static ?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services;
public partial class GetReply : System.Web.UI.Page { [WebMethod] public static string Login(string userName) { var acceptedNames = new List
if (acceptedNames.Contains(userName) ){ return "Accepted"; } else { return "Denied"; } }
[WebMethod] public static string Reverse(string strInput) { string strReturnVal;
// Replace this with code to reverse the string strReturnVal = strInput;
return strReturnVal; }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
