nhu_twwshh
06-28-2004, 08:45 AM
Hi, all
I'm new in ASP.Net. I have a web page (frmInvoice.aspx) with a disabled text box to displat product code. Next to text box, I have a command button to choose more... When I click on this button, It opens a pop up window (frmProductList.aspx) , list all products (using datagrid). Then when user click on product code hyperlink, it returns this value to text box of parent form.
*** frmInvoice.aspx
function returnProductCode(productCD)
{
document.frmInvoice.txtProductCD.value = productCD
}
<asp:textbox id="txtProductCD" tabIndex="6" runat="server" Enabled="False" Width="160px"></asp:textbox>
*** frmProductList.aspx
<SCRIPT language="javascript">
function ReturnCode(strCode)
{
window.opener.returnProductCode(strCode)
window.close();
}
</SCRIPT>
<asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Product_CD") %>' NavigateURL ='<%# DataBinder.Eval(Container, "DataItem.Product_CD") %>' OnClick="ReturnCode('I want to return to product code of selected row');" ID="txtProduct" NAME="txtProduct">
As you see, I want to return product code in ReturnCode function
OnClick="ReturnCode('<%# DataBinder.Eval(Container, "DataItem.Product_CD") %>');"
However, this statement cause an error.
Pls help me!!! Help me.
Thanks a lot.
nhu
I'm new in ASP.Net. I have a web page (frmInvoice.aspx) with a disabled text box to displat product code. Next to text box, I have a command button to choose more... When I click on this button, It opens a pop up window (frmProductList.aspx) , list all products (using datagrid). Then when user click on product code hyperlink, it returns this value to text box of parent form.
*** frmInvoice.aspx
function returnProductCode(productCD)
{
document.frmInvoice.txtProductCD.value = productCD
}
<asp:textbox id="txtProductCD" tabIndex="6" runat="server" Enabled="False" Width="160px"></asp:textbox>
*** frmProductList.aspx
<SCRIPT language="javascript">
function ReturnCode(strCode)
{
window.opener.returnProductCode(strCode)
window.close();
}
</SCRIPT>
<asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Product_CD") %>' NavigateURL ='<%# DataBinder.Eval(Container, "DataItem.Product_CD") %>' OnClick="ReturnCode('I want to return to product code of selected row');" ID="txtProduct" NAME="txtProduct">
As you see, I want to return product code in ReturnCode function
OnClick="ReturnCode('<%# DataBinder.Eval(Container, "DataItem.Product_CD") %>');"
However, this statement cause an error.
Pls help me!!! Help me.
Thanks a lot.
nhu