Hi,
I have used popup control extender (Ajax tool kit 1.0) in user control. I want to get the data using the popup control extender from database.
I have used the same process in aspx page its working perfectly. But, User control can shows an error.
Error rendering control - update panel.
An unhandled exception has occured
The control with ID 'Poppuexe' requires a scriptManager on the page.
The codes in ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="UserControl.ascx.vb"
Inherits="Controls_UserControl" %>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="LinkButton1" runat="server" Text="Click"></asp:Label>
<ajaxToolkit:PopupControlExtender ID="PoppuExe" runat="server" DynamicContextKey='<%# Eval("PropertyId") %>'
DynamicServiceMethod="callfun" TargetControlID="LinkButton1" DynamicControlID="Panel1"
PopupControlID="Panel1" Position="Bottom">
</ajaxToolkit:PopupControlExtender>
<asp:Panel ID="Panel1" runat="server" Width="250px">
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
ascx.vb
Imports AjaxControlToolkit
'Imports AgentFacade
Imports System
Imports System.Data
Imports System.Collections
Imports System.Data.SqlClient
Imports HSSPMS.BusinessFacade
Imports System.IO
Partial Class Controls_UserControl
Inherits System.Web.UI.UserControl
Shared dtContactLst As New DataSet
Shared objCustMstr As New CustomerFacade
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim PropertyId As String = "TN8564565"
Dim pce6 As PopupControlExtender = TryCast(Me.FindControl("PoppuExe"), PopupControlExtender)
' Set the BehaviorID6
Dim behaviorID6 As String = String.Concat("pce6", 0)
pce6.BehaviorID = behaviorID6
Dim OnMouseOverScript6 As String = String.Format("$find('{0}').showPopup();", behaviorID6)
Dim OnMouseOutScript6 As String = String.Format("$find('{0}').hidePopup();", behaviorID6)
LinkButton1.Attributes.Add("onmouseover", OnMouseOverScript6)
LinkButton1.Attributes.Add("onmouseout", OnMouseOutScript6)
'LinkButton1.Text = "CheckUS"
End Sub
Public Shared Function ContactList(ByVal dsContact As DataSet)
Dim strTemp As New StringBuilder()
If dsContact.Tables(0).Rows.Count > 0 Then
strTemp.Append("<table>")
strTemp.Append("<tr><td><b>Contact Info:</b></td></tr>")
Dim dr As DataRow
For Each dr In dsContact.Tables(0).Rows
strTemp.Append("<tr><td>E-Mail : " & dr.Item(1).ToString() & "</td></tr>")
strTemp.Append("<tr><td>Tel No : " & dr.Item(2).ToString() & "</td></tr>")
strTemp.Append("<tr><td>Fax No: " & dr.Item(3).ToString() & "</td></tr>")
Next
strTemp.Append("</table>")
Else
strTemp.Append("<table>")
strTemp.Append("<tr><td><b>My Contact Info.</b></td></tr>")
strTemp.Append("</table>")
End If
Return strTemp.ToString()
End Function
<System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()> _
Public Shared Function callfun(ByVal contextKey As String) As String
dtContactLst = objCustMstr.GetLandlordReviewContactListInfo("LL564547", "TN8564565")
Return ContactList(dtContactLst)
End Function
End Class
Any one can help me.
subbiee.