aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Show jQuery Modal Popup from Code behind (Server Side)

May 5, 2014

Here I will explain how to show
jQuery ui modal popup from code behind or open jQuery modal popup from server side in using c#,

In previous articles I explained Show alert message from code behind, jQuery show alert message while leaving from website,
jQuery enable / disable controls on page, jQuery Countdown timer script example, jQuery Increase or Decrease font size of website and many articles relating to JQuery and Now I will explain how to show jQuery ui modal popup from code behind or from server side in using c#,

To show modal popup from code behind we need to write the code like as shown below

<html xmlns="">
<title>jQuery Show Modal Popup from code behind or server side</title>
<link type="text/css" rel="stylesheet" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
function showmodalpopup() {
title: "jQuery Popup from Server Side",
width: 430,
height: 250,
modal: true,
buttons: {
Close: function () {
<form id="form1" runat="server">
<div id="popupdiv" title="Basic modal dialog" style="display: none">
<b> Welcome to</b>
<asp:Button ID="btnShowModal" runat="server" Text="Show Popup" OnClick="btnShowModal_Click" />
In code behind we need to write the code like as shown below

C# Code

protected void btnShowModal_Click(object sender, EventArgs e)
ScriptManager.RegisterStartupScript(this, GetType(), "Show Modal Popup", "showmodalpopup();", true);

Protected Sub btnShowModal_Click(ByVal sender As Object, ByVal e As EventArgs)
ScriptManager.RegisterStartupScript(Me, [GetType](), "Show Modal Popup", "showmodalpopup();", True)
End Sub

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...


Anonymous said...


Tlungvel Vengthar KTP said...

Can you show this modal based on query result

Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.