Hi
I've been playing with the demo's and really like the AJAX kit so will be buying it once I get paid for my current job, but whilst using the trial version I have come across an error with the RadTooltipManager and would appreciate some help if anyone is able to please.
Basically it works fine everywhere on the site, apart from the home page, but to make it more confusing it doesn't work when loaded via http://www.domain.com/ but it does work when I add default.aspx so http://www.domain.com/default.aspx
The error I get is:
RadToolTipManager response error:
Exception=Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 405
I've also attached a screenshot of the error.
My code is:
default.aspx
default.aspx.vb
I've just re-downloaded and re-installed the trial, to make sure it wasn't something to do with that.
Many thanks in advance.
Rich
I've been playing with the demo's and really like the AJAX kit so will be buying it once I get paid for my current job, but whilst using the trial version I have come across an error with the RadTooltipManager and would appreciate some help if anyone is able to please.
Basically it works fine everywhere on the site, apart from the home page, but to make it more confusing it doesn't work when loaded via http://www.domain.com/ but it does work when I add default.aspx so http://www.domain.com/default.aspx
The error I get is:
RadToolTipManager response error:
Exception=Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 405
I've also attached a screenshot of the error.
My code is:
default.aspx
<%@ Page Title="" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="true" CodeFile="default.aspx.vb" Inherits="_default3" EnableEventValidation="false" ViewStateEncryptionMode="Never" validaterequest="false" enableviewstatemac="false" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Src="~/ProductDetails.ascx" TagName="ProductDetails" TagPrefix="uc1" %>
<
asp:content
ID
=
"Content1"
ContentPlaceHolderID
=
"
Head
Content
"
Runat
=
"Server"
>
<
meta
name
=
"keywords"
content
=
"keys"
id
=
"keywords"
runat
=
"server"
/>
<
meta
name
=
"description"
content
=
"description"
id
=
"description"
runat
=
"server"
/>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"/skins/MyCustomSkin/ToolTip.MyCustomSkin.css"
/>
</
asp:content
>
<
asp:content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
Runat
=
"Server"
>
<
script
type
=
"text/javascript"
>
var combo = null;
function CloseActiveToolTip() {
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) tooltip.hide();
}
function OnClientHide(sender, args) {
if (combo) {
$find(combo.id).hideDropDown();
}
}
</
script
>
<
telerik:radscriptmanager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:radscriptmanager
>
<
telerik:radtooltipmanager
runat
=
"server"
ID
=
"RadToolTipManager1"
Position
=
"Center"
RelativeTo
=
"Element"
Width
=
"545px"
Height
=
"320px"
Animation
=
"Fade"
HideEvent
=
"LeaveTargetAndToolTip"
OnAjaxUpdate
=
"OnAjaxUpdate"
OnClientHide
=
"OnClientHide"
EnableShadow
=
"true"
EnableEmbeddedSkins
=
"false"
Skin
=
"Transparent"
RenderInPageRoot
=
"true"
AnimationDuration
=
"300"
enableajaxskinrendering
=
"True"
autoclosedelay
=
"60000"
>
</
telerik:radtooltipmanager
>
<
asp:datalist
id
=
"dlProducts"
runat
=
"server"
repeatcolumns
=
"3"
repeatdirection
=
"Horizontal"
repeatlayout
=
"Table"
cssclass
=
"productlist"
cellpadding
=
"0"
cellspacing
=
"0"
gridlines
=
"None"
borderstyle
=
"None"
datakeyfield
=
"ProductID"
>
<
itemtemplate
><
div
id
=
"smallImage"
class
=
"productlistitems"
runat
=
"server"
><%# BoxDetails(Container.DataItem)%></
div
></
itemtemplate
>
</
asp:datalist
>
<
asp:label
id
=
"lblText"
runat
=
"server"
/>
</
asp:content
>
default.aspx.vb
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Drawing
Imports System.IO
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Partial Class _default3
Inherits System.Web.UI.Page
Public Function BoxDetails(ByVal DataItem As Object) As String
Dim MyConnection As SqlConnection
MyConnection = New SqlConnection()
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim myTxt As String = ""
If DataItem("TypeID").Equals(1) Then
If Not DataItem("title").Trim().Equals("") Then
myTxt = "<
a
class
=
""
basic""
href
=
""
" & DataItem("url").Trim() & """><
img
src
=
""
/images/home/tn/" & DataItem("filename").Trim() & """
alt
=
""
" & DataItem("title").Trim() & """
title
=
""
" & DataItem("title").Trim() & """ /></
a
><
div
class
=
""
productlisttitles""><
a
href
=
""
" & DataItem("url").Trim() & """>" & DataItem("title").Trim() & "</
a
></
div
>"
Else
myTxt = "<
a
class
=
""
basic""
href
=
""
" & DataItem("url").Trim() & """><
img
src
=
""
/images/home/tn/" & DataItem("filename").Trim() & """
alt
=
""
" & DataItem("title").Trim() & """
title
=
""
" & DataItem("title").Trim() & """ /></
a
>"
End If
End If
If DataItem("TypeID").Equals(2) Then
Dim strID As Integer = DataItem("ProductID")
Dim sql As String = "SELECT ProductID, ProductName, price, url, " _
& "(SELECT ImageFileName FROM ProductImages WHERE ProductID = Products.ProductID AND tn = 1) As Img1 " _
& "FROM Products WHERE ProductID = @id"
Dim objDR As SqlDataReader
Dim CmdR As New SqlCommand(sql, MyConnection)
With CmdR.Parameters
.Add(New SqlParameter("@id", strID))
End With
MyConnection.Open()
objDR = CmdR.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
While objDR.Read()
myTxt = "<
a
class
=
""
basic""
href
=
""
/product/" & objDR("url").Trim() & """><
img
src
=
""
/images/products/mid/" & objDR("img1").Trim() & """
alt
=
""
" & objDR("ProductName").Trim() & """
class
=
""
noborder"" /></
a
><
div
class
=
""
productlisttitles""><
a
class
=
""
basic""
href
=
""
/product/" & objDR("url").Trim() & """>" & objDR("ProductName").Trim() & "</
a
><
br
/>£" & Decimal.Round(CDec(objDR("Price")), 2) & "</
div
>"
End While
MyConnection.Close()
End If
If DataItem("TypeID").Equals(3) Then
myTxt = "<
div
class
=
""
text255items"">" & DataItem("text").Trim() & "</
div
>"
'myTxt = DataItem("text").Trim()
End If
Return myTxt
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
RadToolTipManager1.TargetControls.Clear()
'RadToolTipManager1.UpdatePanel.ClientIDMode = System.Web.UI.ClientIDMode.AutoID
If Not Page.IsPostBack Then
BindData()
End If
End Sub
Private Sub BindData()
Dim body As HtmlGenericControl = DirectCast(Page.Master.FindControl("bodyTag"), HtmlGenericControl)
body.Attributes.Add("class", "Home")
Dim MyConnection As SqlConnection
MyConnection = New SqlConnection()
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim sql As String = "SELECT * FROM CONTENT_PAGES WHERE PageID = 1"
Dim objDR As SqlDataReader
Dim CmdR As New SqlCommand(sql, MyConnection)
MyConnection.Open()
objDR = CmdR.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
While objDR.Read()
Page.Title = Replace(objDR("PageTitleTag").Trim(), "&", "and")
keywords.Attributes("content") = Replace(objDR("PageKeywords").Trim(), "&", "and")
description.Attributes("content") = Replace(objDR("PageDesc").Trim(), "&", "and")
'lblTitle.Text = Replace(objDR("PageTitle").Trim(), "&", "and")
Dim strText As String = objDR("PageText").Trim()
If strText.StartsWith("<
p
>") Then
lblText.Text = "</
span
>" & objDR("PageText").Trim() & "<
span
>"
Else
lblText.Text = "</
span
><
p
>" & objDR("PageText").Trim() & "</
p
><
span
>"
End If
End While
MyConnection.Close()
Dim sql3 As String = "SELECT * FROM HOME_SELECTIONS"
Dim resultsDataSet3 As New DataSet()
Dim myDataAdapter3 As SqlDataAdapter = New SqlDataAdapter(sql3, MyConnection)
myDataAdapter3.Fill(resultsDataSet3, "title_meta")
dlProducts.DataSource = resultsDataSet3
dlProducts.DataBind()
End Sub
Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs)
Me.UpdateToolTip(args.Value, args.UpdatePanel)
End Sub
Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
Dim ctrl As Control = Page.LoadControl("~/ProductDetails.ascx")
panel.ContentTemplateContainer.Controls.Add(ctrl)
Dim details As ProductDetails = DirectCast(ctrl, ProductDetails)
details.ProductID = elementID
End Sub
Protected Sub ListBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
dlProducts.DataBind()
End Sub
Protected Sub dlProducts_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlProducts.ItemDataBound
Dim image As Control = e.Item.FindControl("smallImage")
Dim currentRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
'Add the image id to the tooltip manager
If Not currentRow.Row("ProductID").ToString() = 0 Then
Me.RadToolTipManager1.TargetControls.Add(image.ClientID, currentRow.Row("ProductID").ToString(), True)
End If
End Sub
End Class
I've just re-downloaded and re-installed the trial, to make sure it wasn't something to do with that.
Many thanks in advance.
Rich