Dotnet, DotnetCore, Azure, C#,VB.net, Sql Server, WCF, MVC ,Linq, Javascript and React.js
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)
Find number of letter occurence of all letter in c#
Find number of letter occurence of all letter in c# namespace ConsoleApp1 { internal class Program { static void Main(st...
-
Alert Message in Window.Close in Jquery window.onbeforeunload = function(){ alert('You are closing the window'); } Unload...
-
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