[C#] AjaxControlToolkit PopupControl, RadioButtonList Value and Popup übergeben

Back2toxic

Erfahrenes Mitglied
Hallo Miteinander :)

Ich bin gerade dabei das AjaxControlToolkit für asp.net ajax 1.0 zu testen, häng allerdings zur Zeit an der PopupControlExtension fest.

Folgendes Problem:
Laut diesem PopupControl how-to (bei Minute 7 ca.) wird überprüft, ob ein ein Value gewählt wurde, danach wird dem PopupControlExtender im Ja-Fall das Value des gewählten Listboxeintrages übergeben.
So habe ich das zumindest verstanden.

Da das Video die VB Version zeigt, habe ich mir den C# Code dazu angesehen, dort ist das Ganze folgendermaßen gelöst:
Code:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AjaxControlToolkit;

public partial class _Default : System.Web.UI.Page 
{
    protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) == false)
        {
            // Popup result is the selected task
            PopupControlExtender.GetProxyForCurrentPopup(this.Page).Commit(RadioButtonList1.SelectedValue);
        }
        // Reset the selected item
        RadioButtonList1.ClearSelection();
    }
}

Bei mir will das allerdings nicht so richtig klappen...

zugehörige codesnippets von mir:
Code:
codebehind:

procedure TWebForm1.RadioButtonList1_SelectedIndexChanged(sender: TObject; e: System.EventArgs);
begin
  PopupControlExtender.GetProxyForCurrentPopup(page).Commit(RadioButtonList1.SelectedValue);
end;
Code:
.aspx
		<asp:Panel id="Panel1" cssClass="popupControl" runat="server">
          <asp:UpdatePanel id="UpdatePanel2" runat="server">
            <ContentTemplate>
              <asp:RadioButtonList id="RadioButtonList1" runat="server" onSelectedIndexChanged="RadionButtonList1_SelectedIndexChanged">
                <asp:ListItem>Steve Harris
</asp:ListItem>
                <asp:ListItem>Mark Frank
</asp:ListItem>
                <asp:ListItem>Tom Heineman
</asp:ListItem>
                <asp:ListItem>Klaus Stade
</asp:ListItem>
              </asp:RadioButtonList>
            </ContentTemplate>
          </asp:UpdatePanel>
		</asp:Panel>


Weiß hier vielleicht Jemand rat? google/Boardsuche haben mir beim Suchen nach
PopupControlExtender.GetProxyForCurrentPopup(page)
PopupControlExtender.GetProxyForCurrentPopup(this.page)
usw.
nicht viel geholfen.

Vielen Dank im Vorraus,
Chris
 
Zuletzt bearbeitet:
Zurück