Hallo

K�nnte jemand die folgenden zwei Files bei sich auf dem Server mal laufen lassen und schauen, ob es richtig funktioniert?
Nach dem Button-Click wird SelectedIndex ausgegeben.
Bei mir funktioniert die erste ListBox korrekt und die zweite, welche per LoadControl importiert wird, funktioniert nicht.
Vieleicht habe ich bei mir ja eine Server-Einstellung falsch.


Gruss Christoph


NewFile.aspx ============================


<%@ Page Language="VB" %> <%@ Register TagPrefix="j" TagName="j" Src="NewFile.ascx" %> <%@ reference control="NewFile.ascx" %> <script runat="server">

   sub Page_Load()
           ph.Controls.Add(LoadControl("NewFile.ascx"))
     end sub

</script>
<html>
<head>
</head>
<body>
   <form runat="server">
       <j:j id="j" runat="server"></j:j><br><br>
       <asp:PlaceHolder id="ph" runat="server"></asp:PlaceHolder>
   </form>
</body>
</html>
===============================

NewFile.ascx
===========================================
<%@ Control Language="VB" ClassName="MC" %>
<script runat="server">

   sub Page_Load
       Lit.Text=ListBox1.SelectedIndex().toString()
   end sub

</script>
<!-- Insert content here -->
<asp:ListBox id="ListBox1" runat="server">
   <asp:ListItem Value="a">a</asp:ListItem>
   <asp:ListItem Value="b">b</asp:ListItem>
   <asp:ListItem Value="c">c</asp:ListItem>
   <asp:ListItem Value="d">d</asp:ListItem>
</asp:ListBox>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
selectedItem: <asp:Literal id="Lit" runat="server"></asp:Literal>
======================================================


_______________________________________________ Asp.net mailing list [EMAIL PROTECTED] http://www.glengamoi.com/mailman/listinfo/asp.net

Antwort per Email an