Question

Okay so I've got an issue with the RadWindow control.

I have a button on the inside of a RadWindow. The button needs to respond to a server side event on the code behind. I've gone as far as getting this code to work in a test app but I can't seem to get it working in an actual application.

I've looked in a few different places and have used what I've learned to get a test app that works. But that same bit of code is not working in my app. The only key differences I can tell are that I've got a reference to the Script manager in a seperate file and that I am using .net version 2 in the actual app but 4.0 in the test app. What am I doing wrong here?

The Code Behind (which is not firing)

Protected Sub btnClearFilterValues_OnClick(ByVal sender As Object, ByVal e As EventArgs) Handles btnClearFilterValues.Click
    'clears a bunch of values 
    'this never hits'
End Sub

Protected Sub btnFilterCourses_OnClick(ByVal sender As Object, ByVal e As EventArgs) Handles btnFilterCourses.Click
    'Code executes filter'
    'this never hits'
End Sub

Separate header referencing the scripts contains the following

<telerik:RadScriptManager ID="ScriptManager" runat="server" ScriptMode="Release">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>

The Markup


<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>

        <telerik:RadCodeBlock runat="server" ID="rdbScripts">
            <script type="text/javascript">
            <!--
    //-->

    //adds jquery to the global or "window" level namespace
    window.$ = $telerik.$;

    function showDialog() {
        var wnd = $find("<%=modalPopup.ClientID %>");
        wnd.show();
        Sys.Application.remove_load(showDialog);
    }

    $(document).ready(function () {
        $("#btnFilter").click(function (event) {
            showDialog();
        });
    });
    </script>
</telerik:RadCodeBlock>

    <telerik:RadAjaxPanel runat="server" ID="rapConfiguration" HorizontalAlign="NotSet">
        <telerik:RadWindow ID="modalPopup" runat="server" Width="720px" Height="292px" Modal="True" Title="Filter Courses">
            <ContentTemplate>
                <div>
                    <asp:Button ID="btnFilterCourses" runat="server" OnClick="btnFilterCourses_OnClick" Style="margin-right: auto; margin-left: 0" Text="Filter Courses" UseSubmitBehavior="False" />
                    <asp:Button ID="btnClearFilterValues" OnClick="btnClearFilterValues_OnClick" runat="server" Style="margin-right: auto; margin-left: auto;" Text="Clear" UseSubmitBehavior="False" />
                </div>
            </ContentTemplate>
        </telerik:RadWindow>
    </telerik:RadAjaxPanel>
Was it helpful?

Solution

<asp:Button ID="btnFilterCourses" runat="server" OnClick="btnFilterCourses_OnClick" Style="margin right: auto; margin-left: 0" Text="Filter Courses" UseSubmitBehavior="False" AutoPostBack="TRUE" />

<asp:Button ID="btnClearFilterValues" OnClick="btnClearFilterValues_OnClick" runat="server" Style="margin-right: auto; margin-left: auto;" Text="Clear" UseSubmitBehavior="False" AutoPostBack="TRUE" />

You could try this, i've added an 'AutoPostBack' property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top