Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I have a datalist control which has button. When i click the button in the datalist control there should be modal popup. It can be Modalpopupextender using Ajax.
Can anyone help me.









Regards
Froxy
Posted

 
Share this answer
 
Comments
froxy 10-Jun-11 8:34am    
I want the sample for datalist.
Here Is One Solution..

protected void Button1_Click(object sender, EventArgs e)
{
    ModalPopupExtender1.Show();
}


Check Out This...
 
Share this answer
 
v2
Comments
froxy 10-Jun-11 8:37am    
Can you give me the complete sample
Prasad CM 10-Jun-11 8:42am    
K Wait... I will Add it in Another Solution
Prasad CM 10-Jun-11 8:52am    
Solution 3 Will Work For Both
LinkButton and Button(through code)
<asp:panel id="Panel1" runat="server" height="300px" width="500px" xmlns:asp="#unknown">
  style="background-color: #CC33FF"  >
     <asp:panel id="Panel2" runat="server" height="30px" width="500px">
           style="background-color: #3399FF; cursor:move" >
     

     <asp:button id="btn_Ok" runat="server" text="Ok" />
     <asp:button id="btn_Cancel" runat="server" text="Cancel" />

<asp:modalpopupextender id="ModalPopupExtender1" xmlns:asp="#unknown">
      runat="server"             
      TargetControlID="LinkButton1" 
      PopupControlID="Panel1" 
      PopupDragHandleControlID="Panel2"
      OkControlID="btn_Ok"
      CancelControlID="btn_Cancel" 
      DropShadow="true">

<br />
        
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton
<br />
<asp:button id="Button1" runat="server" text="Button1" onclick="Button1_Click" />

protected void Button1_Click(object sender, EventArgs e)
{
    ModalPopupExtender1.Show();
}
 
Share this answer
 
v4
Comments
froxy 10-Jun-11 9:44am    
<asp:DataList ID="DataList2" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
Width="590px" RepeatLayout="Flow">
<itemtemplate>
<div class="content_inner floatLeft">
<div class="box-content floatLeft">
<div class="inside floatLeft">
<div class="list_box_batch_schedule floatLeft">
<div class="list_box_des_batch_schedule floatLeft">
<div>
<div>
Duration:
<%# DataBinder.Eval(Container.DataItem,"StartDate")%>
to
<%# DataBinder.Eval(Container.DataItem,"EndDate")%>
</div>
<div>
Teacher Interaction Schedule:
<%# DataBinder.Eval(Container.DataItem, "InteractionHours")%>
hrs/Week for 3 Weeks
</div>
<table border="1">
<tr>
<td>
Mon
</td>
<td>
Tue
</td>
<td>
Wed
</td>
<td>
Thu
</td>
<td>
Fri
</td>
<td>
Sat

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