M
milbrand
I have an ASPX page with a DataList. The ListItems contain a
DropDownList and a Hyper Link. The user selects an Item from the
Dropdown box and then selects the hyperlink to edit that item.
My thought was to grab the ID, ClientID, or UniqueID of the Hyperlink
and then build the name of the DropDownList to grab the value to pass.
The problem is that the value keeps coming back Undefined. How can I
get the dynamic name created at runtime?
My Code:
**javascript**
function floorplanpopup(i)
{
var j = i.ClientId.length - 33;
var no = i.ClientId.substring(20, j);
var x =
document.getElementById("dl_notification:_ctl"+no+":dd_floorplan");
day = new Date();
id = day.getTime();
eval("page"+id + " =
window.open('FloorPlanSetup.aspx?did="+x.value+"', '" + id + "',
'width=350, height=500');");
}
**Datalist Code**
<asp:label class="lblnormal" id="lbl_floorplan" runat="server"
Font-Size="X-Small">Floor Plan Name:</asp:label>
<asp:dropdownlist class="normal" id="dd_floorplan" runat="server"
DataTextField="FLOORPLAN_NAME"
DataValueField="FLOORPLAN_ID"></asp:dropdownlist>
<asp:HyperLink id="hl_floorplan" runat="server"
NavigateUrl="javascript:floorplanpopup(this);"
ImageUrl="images/AddButton.gif"></asp:HyperLink>
Anyhelp is greatly appreciated.
~Brad
DropDownList and a Hyper Link. The user selects an Item from the
Dropdown box and then selects the hyperlink to edit that item.
My thought was to grab the ID, ClientID, or UniqueID of the Hyperlink
and then build the name of the DropDownList to grab the value to pass.
The problem is that the value keeps coming back Undefined. How can I
get the dynamic name created at runtime?
My Code:
**javascript**
function floorplanpopup(i)
{
var j = i.ClientId.length - 33;
var no = i.ClientId.substring(20, j);
var x =
document.getElementById("dl_notification:_ctl"+no+":dd_floorplan");
day = new Date();
id = day.getTime();
eval("page"+id + " =
window.open('FloorPlanSetup.aspx?did="+x.value+"', '" + id + "',
'width=350, height=500');");
}
**Datalist Code**
<asp:label class="lblnormal" id="lbl_floorplan" runat="server"
Font-Size="X-Small">Floor Plan Name:</asp:label>
<asp:dropdownlist class="normal" id="dd_floorplan" runat="server"
DataTextField="FLOORPLAN_NAME"
DataValueField="FLOORPLAN_ID"></asp:dropdownlist>
<asp:HyperLink id="hl_floorplan" runat="server"
NavigateUrl="javascript:floorplanpopup(this);"
ImageUrl="images/AddButton.gif"></asp:HyperLink>
Anyhelp is greatly appreciated.
~Brad