Hello,

I have a script written in C# (.NET) and within this script I have an IF statement and when this IF statement is TRUE I want to execute the following external script that I placed just under the </head>:

<script id='name' type='text/javascript' src='https://xx' integration='jscart-wizard'></script>

How can I do that?


Thank you in Advance

Exactly as you described. Although asp.net is probably best asked in its forum

Exactly as you described. Although asp.net is probably best asked in its forum

Hi,
the external script won't execute unless I press a related button.. I would like that script to execute automatically if my IF statement is true.

I will pass this question to asp.net forum if I can't get an answer here.

Thanks again

Well, thats what an "OnClick" event is for :)

but the onClick event is for executing a code when a button is clicked right? Sorry I'm kind of a newbie here..

I don't want to manually press a button at all.. I just want to execute the external script that my button would eitherwise do if I manually pressed it but I want to do this automatically.. by calling the button to get executed from my C# code

thanks again

Then you're going round in circles and the button shouldnt be there..

if stuff true, <script>

its that simple, as you said in the beginning