By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

AJAX extended radiobuttonlist unselects selected value in popup

P: n/a
SAL
hello,
I'm using a radiobuttonlist in an updatepanel in an item template in a
Gridview control. I'm populating the radiobuttonlist in the RowDataBound
event. I have the control toolkit registered in the page and I've got code
to get the selected value from it in the
Radiobuttonlist_SelectedIndexChanged event.
The code in there is:

Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs)
If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
Dim s As String = rblFMSValue.SelectedValue
Dim pos As Integer = s.IndexOf(": ")
s = s.Substring(pos + 2)
PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
End If
End Sub

But, when the code block get executed, the SelectedValue of the RBL is
always an empty string so the code within the if block never executes. It
never dismisses the popup after the user selects an item and unselects the
item selected (from the user's point of view). I have the Autopostback
property set to True and the EnableViewState property set to True. What
could the issue be?

S
Sep 5 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi Steve,

As you said:
==================================================
I'm populating the radiobuttonlist in the RowDataBound event
==================================================
Could you tell me how do you do this? Is the RadioButtonList control
defined in the aspx or created dynamically in the RowDataBound event
handler?
In addition, where do you add the event handler? Please note if it's done
in the RowDataBound event handler the SelectedIndexChanged event handler
will not fire because RowDataBound event doesn't fire on postback (if
you're using DataSource control or bind the GridView on the first page
load, and not call GridView.DataBind() method on postback explicitly). Thus
the SelectedIndexChanged event handler is not attached to the
RadioButtonList control and will not fire at all.

If my guess above is correct you can attach the event handler in the inline
code
<asp:RadioButtonList AutoPostBack="true" ID="RadioButtonList1"
runat="server"
onselectedindexchanged="rblFMSValue_SelectedIndexC hanged">

If my guess is wrong please send me a demo project that can reproduce this
problem. I'll have a look and investigate.

Regards,
Allen Chen

--------------------
| From: "SAL" <SA*@nospam.nospam>
| Subject: AJAX extended radiobuttonlist unselects selected value in popup
| Date: Fri, 5 Sep 2008 12:11:09 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
| Message-ID: <uG**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host182023.clark.wa.gov 64.4.182.23
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP06.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:75359
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| hello,
| I'm using a radiobuttonlist in an updatepanel in an item template in a
| Gridview control. I'm populating the radiobuttonlist in the RowDataBound
| event. I have the control toolkit registered in the page and I've got
code
| to get the selected value from it in the
| Radiobuttonlist_SelectedIndexChanged event.
| The code in there is:
|
| Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object,
ByVal
| e As System.EventArgs)
| If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
| Dim s As String = rblFMSValue.SelectedValue
| Dim pos As Integer = s.IndexOf(": ")
| s = s.Substring(pos + 2)
| PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
| End If
| End Sub
|
| But, when the code block get executed, the SelectedValue of the RBL is
| always an empty string so the code within the if block never executes. It
| never dismisses the popup after the user selects an item and unselects
the
| item selected (from the user's point of view). I have the Autopostback
| property set to True and the EnableViewState property set to True. What
| could the issue be?
|
| S
|
|
|

Sep 8 '08 #2

P: n/a
Hi Steve,

As you said:
==================================================
I'm populating the radiobuttonlist in the RowDataBound event
==================================================
Could you tell me how do you do this? Is the RadioButtonList control
defined in the aspx or created dynamically in the RowDataBound event
handler?
In addition, where do you add the event handler? Please note if it's done
in the RowDataBound event handler the SelectedIndexChanged event handler
will not fire because RowDataBound event doesn't fire on postback (if
you're using DataSource control or bind the GridView on the first page
load, and not call GridView.DataBind() method on postback explicitly). Thus
the SelectedIndexChanged event handler is not attached to the
RadioButtonList control and will not fire at all.

If my guess above is correct you can attach the event handler in the inline
code
<asp:RadioButtonList AutoPostBack="true" ID="RadioButtonList1"
runat="server"
onselectedindexchanged="rblFMSValue_SelectedIndexC hanged">

If my guess is wrong please send me a demo project that can reproduce this
problem. I'll have a look and investigate.

Regards,
Allen Chen

--------------------
| From: "SAL" <SA*@nospam.nospam>
| Subject: AJAX extended radiobuttonlist unselects selected value in popup
| Date: Fri, 5 Sep 2008 12:11:09 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
| Message-ID: <uG**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host182023.clark.wa.gov 64.4.182.23
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP06.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:75359
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| hello,
| I'm using a radiobuttonlist in an updatepanel in an item template in a
| Gridview control. I'm populating the radiobuttonlist in the RowDataBound
| event. I have the control toolkit registered in the page and I've got
code
| to get the selected value from it in the
| Radiobuttonlist_SelectedIndexChanged event.
| The code in there is:
|
| Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object,
ByVal
| e As System.EventArgs)
| If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
| Dim s As String = rblFMSValue.SelectedValue
| Dim pos As Integer = s.IndexOf(": ")
| s = s.Substring(pos + 2)
| PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
| End If
| End Sub
|
| But, when the code block get executed, the SelectedValue of the RBL is
| always an empty string so the code within the if block never executes. It
| never dismisses the popup after the user selects an item and unselects
the
| item selected (from the user's point of view). I have the Autopostback
| property set to True and the EnableViewState property set to True. What
| could the issue be?
|
| S
|
|
|

Sep 8 '08 #3

P: n/a
Hi Steve,

Have you solved this problem?

Regards,
Allen Chen
Microsoft Online Community Support
--------------------
| From: "SAL" <SA*@nospam.nospam>
| Subject: AJAX extended radiobuttonlist unselects selected value in popup
| Date: Fri, 5 Sep 2008 12:11:09 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
| Message-ID: <uG**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host182023.clark.wa.gov 64.4.182.23
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP06.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:75359
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| hello,
| I'm using a radiobuttonlist in an updatepanel in an item template in a
| Gridview control. I'm populating the radiobuttonlist in the RowDataBound
| event. I have the control toolkit registered in the page and I've got
code
| to get the selected value from it in the
| Radiobuttonlist_SelectedIndexChanged event.
| The code in there is:
|
| Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object,
ByVal
| e As System.EventArgs)
| If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
| Dim s As String = rblFMSValue.SelectedValue
| Dim pos As Integer = s.IndexOf(": ")
| s = s.Substring(pos + 2)
| PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
| End If
| End Sub
|
| But, when the code block get executed, the SelectedValue of the RBL is
| always an empty string so the code within the if block never executes. It
| never dismisses the popup after the user selects an item and unselects
the
| item selected (from the user's point of view). I have the Autopostback
| property set to True and the EnableViewState property set to True. What
| could the issue be?
|
| S
|
|
|

Sep 10 '08 #4

P: n/a
SAL
Actually, I gave up on it since our company is still on IE6 and I can't
force an upgrade. So, until we get to IE 7, it doesn't look like I can do
much AJAX.

S

"Allen Chen [MSFT]" <v-******@online.microsoft.comwrote in message
news:RW**************@TK2MSFTNGHUB02.phx.gbl...
Hi Steve,

Have you solved this problem?

Regards,
Allen Chen
Microsoft Online Community Support
--------------------
| From: "SAL" <SA*@nospam.nospam>
| Subject: AJAX extended radiobuttonlist unselects selected value in popup
| Date: Fri, 5 Sep 2008 12:11:09 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
| Message-ID: <uG**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host182023.clark.wa.gov 64.4.182.23
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP06.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:75359
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| hello,
| I'm using a radiobuttonlist in an updatepanel in an item template in a
| Gridview control. I'm populating the radiobuttonlist in the RowDataBound
| event. I have the control toolkit registered in the page and I've got
code
| to get the selected value from it in the
| Radiobuttonlist_SelectedIndexChanged event.
| The code in there is:
|
| Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object,
ByVal
| e As System.EventArgs)
| If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
| Dim s As String = rblFMSValue.SelectedValue
| Dim pos As Integer = s.IndexOf(": ")
| s = s.Substring(pos + 2)
| PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
| End If
| End Sub
|
| But, when the code block get executed, the SelectedValue of the RBL is
| always an empty string so the code within the if block never executes.
It
| never dismisses the popup after the user selects an item and unselects
the
| item selected (from the user's point of view). I have the Autopostback
| property set to True and the EnableViewState property set to True. What
| could the issue be?
|
| S
|
|
|

Sep 17 '08 #5

P: n/a
SAL
Hi Allen, I had the radiobuttonlist defined in the page as such along with
the event handler:
<asp:Panel ID="panFMSValue" runat="server" CssClass="popupControl">
<asp:UpdatePanel ID="upFMSValue" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList
ID="rblFMSValue" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="rblFMSValue_SelectedIndexC hanged"
Width="144px" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<ajax:PopupControlExtender ID="PopupControlExtender1"
runat="server"
TargetControlID="txtFMSValue"
PopupControlID="panFMSValue" CommitProperty="value"
CommitScript="e.value;" EnableViewState="False">
</ajax:PopupControlExtender>

However, I did, regrettably, forgo this approach due to the AJAX/IE6
incompatibilities.

S

"Allen Chen [MSFT]" <v-******@online.microsoft.comwrote in message
news:Dh**************@TK2MSFTNGHUB02.phx.gbl...
Hi Steve,

As you said:
==================================================
I'm populating the radiobuttonlist in the RowDataBound event
==================================================
Could you tell me how do you do this? Is the RadioButtonList control
defined in the aspx or created dynamically in the RowDataBound event
handler?
In addition, where do you add the event handler? Please note if it's done
in the RowDataBound event handler the SelectedIndexChanged event handler
will not fire because RowDataBound event doesn't fire on postback (if
you're using DataSource control or bind the GridView on the first page
load, and not call GridView.DataBind() method on postback explicitly).
Thus
the SelectedIndexChanged event handler is not attached to the
RadioButtonList control and will not fire at all.

If my guess above is correct you can attach the event handler in the
inline
code
<asp:RadioButtonList AutoPostBack="true" ID="RadioButtonList1"
runat="server"
onselectedindexchanged="rblFMSValue_SelectedIndexC hanged">

If my guess is wrong please send me a demo project that can reproduce this
problem. I'll have a look and investigate.

Regards,
Allen Chen

--------------------
| From: "SAL" <SA*@nospam.nospam>
| Subject: AJAX extended radiobuttonlist unselects selected value in popup
| Date: Fri, 5 Sep 2008 12:11:09 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
| Message-ID: <uG**************@TK2MSFTNGP06.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host182023.clark.wa.gov 64.4.182.23
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP06.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:75359
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| hello,
| I'm using a radiobuttonlist in an updatepanel in an item template in a
| Gridview control. I'm populating the radiobuttonlist in the RowDataBound
| event. I have the control toolkit registered in the page and I've got
code
| to get the selected value from it in the
| Radiobuttonlist_SelectedIndexChanged event.
| The code in there is:
|
| Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object,
ByVal
| e As System.EventArgs)
| If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
| Dim s As String = rblFMSValue.SelectedValue
| Dim pos As Integer = s.IndexOf(": ")
| s = s.Substring(pos + 2)
| PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
| End If
| End Sub
|
| But, when the code block get executed, the SelectedValue of the RBL is
| always an empty string so the code within the if block never executes.
It
| never dismisses the popup after the user selects an item and unselects
the
| item selected (from the user's point of view). I have the Autopostback
| property set to True and the EnableViewState property set to True. What
| could the issue be?
|
| S
|
|
|

Sep 18 '08 #6

P: n/a
Hi Steve,

I'm sorry to hear that. Are there any incompatibility issues you met with
other than the combobox&other elements overlay issue? The overlay issue, I
think, can be worked around by expanding the width of the column of the
<table>.

If you decide to use AJAX again please feel free to ask questions here. I'm
willing to work with you to solve any problems.

Regards,
Allen Chen
Microsoft Online Support
--------------------
| From: "SAL" <SA*@nospam.nospam>
| References: <uG**************@TK2MSFTNGP06.phx.gbl>
<Dh**************@TK2MSFTNGHUB02.phx.gbl>
| Subject: Re: AJAX extended radiobuttonlist unselects selected value in
popup
| Date: Thu, 18 Sep 2008 11:22:06 -0700
| Lines: 113
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
| Message-ID: <#S**************@TK2MSFTNGP05.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host183086.clark.wa.gov 64.4.183.86
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP05.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:76329
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi Allen, I had the radiobuttonlist defined in the page as such along
with
| the event handler:
| <asp:Panel ID="panFMSValue" runat="server" CssClass="popupControl">
| <asp:UpdatePanel ID="upFMSValue" runat="server"
| UpdateMode="Conditional">
| <ContentTemplate>
| <asp:RadioButtonList
| ID="rblFMSValue" runat="server"
| AutoPostBack="true"
|
OnSelectedIndexChanged="rblFMSValue_SelectedIndexC hanged"
| Width="144px" />
| </ContentTemplate>
| </asp:UpdatePanel>
| </asp:Panel>
| <ajax:PopupControlExtender ID="PopupControlExtender1"
| runat="server"
| TargetControlID="txtFMSValue"
| PopupControlID="panFMSValue" CommitProperty="value"
| CommitScript="e.value;" EnableViewState="False">
| </ajax:PopupControlExtender>
|
| However, I did, regrettably, forgo this approach due to the AJAX/IE6
| incompatibilities.
|
| S
|
| "Allen Chen [MSFT]" <v-******@online.microsoft.comwrote in message
| news:Dh**************@TK2MSFTNGHUB02.phx.gbl...
| Hi Steve,
| >
| As you said:
| ==================================================
| I'm populating the radiobuttonlist in the RowDataBound event
| ==================================================
| Could you tell me how do you do this? Is the RadioButtonList control
| defined in the aspx or created dynamically in the RowDataBound event
| handler?
| In addition, where do you add the event handler? Please note if it's
done
| in the RowDataBound event handler the SelectedIndexChanged event handler
| will not fire because RowDataBound event doesn't fire on postback (if
| you're using DataSource control or bind the GridView on the first page
| load, and not call GridView.DataBind() method on postback explicitly).
| Thus
| the SelectedIndexChanged event handler is not attached to the
| RadioButtonList control and will not fire at all.
| >
| If my guess above is correct you can attach the event handler in the
| inline
| code
| <asp:RadioButtonList AutoPostBack="true" ID="RadioButtonList1"
| runat="server"
| onselectedindexchanged="rblFMSValue_SelectedIndexC hanged">
| >
| If my guess is wrong please send me a demo project that can reproduce
this
| problem. I'll have a look and investigate.
| >
| Regards,
| Allen Chen
| >
| --------------------
| | From: "SAL" <SA*@nospam.nospam>
| | Subject: AJAX extended radiobuttonlist unselects selected value in
popup
| | Date: Fri, 5 Sep 2008 12:11:09 -0700
| | Lines: 28
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
| | Message-ID: <uG**************@TK2MSFTNGP06.phx.gbl>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: host182023.clark.wa.gov 64.4.182.23
| | Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSF TNGP06.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:75359
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | hello,
| | I'm using a radiobuttonlist in an updatepanel in an item template in a
| | Gridview control. I'm populating the radiobuttonlist in the
RowDataBound
| | event. I have the control toolkit registered in the page and I've got
| code
| | to get the selected value from it in the
| | Radiobuttonlist_SelectedIndexChanged event.
| | The code in there is:
| |
| | Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object,
| ByVal
| | e As System.EventArgs)
| | If Not (String.IsNullOrEmpty(rblFMSValue.SelectedValue)) Then
| | Dim s As String = rblFMSValue.SelectedValue
| | Dim pos As Integer = s.IndexOf(": ")
| | s = s.Substring(pos + 2)
| |
PopupControlExtender.GetProxyForCurrentPopup(Me.Pa ge).Commit(s)
| | End If
| | End Sub
| |
| | But, when the code block get executed, the SelectedValue of the RBL is
| | always an empty string so the code within the if block never
executes.
| It
| | never dismisses the popup after the user selects an item and unselects
| the
| | item selected (from the user's point of view). I have the Autopostback
| | property set to True and the EnableViewState property set to True.
What
| | could the issue be?
| |
| | S
| |
| |
| |
| >
|
|
|

Sep 19 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.