The first IronPython ASP.

Source: Internet
Author: User

Today we experimented with integrating IronPython in Visual Studio, which is documented below.

First, download a binary of IronPython 1.0, and after extracting it, configure the directory path to the environment variable path.
Then download the latest Visual Studio SDK. I downloaded the beta version of August 2006.
(: http://affiliate.vsipmembers.com/affiliate/downloadfiles.aspx)

After you install the SDK, you can use IronPython in Visual Studio. Open it
C:\Program files\visual Studio 2005 Sdk\2006.04\visualstudiointegration\samples\ironpythonintegration
Project, run as F5, and a new instance of Visual Studio is launched, where you can create a IronPython project.
I have tried a few times and found that it is still very unstable and often appears abnormal.

This startup Visual Studio instance supports syntax highlighting for IronPython, and Intellisense support.
In addition, a IronPython console window (open in the View-other Windows menu) is also available for easy experimentation with various objects and methods:



Next you create an ASP. In the. aspx file, the notation is almost indistinguishable, but you don't know why everything goes to the designer and throws an exception.

No way, had to hand-written:

<%@ Page Language="C #"AutoEventWireup="true"codebehind="Default.aspx.py"Inherits="Webapplication1._default" %>

<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">

<HTMLxmlns= "http://www.w3.org/1999/xhtml" >
<Headrunat= "Server">
<title>Untitled Page</title>
</Head>
<Body>
<formID= "Form1"runat= "Server">
<Div>
<Asp:textboxID= "Txtname"runat= "Server" />
<Asp:buttonID= "Btntest"Text= "OK"runat= "Server"OnClick= "btnTest_Click" />
</Div>
</form>
</Body>
</HTML>
After writing this, a btntest button is added to the background code to handle the following:

ImportSystem
fromsystem.webImport *
fromSystem.Web.UIImport *
fromSystem.Web.UI.WebControlsImport *
fromSystem.Web.UI.WebControls.WebPartsImport *
fromSystem.Web.UI.HtmlControlsImport *
fromCLRImport *

classWebApplication1:#namespace
    class_default (System.Web.UI.Page):
@accepts (self ())
@returns (None)
defPage_Load (self):
Pass

        defbtnTest_Click (self, sender, args):
Self.txtName.Text = "Hello"

The syntax does seem to be simpler than C #.

Really look forward to the next Visual Studio patch, so that you can experience IronPython in the actual development of ASP.

Source: http://www.cnblogs.com/RChen/archive/2006/09/15/ipy_aspnet.html

The first IronPython ASP.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.