Below is my code and it is not working for ModalPopupExtender
ModalPopupExtender window is not coming
I dont know what is wrong into this ?
can you please help me ?
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<Ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</Ajax:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView id="Gridview1"
runat="server" DataKeyNames="StudentID"
PageSize="30" EmptyDataText = "No Records Found" EmptyDataRowStyle-HorizontalAlign ="Center"
AllowPaging="true" DataSourceID = "SqlDataSource1"
HorizontalAlign="Center" BorderColor ="Black"
AllowSorting = "true" Visible= "true" AutoGenerateColumns= "false" >
<HeaderStyle BackColor="#DCDCDC" Font-Bold="true" ForeColor="Black" Font-Size = "Medium" Font-Names="Calibri" Wrap ="true" Height = "30" BorderColor ="Black" BorderStyle ="Groove" BorderWidth ="1.2" />
<RowStyle BackColor="AliceBlue" Font-Size = "Small" Font-Names="Calibri" />
<AlternatingRowStyle BackColor="White" Font-Size = "Small" Font-Names="Calibri"/>
<EmptyDataRowStyle Font-Size = "Small" ForeColor ="Black" Font-Bold ="true" HorizontalAlign = "Center" BackColor = "AliceBlue" />
<PagerStyle BackColor="#DCDCDC" ForeColor="Black" Font-Size="Large" />
<PagerSettings Position="Bottom" mode = "NumericFirstLast" LastPageText = "Last Page" />
<Columns>
<asp:BoundField DataField="School no" HeaderText="School" SortExpression = "School No" />
<asp:TemplateField HeaderText "StudentID">
<ItemTemplate >
<asp:LinkButton runat ="server" ID="LinkStudentID" Text='<%#Eval("StudentID") %>' OnClick ="LinkStudentID_Click" SortExpression="StudentID"> </asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Student Name" HeaderText="Student" SortExpression = "Student Name"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ appSettings:DCconnString %>"
SelectCommandType ="StoredProcedure" SelectCommand = "StudentPRoc" >
</asp:SqlDataSource>
<br />
<asp:Button runat="server" ID="btnModalPopUp" style="display:none"
/>
<Ajax:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID= "btnModalPopUp" PopupControlID ="ModalpopupPanel" OkControlID ="btnOK" X ="20" Y ="20" >
</Ajax:ModalPopupExtender>
<asp:Panel ID="ModalpopupPanel" runat="server" BackColor="Red">
Testing for modal pop up window
<asp:Button ID="ModalpopupButton" runat="server" Text="Close" />
</asp:Panel>
</asp:Content>
Protected Sub LinkStudentID_Click(ByVal sender As Object, ByVal e As EventArgs) 'Handles LinkStudentID.Click
Try
ModalPopupExtender1.Show()
Dim lnkStudentid As LinkButton = TryCast(sender, LinkButton)
Dim strstudentid As String = lnkStudentid.Text
Catch ex As Exception
End Try
End Sub