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.