ASP.NET - how to code modal popup window using asp.net  ASP.NET - how to code modal popup window using asp.net

Asked By SENTHIL NATHAN MURUGESAN
02-Feb-11 04:19 AM
how to code modal popup window using asp.net
  user 00009 replied to SENTHIL NATHAN MURUGESAN
02-Feb-11 04:24 AM
Hi SENTHIL NATHAN MURUGESAN ,


ModalPopupExtender works within the same window of web browser that popup on the fixed content of a page.
ModalPopup extender control disables the fixed content on the web page, places a layer on it and displays a
new web form with other interactive controls to get the user input.

Check the link given below.

%20http://programming.top54u.com/post/AJAX-ModalPopup-Control-Extender.aspx




I am ver much sure that this link will help you.

Thank you
  Reena Jain replied to SENTHIL NATHAN MURUGESAN
02-Feb-11 04:32 AM
hi,

Overview

The ModalPopup control in the AJAX Control Toolkit offers a simple way to create a modal popup using client-side means. However some scenarios require that the opening of the modal popup is triggered on the server-side.

Steps

First of all, an ASP.NET Button web control is required to demonstrate how the ModalPopup control works. Add such a button within the <form> element on a new page:

 

<asp:Button ID="ClientButton" runat="server" Text="Launch
 Modal Popup (Client)" />

 

Then, you need the markup for the popup you want to create. Define it as an <asp:Panel> control and make sure that it includes a Button control. The ModalPopup control offers the functionality to make such a button close the popup; otherwise there is no easy way to let it vanish.

 

<asp:Panel ID="ModalPanel" runat="server" Width="500px">
 ASP.NET AJAX is a free framework for quickly creating a new generation of more efficient,
 more interactive and highly-personalized Web experiences that work across all the
 most popular browsers.<br />
 <asp:Button ID="OKButton" runat="server" Text="Close" />
</asp:Panel>

 

Next add the ModalPopup control from the ASP.NET AJAX Toolkit to the page. Set properties for the button which loads the control, the button which makes it disappear, and the ID of the actual popup.

 

<ajaxToolkit:ModalPopupExtender ID="mpe" runat="server"
 TargetControlId="ClientButton" PopupControlID="ModalPanel" 
 OkControlID="OKButton" />

 

As with all web pages based on ASP.NET AJAX; the Script Manager is required to load the necessary JavaScript libraries for the different target browsers:

 

<asp:ScriptManager ID="asm" runat="server" />

 

Run the example in the browser. When you click on the button, the modal popup appears. In order to achieve the same effect using server-side code, a new button is required:

 

<asp:Button ID="ServerButton" runat="server" Text="Launch Modal Popup (Server)" 
 OnClick="ServerButton_Click" />

 

As you can see, a click on the button generates a postback and executes the ServerButton_Click() method on the server. In this method, a JavaScript function called launchModal() is executed to be exact, the JavaScript function will be executed once the page has been loaded:

 

<script runat="server">
 Sub ServerButton_Click(ByVal sender As Object, ByVal e As EventArgs)
 ClientScript.RegisterStartupScript(Me.GetType(), "key", "launchModal();", True)
 End Sub
</script>

 

The job of launchModal() is to display the ModalPopup. The launchModal() function is executed once the complete HTML page has been loaded. At that moment, however, the ASP.NET AJAX framework has not been fully loaded yet. Therefore, the launchModal() function just sets a variable that the ModalPopup control must be shown later on:

 

<script type="text/javascript">
 var launch = false;
 function launchModal() 
 {
 launch = true;
 }

 

The pageLoad() JavaScript function is a special function that gets executed once ASP.NET AJAX has been fully loaded. Therefore we add code to this function to show the ModalPopup control, but only if launchModal() has been called before:

 

 function pageLoad() 
 {
 if (launch) 
 {
 $find("mpe").show();
 }
 }
</script>

 

The $find() function is looking for a named element on the page and expects the server-side ID as a parameter. Therefore, $find("mpe") returns the client representation of the ModalPopup control; its show() method lets the popup appear.

http://static.asp.net/asp.net/images/ajax-control-toolkit/27/images/modalpopup1_vb_figure01.png

http://www.asp.net/ajax/tutorials/launching-a-modal-popup-window-from-server-code-vb

hope this will help you
  P Patel replied to SENTHIL NATHAN MURUGESAN
02-Feb-11 04:40 AM
Try jquery modal.

http://www.ericmmartin.com/projects/simplemodal/

here is example with code: http://beckelman.net/demos/jQueryModalConfirmTB/Default.aspx
  Anoop S replied to SENTHIL NATHAN MURUGESAN
02-Feb-11 04:49 AM
Refer this for step by step procedure for creation model popup dialog window in asp.net
http://www.codeproject.com/KB/aspnet/Modal_Dialog.aspx
http://www.c-sharpcorner.com/UploadFile/fvolking/ModalPopupInASP.NET11262005000152AM/ModalPopupInASP.NET.aspx
  Mihir Soni replied to SENTHIL NATHAN MURUGESAN
02-Feb-11 05:08 AM
Hello,

Here is simple example for modalpopup asp.net ajax I have just displayed some server side control in that modal popup

<form id="form1" runat="server">
<asp:scriptmanager id="1" runat="Server"></asp:scriptmanager>
   <div>
     <asp:HyperLink ID="link1" runat="Server" Text="popup" />
     <asp:Panel ID="popup" runat="server" Style="display: none;">
       <asp:Label ID="lbl1" runat="server" Text="First Name" />
       <asp:TextBox ID="fname" runat="server" />
     </asp:Panel>
   </div>
   <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="link1" PopupControlID="popup">
   </asp:ModalPopupExtender>
   </form>


Let me know if you want some more on this.


Create New Account
help
Ajax Slideshow problem Hi All, I have to pull the Images from File System and show it as a slideshow using Ajax. I have a gridview, that display several links. . on that particular Link. . i carry id me why slide show is not running. . . . . . ?? on ASPX Page: protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["Id"] ! = null) { uint Id = Convert.ToUInt16(Request.QueryString["Id"].ToString()); FillControls(Id); GetImages(Id); GetImage(Id); } ScriptManager.RegisterStartupScript(this, this.GetType(), "myScript1", "slideshow_automatic();", true); } public void GetImage(uint id) { Test ts = new Test WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] / / To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class Test : System.Web.Services WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] / / To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class Test : System
need a msg box in c# , Asp.net i m using the update panel. i wan to displya the msg in the screen with the Same id already exists');< / script> " ); but is in not working is there any control in ajax to do it or which is the alrenative way to do this task frist of show message box by using WebMsgBox WebMsgBox Class WebMsgBox class represents a message box for ASP.NET applications. This class has a static method Show, which is used to display a message queue = ((Queue)(handlerPages[HttpContext . Current . Handler])); queue . Enqueue(Message); } } private static void CurrentPageUnload( object sender, EventArgs e) { Queue queue = ((Queue)(handlerPages[HttpContext . Current . Handler])); if (queue ! = null ) { StringBuilder builder = new StringBuilder s client-side events, check out this link: http: / / www.telerik.com / community / forums / aspnet / ajax / ajax-manager-messagebox.aspx http: / / www.telerik.com / demos / aspnet / Ajax / Examples / Manager / ClientEvents / DefaultCS
Interview Questions for .NET Framework This article is specially for the users those are in development or want to be cant update the database from the recordset. ADO.NET the data adapter allows you to control how the changes to the dataset are transmitted to the database. On order to get in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging trace value in web.config file Enable trace enabled = true. If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-provided calendar control, how do you develop it? Do you copy and paste the code into each and
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP.NET sessions with classic ASP? (B) Which are the various modes of storing ASP.NET session