Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a gridview ,inside the item template of grid i have a modal popup extender , how to access the modal popup extender in code.i.e i m unable to create object of modal popup extender
Posted
Updated 29-Jul-12 22:06pm
v2
Comments
pradiprenushe 30-Jul-12 4:07am    
Can you paste your source code for gridview?
Himu from Orissa 30-Jul-12 4:52am    
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
<columns>
<asp:TemplateField ItemStyle-Width="250">
<itemtemplate>
<asp:Panel ID="Panel2" runat="server"
Style="background-color: #DDDDDD;border: solid 1px Gray; color: Black">
<asp:Button ID="btnOk" runat="server" Text="OK">
<asp:Button ID="btnCancel" runat="server" Text="Cancel">

<asp:ModalPopupExtender ID="ModalPopupExtender1"
TargetControlID="lblPostId"
PopupControlID="Panel2"
OkControlID="btnOk"
CancelControlID="btnCancel"
BackgroundCssClass="modalBackground"
runat="server">




pradiprenushe 30-Jul-12 5:41am    
You are trying to create object in rowdatabound/rowcommand right?
This is not the complete code ...

Take a look at GridView with a single ModalPopupExtender/Panel for row editing[^].

Download the code and see how easily he has accessed the "ModalPopupExtender" in code behind.
And don't forget to use "ajaxToolKit".
Thanks.
 
Share this answer
 
Use this
AjaxControlToolkit.ModalPopupExtender objModel = new AjaxControlToolkit.ModalPopupExtender();


AjaxControlToolkit Is assembly name.
You can see this name in your page in register tag Where reference for ajax is present.
 
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