Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,

I need to pass database column value as a parameter of Javascript function. Please show me how. I tried this which didn't work.

C#
function Time_type(<%# Eval( "INDICATOR" ) %>,<%# Eval( "TYPE_SEQ" ) %>){
  var url;
if (<%# Eval( "INDICATOR" ) %> == 'O'){
url= www.something.com/<%# Eval( "TYPE_SEQ" ) %>?;
}
}
Posted
Comments
DamithSL 12-Jun-14 22:07pm    
need more details. tag the question with ASP.NET, MVC what ever applicable.
which controls you have used and where you want to place this piece of java script and what you wanted to do?

1 solution

I would suggest you to have these values stored in some Label or HiddenField. Then while calling the function, pass the Label or HiddenField Text.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900