Friday, 16 December 2011

Asp.net POP UP by C#

Possibly there are three way to generate simple pop up

Basicaly This Article Is About How You Can Generate Asp.net POP UP by Using Server Side Codeing in C#
(other than ajax ,javascript)


 1)SIMPLE POP UP FOR C#
ClientScript.RegisterStartupScript(Page,GetType(), "urowntext","alert('alert');", true);





2)IF POP UP NOT WORKING IN AJAX UPDATE PANEL


lets take 'up' as your update panel name then

 closewindow = "alert('Rue No defined for the selected item.To redefine  delete from main grid.');";
 ScriptManager.RegisterStartupScript(this.up, this.up.GetType(), "closewindow", closewindow, true); 


3)BY REFERENCE OF WINDOW ASSEMBLY


follow the procedure like first right click on your project





Now click on Add Reference
And A Window Will Come In Front Of You


Select System.Window.Forms from .NET tab as shown above




Now you can try below Example to get pop up of your need
by First Adding this namespace on your form
Using System.Windows.Forms;


     // The simplest overload of MessageBox.Show. [1]
     //
     MessageBox.Show("Dot Net Perls is awesome.");
     //
     // Dialog box with text and a title. [2]
     //
     MessageBox.Show("Dot Net Perls is awesome.",
  "Important Message");
     //
     // Dialog box with two buttons: yes and no. [3]
     //
    MessageBox.Show("Is Dot Net Perls awesome?",
  "Important Question",
  MessageBoxButtons.YesNo);
     //
     // Dialog box with question icon. [4]
     //
     MessageBox.Show("Is Dot Net Perls awesome?",
  "Important Query",
  MessageBoxButtons.YesNoCancel,
  MessageBoxIcon.Question);
     //
     // Dialog box with question icon and default button. [5]
     //
      MessageBox.Show("Is Visual Basic awesome?",
  "The Question",
  MessageBoxButtons.YesNoCancel,
  MessageBoxIcon.Question,
  MessageBoxDefaultButton.Button2);



1 comment:

Print Only Grid View in ASP.net

ASP.net How to Print Only GridView < div id ="gridviewDiv" >   < asp:GridView ID ="gridViewToPri...