Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,
I have a javascript which returns true or false based on condition
i am code behind
ClientScript.RegisterStartupScript(typeof(Page), "starScript", "function()", true);

i want if it returns true thne it should come back to code else false.

Any suggestion
Posted
Comments
bbirajdar 30-Oct-12 5:43am    
How do you expect javascript to run on server side? Its a client side scripting language ...

1 solution

Hi,

ur third parameter is wrong... it should be the script..

for ex.
<script>
//ur function here
function DoClick()
{
alert('hi');
}
</script>

u may assign this to a string variable and use it as a third parameter.

then call that function.
ex.
<input type="button" value="ClickMe" önclick="DoClick()" />

if u have any clarifications, reply to this...
mark it if u find this useful....
 
Share this answer
 
v2

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