Skip to main content

JAVASCRIPT ALERT ON CLASS PAGE



----------------.aspx--------------
JAVASCRIPT FUNCTION
function alertClick(Details)
{
alert(Details)
return false;
}
.CS    
string alert = "Enter Atleast One Debit Type and One Credit Type Ledger";
RegisterClientScriptBlock("gridcount", "<script Language='javascript'>window.onload = function(){return alertClick('" + alert + "');}</script>");
return;

 ---------------- OR

protected void Page_Load(object sender, EventArgs e)

{

  string message = "Hello! Mudassar.";

  System.Text.StringBuilder sb = new System.Text.StringBuilder();

  sb.Append("<script type = 'text/javascript'>");

  sb.Append("window.onload=function(){");

  sb.Append("alert('");

  sb.Append(message);

  sb.Append("')};");

  sb.Append("</script>");

  ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());

}
 

Comments

Popular posts from this blog

JQuery lightbox image slideshow gallery in asp.net

Introduction: In this article I will explain how to create lightbox image slideshow in asp.net using JQuery. Description:  In previous post I explained about  Ajax SlideshowExtender sample  to display images slideshow. Now in this article I will explain how to create lightbox image slideshow in asp.net using JQuery. In many websites generally we will see different types of slideshows like whenever we click on image that is automatically open with lightbox effect and we have a chance to see all the remaining images by press next or previous options in slideshow. All these Slideshows are implemented by using JQuery plugins. After seen those slideshows I decided to write post to use JQuery plugins to implement beautiful slideshown in asp.net.  To implement this one I am using  previous post  insert and display images from folder based on imagepath in database  because in that post I explained clearly how to insert images into our project folder a...

Scrollable GridView with Fixed Headers using jQuery Plugin

Using the same example I have created a jQuery Plugin for Scrollable GridView with Fixed header so that you can directly make a GridView scrollable.   HTML Markup < form   id ="form1"   runat ="server"> < asp : GridView   ID ="GridView1"   runat ="server"   AutoGenerateColumns   =   "false"> < Columns > < asp : BoundField   DataField   =   "ContactName"   HeaderText   =   "Contact Name"   /> < asp : BoundField   DataField   =   "City"   HeaderText   =   "City"   /> < asp : BoundField   DataField   =   "Country"   HeaderText   =   "Country"   /> Columns > asp : GridView > form >   Applying the Scrollable Grid jQuery Plugin < script   src ="Scripts/jquery-1.4.1.min.js"   type ="text/javascript"> script > < script   src ="Scripts/Scro...

SSRF CONFIGURTION

If this is your first time creating an SSRS report, then this is the right article for you. Below is a step-by-step guide that will help you to create, deploy and view your first report using SQL Server Reporting Services 2008: Environment Check Assuming the following are installed and already configured on your machine: Installed SQL Server 2008 R2 Installed AdventureWork Sample Databases (You can visit Microsoft website to download and install it: http://msftdbprodsamples.codeplex.com/releases/view/55926 We are using it in this case as a sample database. However, you can write any SQL statement on one of your pre-installed Databases) Installed SQL Server 2008 Reporting Services (If you have not done this, visit this post: SSRS 2008 Installation Guide ) Both SQL Server and Reporting Services are installed on the same machine (localhost) Now we can start the guide walk-through: 1. Open SQL Server Business Intelligence Development Studio ...