using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page { #region "Reverse Click Event" protected void btnReverse_Click(object sender, EventArgs e) { TextBox2.Text = ToReverseString(TextBox1.Text.ToString()); } #endregion #region "ReverseString" public string ToReverseString(string strInputString) { //take one new string string strFinalString = string.Empty; for (int count = strInputString.Length - 1; count >= 0; count--) { //store the reverse character in seperate string strFinalString = strFinalString + strInputString[count]; } return strFinalString; } #endregion}<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <table style="width: 530px"> <tr> <td style="width: 100px"> Enter the String </td> <td style="width: 100px"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="btnReverse" runat="server" OnClick="btnReverse_Click" Text="Reverse" /></td> </tr> <tr> <td style="width: 100px"> Reverse String </td> <td style="width: 100px"> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> </td> <td style="width: 100px"> </td> </tr> </table> </div> </form></body></html>