This is a migrated thread and some comments may be shown as answers.

Tooltip userControl

4 Answers 140 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
avarndel
Top achievements
Rank 1
avarndel asked on 25 Jul 2008, 04:51 PM
My User Control for my tooltip is not binding to the Datasource control and it displays the information twice in the user Control.

WHat am I doing wrong?

UserControl ascx
<%@ Control Language="VB" AutoEventWireup="True" CodeFile="StaffProfile.ascx.vb"  Inherits="UserControls_StaffProfile" %>
    <link href="~/Css/Tooltip.css" rel="stylesheet" type="text/css" />
<asp:FormView ID="StaffView" DataSourceID="sdsStaffProfile"  runat="server" DataKeyNames="UserID">

      <ItemTemplate>
        <fieldset class="tooltipStaff">
            <div class="tooltipHeader">Name:  <%#Eval("UserName")%></div>
            <div class="tooltipText">Title: <%#Eval("Title")%></div>
            <div class="tooltipText">Ext: <%#Eval("Ext")%></div>                       
            <div class="tooltipText"><asp:Label ID="Label2" runat="server" Text="sample"><%#Eval("Office")%></asp:Label>  
                <br />     
                Office2:  <%#Eval("Office")%></div>     
            <div class="tooltipText">Office Phone:  <%#Eval("OfficePhone")%> </div>     
            <div class="tooltipText">Cost Center:  <%#Eval("CostCenter")%></div>     
             <div class="tooltipText">Supervisor:  <%#Eval("Supervisor")%></div>    
         </fieldset>
    </ItemTemplate>
    </asp:FormView>
    <asp:Button ID="btnStaffProfile" runat="server" Text="Open" CausesValidation="False" />
<asp:SqlDataSource ID="sdsStaffProfile" runat="server"
    ConnectionString="<%$ ConnectionStrings:AppConnectionString %>"
    SelectCommand="proc_xUserProfileStaffProfileView" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:SessionParameter Name="UserID" SessionField="UserID" Type="Int64" />
    </SelectParameters>
</asp:SqlDataSource>
 


UserControl.ascx.vb
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports Telerik.Web.UI
Partial Class UserControls_StaffProfile
    Inherits System.Web.UI.UserControl
    Dim UserID As Integer
    Private Sub ConfigureView()
        Me.sdsStaffProfile.SelectParameters("UserID").DefaultValue = CType(Me.UserID, Integer)
        Me.StaffView.DataBind()
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        UserID = CType(Session("UserID"), Integer)
        ConfigureView()
    End Sub
      Protected Sub btnStaffProfile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStaffProfile.Click
        Response.Redirect("~/Staff/StaffProfile.aspx?UID=" + CType(UserID, String))
    End Sub
End Class



4 Answers, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 28 Jul 2008, 02:14 PM
Hi Annete,

I tried to create a sample project based on the code you have sent us, however, I was not able to reproduce the issue you describe. Please, find attached a sample project which demonstrate how to achieve a similar scenario as the one you have.
In case the provided example cannot help you solve the problem you experience, please, open a support ticket and send us a simple running project which reproduces the issue, send us all the needed files for testing it (the database as well) so that we can run it on our side and research the problem.

Best wishes,
Sophy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
avarndel
Top achievements
Rank 1
answered on 28 Jul 2008, 03:59 PM
One more question.  I'm using a stored procedure in the user control.  In the code behind for the LoadOnDemand.aspx.vb

the details line

Dim details As UserDetails = DirectCast(ctrl, UserDetails)

The UserDetails text.  Are you using the ascx file name here? 

tx
0
avarndel
Top achievements
Rank 1
answered on 28 Jul 2008, 08:08 PM
I can't get it to run with a Stored Procedure in the User Control

0
Sophy
Telerik team
answered on 29 Jul 2008, 07:33 AM
Hello Avarndel,

The UserDeatils text is the name of the UserControl that contains the information which appears in the ToolTip.
For your convenience I am attaching the same example with a StoredProcedure instead of a direct select sql query. Please, take a look at the example and in case it still cannot help you solve the problem you experience, I would once again kindly ask you send us a simple running project which demonstrates your scenario and the problem you observe so that we can test it on our side. We need your assistance in order to help you resolve the issue. You will need to open a support ticket to have the right to attache files.

Kind regards,
Sophy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
avarndel
Top achievements
Rank 1
Answers by
Sophy
Telerik team
avarndel
Top achievements
Rank 1
Share this question
or