PopUpExtender and Comma

PopUpExtender and Comma

Tue, 15 Dec 2009 02:34:59 GMT Posted by mfalac

                Tags:
        <asp:TextBox ID="MyTextBox" runat="server" Width="538px"></asp:TextBox>
        <br />
        <br />
        <asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
          <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
            <ContentTemplate>
                 <asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" AutoPostBack="true" Width="146px">
                    <asp:ListItem Text="ozkan"></asp:ListItem>
                    <asp:ListItem Text="deniz"></asp:ListItem>
                    <asp:ListItem Text="cherline"></asp:ListItem>
                    <asp:ListItem Text="fatih"></asp:ListItem>
                    <asp:ListItem Text="veronica"></asp:ListItem>
                </asp:RadioButtonList>
            </ContentTemplate>
          </asp:UpdatePanel>
        </asp:Panel>
    &nbsp;
    <br />
                <cc1:popupcontrolextender
                ID="PopupControlExtender1" runat="server"
    TargetControlID="MyTextBox" PopupControlID="Panel1"
    CommitProperty="value" CommitScript="e.value ;"
    Position="Bottom">                  
   </cc1:popupcontrolextender>

code:

Protected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButtonList1.SelectedIndexChanged

       If MyTextBox.Text = "" Then

           If Not (String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) Then

               Dim r As String = RadioButtonList1.SelectedValue
               Dim s As String = MyTextBox.Text
               PopupControlExtender.GetProxyForCurrentPopup(Me.Page).Commit(r + s)
           End If
       Else
           If Not (String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) Then

               Dim r As String = RadioButtonList1.SelectedValue
               Dim s As String = MyTextBox.Text
               PopupControlExtender.GetProxyForCurrentPopup(Me.Page).Commit(r + "," + s)
           End If
       End If
       'RadioButtonList1.ClearSelection()

   End Sub