R
Ric_C
Greetings all...
I've got an interesting problem that I'm trying to work through and in
need of some help.
I'm trying to get a Microsoft Ajax 1.0 ModalPopupExtender to pass a
parameter to an external WebService using the DynamicContextKey. The
example I've been using is almost completely helpful...however the
author is using a DataList that is locally bound, so he can use the
"Eval("style")" call to get what he wants out of the DataList.
I need to get the SelectedValue of a DropdownList in the same manner,
but since it's not using data binding, Eval just ain't gonna be of any
use.
So, my question is: What can I use to get the value out of the
Dropdown in a manner that is friendly to a server tag?
Here's the example for illustration:
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server"
TargetControlID="LinkButton" PopupControlID="Panel1"
OkControlID="Button1"
BackgroundCssClass="background" DynamicControlID="Panel2"
DynamicContextKey='<%# Eval("style") %>'
DynamicServiceMethod="GetContent" />
I need to replace the <%# Eval("style") %> with something akin to <%#
ddlLessons.SelectedValue.ToString() %>
So far, my attempts include:
1) <%= ddlLessons.SelectedValue.ToString() %> which passes "<%=
ddlLessons.SelectedValue.ToString() %>" to the web service, rather
than the value of the ddl.
2) <% ddlLessons.SelectedValue.ToString() %> which passes "<%
ddlLessons.SelectedValue.ToString() %>" to the web service, rather
than the value of the ddl.
and 3) <%# ddlLessons.SelectedValue.ToString() %> which passes "null"
to the web service.
Variations, including removing the ToString() from the control produce
either "null" being passed to the web service, or it simply won't
compile.
So, does anybody know how I can get the value of the dropdown so I can
pass it along to my web service?
Thanks in advance for the help!
Ric
I've got an interesting problem that I'm trying to work through and in
need of some help.
I'm trying to get a Microsoft Ajax 1.0 ModalPopupExtender to pass a
parameter to an external WebService using the DynamicContextKey. The
example I've been using is almost completely helpful...however the
author is using a DataList that is locally bound, so he can use the
"Eval("style")" call to get what he wants out of the DataList.
I need to get the SelectedValue of a DropdownList in the same manner,
but since it's not using data binding, Eval just ain't gonna be of any
use.
So, my question is: What can I use to get the value out of the
Dropdown in a manner that is friendly to a server tag?
Here's the example for illustration:
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server"
TargetControlID="LinkButton" PopupControlID="Panel1"
OkControlID="Button1"
BackgroundCssClass="background" DynamicControlID="Panel2"
DynamicContextKey='<%# Eval("style") %>'
DynamicServiceMethod="GetContent" />
I need to replace the <%# Eval("style") %> with something akin to <%#
ddlLessons.SelectedValue.ToString() %>
So far, my attempts include:
1) <%= ddlLessons.SelectedValue.ToString() %> which passes "<%=
ddlLessons.SelectedValue.ToString() %>" to the web service, rather
than the value of the ddl.
2) <% ddlLessons.SelectedValue.ToString() %> which passes "<%
ddlLessons.SelectedValue.ToString() %>" to the web service, rather
than the value of the ddl.
and 3) <%# ddlLessons.SelectedValue.ToString() %> which passes "null"
to the web service.
Variations, including removing the ToString() from the control produce
either "null" being passed to the web service, or it simply won't
compile.
So, does anybody know how I can get the value of the dropdown so I can
pass it along to my web service?
Thanks in advance for the help!
Ric