I have a dropdown list that contains action items that replace the command buttons, ie edit, delete, update, replace etc. When the end-user selects an action item a popup needs to appear to confirm selection and continue action request. I have a javascript function for which I am passing the object (dropdown list) and can determine the object selected value. However, I need to also pass a record id as a second parameter using the Eval() method. I can do this in a hyperlink : <a href="javascript:openPopup
('Details.
aspx?INV_I
D=<%# Eval("INV_ID") %>')">Replace</a>. But cannot get the dropdownlist onchange event to accept a parameter of <%# Eval %>, below is the example of what I can get to work without using a second parameter: onchange="processAction(th
is)" . I need something similiar to this: onchange="processAction(th
is, '<%# Eval("INV_ID") %>')" . When using this code the error message is 'The server tag is not well formed'. Thanks in advance for your assistance.
Passing dropdownlist object in javascript function that does work.
<asp:ItemTemplate>
<asp:DropDownList ID="ddlAction" runat="server" Width="100px" onchange="processAction(th
is)" AutoPostBack="false" AppendDataBoundItems="true
">
<asp:ListItem Value="None">Select Action</asp:ListItem>
<asp:ListItem Value="Edit">Edit</asp:Lis
tItem>
<asp:ListItem Value="Delete">Delete</asp
:ListItem>
<asp:ListItem Value="Activate">Activate<
/asp:ListI
tem>
<asp:ListItem Value="Deactivate">Deactiv
ate</asp:L
istItem>
<asp:ListItem Value="Deactivate">Replace
</asp:List
Item>
</asp:DropDownList>
</ItemTemplate>
Start Free Trial