Question: There is a WebMethod called Reverse in GetReply.aspx.cs. Some of the code has already been filled in for you. Please add C# code so the

  1. There is a WebMethod called Reverse in GetReply.aspx.cs. Some of the code has already been filled in for you. Please add C# code so the WebMethod:
  1. Accepts a string as a parameter from the web page.
  2. Reverses the string.
  3. Return the reversed string to the web page.

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 {"nana", "admin", "student"};

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!