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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -