ASPAlliance.com : The #1 ASP.NET Developer Community : Text Editor (WYSIWYG) - Part 2
ASPAlliance.com : The #1 Active Server Pages .NET Community The #1 ASP.NET Community
Search   Search

Subscribe   Subscribe

Powered by ORCSWeb Hosting


Site Stats


Powered By ASP.NET
 
Featured Sponsor

Featured Columnist


Featured Book
Microsoft ASP.NET Step by Step
Microsoft ASP.NET Step by Step

Find Prices


New! asp.netPRO

We publish our articles in the standard RSS format.

Powerful .NET Email Component

Code Sharing Software
Jason Gaylord's ASP Corner
Text Editor (WYSIWYG) - Part 2
Jason Gaylord (jgaylord@aspalliance.com)


In the previous article, I demonstrated how to create you own WYSIWYG. Now that you know how to create your own, let me show you how to implement one that I have created.
(2)
For this demonstration you will need to download the code by using the link at the top of this page. Once you have downloaded the code, extract the files to the root of your application. If you have no other web sites setup, extract the files to C:\Inetpub\wwwroot or where ever your wwwroot folder is located. Once the files are extracted you should have a bin folder, an img folder, a webservice folder, and a TextEditor help file. If you browse into the webservice folder, you should find a file called texteditor.asmx. If you browse into the bin folder, you will find a file called TextEditor.dll. The img folder contains the WYSIWYG images.

Now that the files are downloaded, we can begin. Open up your web editor again. We are also going to open up a browser. In the browser, go to {Your Web}/webservice/texteditor.asmx. You should see an imag similar to the following:

Screen Shot #1

Click on the web method that reads WriteEditor. Your screen should look like this:

Screen Shot #2

Then, enter in values of 1 for all items except for width (enter 500) and height (enter 300).

Screen Shot #3

Finally, click invoke to get the results. The results will open in another window in XML format like this:

Screen Shot #4

Copy the results (the black text) in between the <string> tags. Paste the results into your web editor. Save the file in your web root as texteditor1.htm. Go to your browser and navigate to http://{Your Web}/texteditor1.htm. You should have a page that looks like this:


Now that you know how the web service works, you can either create a *.dll from the web service on your local web, or use the *.dll file from the bin directory in your local web. You will call the *.dll in your web page by doing the following:
1:    <%@ Page Language="vb" %>
2:
3: <script runat="server">
4:
5: Sub Page_Load(s as Object, e as EventArgs)
6: Dim myEditor as New TextEditor()
7: Dim writeMe as String =
myEditor.WriteEditor(1,1,1,1,1,1,1,1,1,1,1,1,400,300)
8:
9: Dim myHeader as String = "<html><head><title>Testing TextEditor
</title></head><body>"
10: Dim myFooter as String = "</body></html>"
11:
12: writeMe = myHeader & writeMe & myFooter
13:
14: Response.Write(writeMe)
15: End Sub
16:
17: </script>
Use the following link as a reference for the passed parameters:
http://www.ASPAlliance.com/jgaylord/services/texteditor/help.aspx


[My Column]   [Printer-Friendly]   [Part 1]
 Copyright © 2000-2003 ASPAlliance.com  Page Rendered at 11/22/2009 6:00:18 PM