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

Postback not firing from within RadToolTip

1 Answer 56 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
dino asked on 27 Nov 2012, 06:44 PM
I'm working off of the demo here:

Everything is working but the serverside code.  Here's a snippet of the aspx:

<telerik:RadToolTip ID="RadToolTip2" runat="server" Modal="true" ShowEvent="FromCode"
        Position="TopCenter" RelativeTo="BrowserWindow" OnClientBeforeHide="OnClientBeforeHide"
        HideEvent="FromCode" ShowCallout="False">
        <asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
                <asp:Panel ID="pnlScheduleAddReport" runat="server" Style="padding-left: 11px;">
                <h5>Schedule A New Report</h5>
                <telerik:RadComboBox ZIndex="999999" ID="ddScheduleReportName" Label="Report:" runat="server" DataSourceID="SQLDataSource1" AllowCustomText="false" DataValueField="id" DataTextField="reportname" Width="275px">
                <telerik:RadComboBox ZIndex="999999" ID="ddScheduleReportFrequency" Label="Frequency:" runat="server" DataSourceID="SQLDataSource3" AllowCustomText="false" DataValueField="id" DataTextField="frequencyDesc" Width="140px"
                OnSelectedIndexChanged="ddScheduleReportFrequency_SelectedIndexChanged" AutoPostBack="true">
                <telerik:RadComboBox ZIndex="999999" ID="ddScheduleReportParam" Label="Run Every:" runat="server" AllowCustomText="false" Width="165px">
                <br /><br />
                    <asp:Label ID="lblScheduleReportError" runat="server" Text="error label" Visible="false"></asp:Label><br />
            <telerik:RadButton ID="btnScheduleAddSubmit" runat="server" Text="Add Report To Schedule" OnClick="btnScheduleAddSubmit_Click" AutoPostBack="true">
            <telerik:RadButton ID="btnScheduleAddCancel" runat="server" Text="Cancel" OnClick="btnScheduleAddCancel_Click">
                <asp:AsyncPostBackTrigger ControlID="btnScheduleAddReport" EventName="Click"></asp:AsyncPostBackTrigger>

and here's the code for the postback:

Protected Sub btnScheduleAddSubmit_Click(sender As Object, e As System.EventArgs) Handles btnScheduleAddSubmit.Click
        Dim strConn As String = System.Configuration.ConfigurationManager.ConnectionStrings("XXXXX").ConnectionString
        Dim strSQL As String = "INSERT INTO TABLE (fld1, fld2, fld3, fld4) VALUES (@userID, @reportID, @reportFrequencyID, @reportFrequencyParam)"
        Dim oConn As New Data.SqlClient.SqlConnection(strConn)
        Dim oCmd As New Data.SqlClient.SqlCommand(strSQL, oConn)
        With oCmd.Parameters
            .Add(New SqlClient.SqlParameter("@fld1", Session("userID")))
            .Add(New SqlClient.SqlParameter("@reportID", ddScheduleReportName.SelectedValue))
            .Add(New SqlClient.SqlParameter("@reportFrequencyID", ddScheduleReportFrequency.SelectedValue))
            .Add(New SqlClient.SqlParameter("@reportFrequencyParam", ddScheduleReportParam.SelectedValue))
        End With
        'If Not ddScheduleReportName.Equals(String.Empty) AndAlso Not ddScheduleReportFrequency.Equals(String.Empty) AndAlso Not ddScheduleReportParam.Equals(String.Empty) Then
            Dim script As String = "toHide = true;GetActiveToolTip().hide()"
            ScriptManager.RegisterStartupScript(Me.Page, GetType(Page), "scriptKey", script, True)
            Me.lblScheduleReportError.Visible = False
            'Me.lblScheduleReportError.Text = "Please select a Report, Frequency, and Frequency Parameter field before submitting."
            'Me.lblScheduleReportError.Visible = True
        'End If
    End Sub

Oddly (or maybe not) the postback for the 2nd dropdown (ddScheduleReportFrequency) works perfectly.  I don't see why the click button event (btnScheduleAddSubmit)wouldn't work as well.  What am I doing wrong?


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 30 Nov 2012, 04:21 PM
Hi Dean,

I have addressed your problem in the support ticket on the matter. I would suggest continuing our discussion there so all information about the issue is on one place and it is easier for tracking. After a solution for the problem is found, you can post it here if you wish so the community can benefit from it as well.

the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question