Dotnet, DotnetCore, Azure, C#,VB.net, Sql Server, WCF, MVC ,Linq, Javascript and Jquery
17 May 2012
Calling Javascript from Server side of the code in Asp.net
Calling Javascript from Server side of the code in Asp.net
Methods:
1. Page.ClientScript.RegisterStartupScript( me.gettype(), "PopupScript", alertScript );
Asynchronous Postback:[If Ajax used in the page]
2. ScriptManager.RegisterStartupScript(this, GetType(), "YourUniqueScriptKey",
"alert('This pops up');", true);
Parameters
page
Type: System.Web.UI.Page
The page object that is registering the client script block.
type
Type: System.Type
The type of the client script block. This parameter is usually specified by using the typeof operator (C#) or the GetType operator (Visual Basic) to retrieve the type of the control that is registering the script.
key
Type: System.String
A unique identifier for the script block.
script
Type: System.String
The script.
addScriptTags
Type: System.Boolean
true to enclose the script block with < scrip t> and < / script > tags; otherwise, false.
Subscribe to:
Post Comments (Atom)
Implementing OAuth validation in a Web API
I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...
-
ViewBag, ViewData, TempData and View State in MVC ASP.NET MVC offers us three options ViewData, ViewBag and TempData for passing data from...
-
// Export Datatable to Excel in C# Windows application using System; using System.Data; using System.IO; using System.Windows.Forms; ...
No comments:
Post a Comment
Comments Welcome