Home | Products | Download | Order | Support | Contact | Forum | Link      

Web Sharp ActiveX

Web Sharp, the best dynamic web (template) technology in the world!
Web Sharp can speed your web development very much!
Web Sharp can save a lot of your development time!

Download:  Activex Pack(Include demo and help )   Demo   Help    

If you are a CGI developer, do you always write code as:

 

Writeln ("<tr><td bgcolor='red'>hello world</td></tr>");

Writeln (“<tr><td>”+VarA+”</td></tr>”);
...

 

You have to print out all the html code.

 

If you are a ASP developer, do you always write code as:

 

<%
for i=1 to 10
if i<5 then
%>
<tr><td bgcolor='red'><%=i%></td></tr>
....
<%
next
%>

 

You have to write HTML code interlaced with ASP code.

 

The two code snippets above are simple. But if you develop a complex web page, You will be lost in the HTML code and the logic code, and then you have to spend more time to develop web or find out errors/bugs.

Web Sharp can avoid all these. With Web Sharp, you can quickly develop a dynamic web page WYSIWYS without leaning a lot of components, tag libs or complex frameworks. What's more, if one day you develop a web application with another programming language, you can begin with Web Sharp quickly and needn't learn a lot of new features of the strange language, too.

Learn once but benefit many programming languages.

 

Web Sharp is an independent technology, so it can be easily and widely used in web development work for creating very complex, exciting web applications.

What HTML can display, Web Sharp does.

 

The following lists some great features of Web Sharp.
Simple- If you are familiar with HTML (Hyper Text Markup Language) and any programming language, you will learn Web Sharp only in 10 minutes. You needn't learn a lot of components, tag libs , very complex engines or frameworks.
Pure- Web page and logic code are 100% separate. It is the most perfect Model-View-Controller (MVC) design pattern.
Code Complete- Automatically complete most of the logic code.
Internationalization Support and Unicode Support - You can develop web applications of multi-languages.
Dynamic Template Support - Let your web pages display in different layouts or styles.
Easily to maintain- It is simple and it owns the best MVC design pattern, so it is easily to maintain. The web pages are easily designed and the programming code is easily read or written.
WYSIWYG - What you see is almost what you get.

Web Sharp Demo

l        Asp.Net  Demo  (See below)

l        ASP Demo

l        Delphi Demo

Asp.Net demo – Display some colors. This simple demo will show you what Web Sharp can do. For more info about how you can start, you must study the Web Sharp course, click here to download the course.

Note: Source code of this demo is in the directory "Demo\C#\", you can click here to download all the demos.

Here is the result of the demo in a web browser. 

 

 

Now let me show you how to do the job.

Step IDesign a web template named Colors.htm. You can use FrontPage or any other HTML Editor to make it out quickly. Figure 2 is the template and the Figure 3 is HTML code of this template. Though code of this template is 100% pure HTML, you can find some strange tags such as {%%} and <!--  BEGIN LOOP --><!--  END LOOP --> in it. It is easy to understand what they mean. You just consider {%HeadText%} is a variant and  <!--  BEGIN LOOP: Colors--><!--  END LOOP:Colors --> is a loop which will repeat a block of code.

 

Figure 2

 

Figure 3

Step II Build Logic code framework. We provider a code produce tool called “Code Framework” to make code automatically. This helps you very much. Run CodeFramework.exe, click “Open Template” button and select the template file Colors.htm, and then you will see the auto complete code result in something like the code in the following figure. The code in the following figure shows how to control the template to output the final html page. This code is written in C# (ASP.NET). This code is pure logic code without outputting any HTML element in it.

 

Step III Modify Logic code framework. What you do is just to fill the code framework with real data. The highlight code below is the modified result. What you do is a little. In order to reading easily, we also add some comments in it. Please read the comments in the code, and you will well understand the code. In fact, it is easy to understand.

//--1. Create a new WebTempalte instance and assign Colors.htm to it.

WebTemplate template = new WebTemplate();

template.FileName =@ " G:\WebTest\Template\ Colors.htm";

 

//--2. Create a root valueNode and Assign value to {%HeadText%}

ValueNode vnRoot = new ValueNode();

        string strHeadText = "Welcom to WebSharp world!";

vnRoot.SetValue("HeadText", strHeadText);

string[] colors ={ "Red", "Blue", "Yellow", "Green", "Black" };

//--3.Create a ValueNode for  Colors loop block

ValueNode vnColors = vnRoot.CreateChild("Colors");

for (int i = 0; i < 5; i++)

{

    ValueNode vnChild = vnColors.CreateChild("");

    //--4. Assign value to each {%Color%} in the loop

    string strColor = colors[i];

    vnChild.SetValue("Color", strColor);

 

}

//--5.Combine template and code , render result

Response.Write(template.Rendered(vnRoot, ""));

 

Step IV – Save code to file Colors.aspx and browse it.

 

If you do not use Web Sharp, you can create a new file ColorAspx.aspx and write code as:

<%@ Page Language="C#" %>

 

<html>

<body>

    <%

        string strHeadText = "Welcom to WebSharp world!";

        string[] colors ={ "Red", "Blue", "Yellow", "Green", "Black" };

    %>

    <b>

        <%=strHeadText%>

    </b>

    <p>

        Color List Demo</p>

    <table>

        <%  for (int i = 0; i < 5; i++)

          { %>

        <tr>

            <td>

                <%

                    string strColor = colors[i];

                    Response.Write(strColor);

                %>

            </td>

            <td>

                <span style="background-color: <%=strColor%>; width=40px"></span>

            </td>

        </tr>

        <%  } %>

    </table>

</body>

</html>

 



Copyright (C) 2000-2006 Coolmasoft Ltd. All rights reserved    Privacy Policy