<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 11/03/2010 17:33, Ken MacDonald wrote:
<blockquote
 cite="mid:3468cae11003110933t6a0bbb19k3a9dbddcfe1dd993@mail.gmail.com"
 type="cite">Thanks Michael,<br>
We're using .NET, so this should be OK, I guess? </blockquote>
<br>
If you're using IronPython that you are definitely using .NET. Do you
mean you are using ASP.NET?<br>
<br>
<blockquote
 cite="mid:3468cae11003110933t6a0bbb19k3a9dbddcfe1dd993@mail.gmail.com"
 type="cite">All of the other controls (StackPanel, Grid...) are being
imported from System.Windows.Controls, so I thought ListItem ought to
have been somewhere in there. <br>
  <div class="gmail_quote">
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div text="#000000" bgcolor="#ffffff">
    <div class="im">
    <blockquote type="cite"> <br>
from System.Web.UI.WebControls import ListItem<br>
    </blockquote>
    <br>
    </div>
That's for ASP - is that what you are using?
    <div class="im"><br>
    <blockquote type="cite"><br>
but I get "can't import UI"<br>
    </blockquote>
    <br>
    </div>
You will need to add a reference to its containing assembly before you
can import it.
    <div class="im"><br>
    </div>
    </div>
  </blockquote>
  <div><br>
What is the 'containing assembly'? Should I do something like....<br>
  </div>
  </div>
</blockquote>
<br>
If you go to the MSDN page you were using as a reference previously it
will tell you what *assembly* the WebControls namespace is contained in
(System.Web perhaps).<br>
<br>
You will need to add a reference to this assembly before you can import
from it. This will look *something* like:<br>
<br>
&nbsp;&nbsp;&nbsp; import clr<br>
&nbsp;&nbsp;&nbsp; clr.AddReference('System.Web')<br>
<br>
All the best,<br>
<br>
Michael<br>
<br>
<blockquote
 cite="mid:3468cae11003110933t6a0bbb19k3a9dbddcfe1dd993@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <div><br>
from System.Web import UI<br>
  <br>
(guess, not, same error!)<br>
  </div>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div text="#000000" bgcolor="#ffffff">
    <div class="im"><br>
    <blockquote type="cite"><br>
So, anyone know how to do this?<br>
      <br>
Also, I'm concerned that next time (if I ever get it working first
time) I come to this popup, it will contain the items I had added
previously; how does one go about clearing the whole listbox?<br>
    </blockquote>
    </div>
listbox.Items.Clear()<br>
    <br>
HTH,<br>
    <br>
Michael<br>
    <br>
    </div>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a>
<a class="moz-txt-link-freetext" href="http://www.voidspace.org.uk/blog">http://www.voidspace.org.uk/blog</a>

READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (&#8221;BOGUS AGREEMENTS&#8221;) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

</pre>
</body>
</html>