$fin() always returns null with radwindow

4 posts, 0 answers
  1. Kareem
    Kareem avatar
    8 posts
    Member since:
    Sep 2015

    Posted 03 Nov 2015 Link to this post

    Hello I'm trying to open a radwindow from the server side on the event on some a linked button on a radgrid clicked it makes an ajax call using the ajax manager

    the problem is the $find() function always returns null

     I tried every possible solution I found online and the javascript function is at the end of the page

    <telerik:RadCodeBlock ID="CodeCodeCode" runat="server">
            <script type="text/javascript">
                function OpenWindow(url)
                {
                    var rwindow = $find("<%= rw_customerfeedback.ClientID %>");
                    rwindow.setUrl(url);
                    rwindow.show(url);
                    rwindow.center();
                }
            </script>
     </telerik:RadCodeBlock>

    here's how I make the ajax call

    <telerik:AjaxSetting AjaxControlID="lnkbtn_complaint">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="rw_customerfeedback" />
                        </UpdatedControls>
    </telerik:AjaxSetting>

    and here's how I call the java script code

    string corporateIdentifier = RouteData.Values["CorporateIdentitfier"].ToString();
               string url = Page.GetRouteUrl("Complaints", new RouteValueDictionary{{"CorporateIdentifier", corporateIdentifier }});
               string script = @"OpenWindow('" + url + "');";
               Session["TicketID"] = e.CommandArgument;
               ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenWindow", script, true);

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 03 Nov 2015 Link to this post

    Hello,

    I advise that you review the following articles:

    Regards,

    Marin Bratanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kareem
    Kareem avatar
    8 posts
    Member since:
    Sep 2015

    Posted 03 Nov 2015 in reply to Marin Bratanov Link to this post

    Dear Marin Bratanov,

    you have to understand that I've already tried all the solution mentioned in those articles

    more over I have no problem launching the script from the server the script launches just fine

    the problem is that the $find always returns null when I try to search for the radwindow

    there's something I forgot to mention I set all the controls client IDs to static, is that might be causing the problem??

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 03 Nov 2015 Link to this post

    Hello,

    ClientIDMode = Static is not supported by our controls and you should remove this property: http://docs.telerik.com/devtools/aspnet-ajax/general-information/troubleshooting/general-troubleshooting#setting-clientidmode-property-to-static-breaks-the-telerik-controls-functionality.

    Regards,

    Marin Bratanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top