Bangladeshi Softwares
Home - Download - Codes & Tutorials - Bangla IT Bibhag - Mobile - About Me

 


Showing ASCII arts in ASP with <PRE> tag


Step-1:
Here is a timepass code snippet for you. You will enter some ASCII art inside the textarea (between the <PRE> and </PRE> tags), and click on the 'Show ASCII Art' button. It will then display the ASCII art on the ASP page. It can be run under UNIX platforms using the Sun One ASP (a.k.a. Chilli!Soft). Open your favorite text editor and type the code listed below:


<%@ Language="JScript" %>
<%

/*
 * Author: Ahsanul Haque Shovon
 * Email: ahsanul.haque.shovon@gmail.com / ahsanul_haque_shovon@yahoo.com
 * Web: http://shovon.110mb.com
 */

var show_ascii_art;

if(Request.ServerVariables("REQUEST_METHOD") == "POST")
{
  show_ascii_art = Request.Form("texa");
  Response.Write(show_ascii_art);
}

%>

<body bgcolor="#FFFFFF" text="#000000">

<form name="form1" method="post" action="./name_of_this_page.asp">

<textarea id="txt" rows="9" cols="30" name="texa">
<pre>

</pre><%= show_ascii_art %>
</textarea>

<br>

<input type="submit" id="btn" name="subm" value="Show ASCII Art">

</form>

</body>


Step-2:
Now save the page with whatever name you like (.asp extension) and run it with IIS 4.0, 5.0, 5.1, 6.0 or PWS. Do not forget to change the name of the page inside the <FORM> tag's ACTION attribute. You can see a preview below. Do not click on it! It is an image!!




Other Helpful Resources:
http://www.programmersheaven.com
http://www.planetsourcecode.com



 



©Ahsanul Haque Shovon
All rights reserved