Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<div style="float: right;">
   <input type="text" placeholder="Serial No"  id="TxtSearch" runat="server"  />
   <asp:Button ID="BtnSearch" runat="server" Text="Search" CssClass="btn"
        Width="90px" onclick="BtnSearch_Click"/>
Posted

Hi,
This can be done by ModalPopUpExtender in AJAX.All u need to do is add a reference of ajax control tool kit to your application and keep AjaxControlToolKit.dll in bin folder.Register to your application in top.Like
HTML
<![CDATA[<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>]]>


In html body add

ASP.NET
<asp:textbox id="txtSearch" runat="server" xmlns:asp="#unknown"></asp:textbox>
        <asp:button id="btnSearch" runat="server" text="Button" xmlns:asp="#unknown">
            onclick="btnSearch_Click" />
<asp:modalpopupextender id="ModalPopupExtender1" cancelcontrolid="BtnClose" targetcontrolid="btnSearch" runat="server" popupcontrolid="modalpopup">
        </asp:modalpopupextender>
		<asp:panel id="modalpopup" style="display:none;font-family:Monotype Corsiva; background:yellow; height:100px;" runat="server">
     <%--   Bind your data to control--%>
            <asp:gridview id="GridView1" runat="server" autogeneratecolumns="false">
            <columns>
            <asp:templatefield headertext="Header1">
               <asp:label id="lbl1" runat="server" text="<%Eval("Databasefiled1") %>"></asp:label>
            </asp:templatefield>
            <asp:templatefield headertext="Header1">
               <asp:label id="lbl2" runat="server" text="<%Eval("Databasefiled2") %>"></asp:label>
            </asp:templatefield>
            <asp:templatefield headertext="Header1">
               <asp:label id="lbl3" runat="server" text="<%Eval("Databasefiled3") %>"></asp:label>
            </asp:templatefield>
            </columns>
         
            </asp:gridview>
            <asp:button id="BtnClose" runat="server" text="Ok" style="margin-left:176px;" />
            <asp:button id="Button2" runat="server" style="display: none;" />
        </asp:panel>
</asp:button>

In code behind
C#
protected void btnSearch_Click(object sender, EventArgs e)
   {
       //Bind your data from database using ado.net
       this.ModalPopupExtender1.Show();
   }
 
Share this answer
 
Comments
Member 10184990 11-Mar-14 2:57am    
How we get AjaxControlToolKit.dll
SanSkun 11-Mar-14 3:06am    
Download the appropriate AjaxControlToolKit.dll for your application from the bellow site

https://ajaxcontroltoolkit.codeplex.com/releases/view/43475
Aravindba 11-Mar-14 3:08am    
5+,
try to download Ajax Tool Kit form internet,google it and download,like Ajax Tool Kit for visual studio 2012,or 2012 ,mention which version u use,and follow how to install tool kit or just extract all files in C drive then open Visual Studio,in tool box right clike add new Tab with named(Ajax Tools) and again right click ajax tool tab and choose the AjaxControlToolkit.dll from which place u extract .

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