I have a device control panel that consist of a veiw and settings buttons. the buttons are binded to a dataset that populates the devicenumber and deviceUID
I have a javascrip function
function gotoGeo(username, name, duid)
{
top.main.location.href="../TrackApp/main.aspx?selectedTab=" + selectedTab + "&deviceName=" + name + "&deviceUID=" + duid;
}
my buttons are programed to access this this function like this:
onclick='javascript:gotoGeo("<%# DataBinder.Eval(Container.DataItems "Name")%>", <%# DataBinder.Eval(Container.DataItems "UID")%>)'
because the device name can consist of blank spaces I surrounded that parameter between a double quotes.
On the code behind, I have another set of data that I am binding to. and that information cannot be binded to the button controls. So, I binded the data to an invisble textfield and Now i would like to use it as an input parameter to either the control or the javafunction
Can anyone help?
I try to use the method bellow but does not work.
I first create a variable name named
var name;
and assign the value of the textbox to the name variable
name = document.getElementById('txtUsername').value;
I then used that variable as the first parameter
in the onclick button behavior.
<input type="button" value="View" onclick='javascript:gotoGeo('name', "<%# DataBinder.Eval(Container.DataItems "Name")%>", <%# DataBinder.Eval(Container.DataItems "UID")%>);'>
since I am new to this web development and javascripting stuff, I don't know if the implementation is correct.