Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Learning to use JavaScript with ASP.Net
Message
De
21/05/2009 10:16:23
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
Application:
Web
Divers
Thread ID:
01400821
Message ID:
01401286
Vues:
35
Thanks Paul!

>>The fourth parameter according to MSDN is a value indicating whether to add script tags which I presume needs to be true since they are not included in the csScript string. What causes this script to run when the page is re-loaded?
>
>Yes, it needs to be true. The first example I showed I actually embedded the reqd. javascript tag in the string. In the second I removed that and just set the fourth parameter. The browser evaluates any of the Javascript in the HTML page as it's loaded. This is just a direct function call (that is, it's not inside of a function { }), so it will evaluate it and run your code for you. You can see this work if you did this:
>
>Page.ClientScript.RegisterClientScriptBlock(csType, csName, "alert('Here');", true);
>
>It will pop up the alert box during the page load.
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform