C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to use Model Popup Extender


Posted Date: 05 Jun 2008    Resource Type: Code Snippets    Category: AJAX
Author: MuthukrishnanMember Level: Gold    
Rating: Points: 15



The following code shows how to use Model Popup Extender


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtoolkit" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<%-- <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>--%>
<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
<asp:LinkButton runat="server" ID="showModalPopupServerOperatorButton" Text="show"
OnClick="showModalPopupServerOperatorButton_Click" />
<ajaxtoolkit:ModalPopupExtender runat="server" ID="programmaticModalPopup" BehaviorID="programmaticModalPopupBehavior"
TargetControlID="hiddenTargetControlForModalPopup" PopupControlID="programmaticPopup"
BackgroundCssClass="modalBackground" DropShadow="True" RepositionMode="RepositionOnWindowScroll">
</ajaxtoolkit:ModalPopupExtender>
<asp:Panel runat="server" CssClass="modalPopup" ID="programmaticPopup" Style="display: none;
width: 350px; padding: 10px">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
<%-- <asp:LinkButton runat="server" ID="hideModalPopupViaServer" Text="close" OnClick="hideModalPopupViaServer_Click" />--%>
</asp:Panel>
</div>
</form>
</body>
</html>




using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void showModalPopupServerOperatorButton_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox2.Text;
this.programmaticModalPopup.Show();
}
protected void hideModalPopupViaServer_Click(object sender, EventArgs e)
{
this.programmaticModalPopup.Hide();
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
}

}




Responses

Author: Kapil Dhawan    17 Jun 2008Member Level: Gold   Points : 2
Hello
Nice piece of code
Thanks for sharing your knowledge with us.
I hope to see more good code from your side
This code is going to help lots of guys.
Ton Thanks to you
Regards,
Kapil



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Model Popup Extender  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Hover Menu Control + GridView
Previous Resource: Expand panel
Return to Discussion Resource Index
Post New Resource
Category: AJAX


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use