C# - Passing C# Variable to JavaScript -
i have following line of code in c#:
page.clientscript.registerstartupscript(page.gettype(), null, "window.open('http://localhost:4000/transaction_number.aspx?num=<%=trans_number%>', '_newtab')", true);
now, trans_number variable in c# code-behind. problem when process query string (num variable), result always:
<%trans_number%>
instead of contents of variable. how can solve this?
i think, can resolve pretty easily... maybe:
page.clientscript.registerstartupscript(page.gettype(), null, "window.open('http://localhost:4000/transaction_number.aspx?num=" + trans_number + "', '_newtab')", true);
Comments
Post a Comment