Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I see some links about modalpopupextender but I am not understand clearly. just copy the code and run but I am not getting output..

Default.aspx file

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <ajaxToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server"

TargetControlID="lnkPopup"

PopupControlID="panEdit"

BackgroundCssClass="modalBackground"

CancelControlID="btnCancel"

PopupDragHandleControlID="panEdit">

</ajaxToolkit:ModalPopupExtender>



<asp:PanelID="panEdit"runat="server"Height="180px"Width="400px"CssClass="ModalWindow">

        <h1>Edit/h1>

        <table width="100%">

            <tr>

                <td class="formtext" style="height: 23px; width: 150px;" align="left">

                    Fields1:

                </td>

                <td>

                    <asp:TextBox ID="txtFields1" runat="server"></asp:TextBox>

                </td>

            </tr>

       </table>

       <br />

       <asp:Button ID="Button1" runat="server" Text="Update" OnClick="btnUpdate_Click"/>

       <asp:Button ID="btnCancel" runat="server" Text="Cancel" />

</asp:Panel>

<a id="lnkPopup" runat="server">Show Popup</a>

    </div>
    </form>
</body>
</html>







style1.css file


CSS
.modalBackground

{

  background-color:#CCCCFF;

  filter:alpha(opacity=40);

  opacity:0.5;

}






.ModalWindow

{

  border: solid1px#c0c0c0;

  background:#f0f0f0;

  padding: 0px10px10px10px;

  position:absolute;

  top:-1000px;

}





please verify it,and inform where I a made mistake
Posted

are you Registed?


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>


add Script manager also
 
Share this answer
 
v2
Comments
Unareshraju 6-Aug-12 4:44am    
you are right abhiram.
you have not added the "script manager". The script manager is mandatory to use any of the ajax controls. The AjaxContolToolKit library may not has registered with the page. Ajax Tool kIt may has not installed in your machine.

follow these steps--

--> Install Ajax Tool Kit
--> Reset your Visual Studio Tool Box
--> Add new tab in your tool box and name it as Ajax Extensions
--> Right click on your new tab - Click Choose Items
--> Browse your downloaded "AjaxControlToolKit.dll"
--> verify the selected controls
--> Click Ok

Now your new tab in tool box will be filled with ajax controls

Now first drag and drop "ScriptManager" in to your page source.

check the below line has added in your page at the top:

HTML
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


From now you can add any ajax controls..

Hope this helps..
 
Share this answer
 
Download AjaxControlToolKit.
Add reference of AjaxControlToolKit from solution explorer.
you should add ScriptManager from ToolBox under AjaxExtensions
after form tag.
and use this
C#
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication8._Default" %>
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
 
Share this answer
 
v2
You need to download and install ajax control toolkit library first before doing this so.

Here is the link where you can download it.
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/[^]

Then drag the .dll file into your toolbox or add it as reference. Put the respective directive then drag drop of the toolkit.

Then after that, do the copy paste and im sure it will work :)

Regards,
Eduard
 
Share this answer
 
 
Share this answer
 
hii,
1) you need to install ajax control toolkit
2) register it on page using

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

3) add this line in head tag
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900