executing severside code only after entering value in radprompt

2 posts, 0 answers
  1. Arjun
    Arjun avatar
    2 posts
    Member since:
    Jul 2011

    Posted 28 Jul 2011 Link to this post

    Hi,

    Somebody help me please.I am stuck with this.
    <script type="text/javascript">
            function openPrompt() {
                radprompt("please enter the file name", CallBackFn);
              
            }
            function CallBackFn(arg) {
                document.getElementById("<%=hdnField1.ClientID%>").value = arg;
            }
            
        </script>
    I have specified onClientClick="openPrompt()" in the button control.But this directly executes the serverside code.but it should execute server side code only after i enter the file name and click ok.please help.

    Thanks.

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 29 Jul 2011 Link to this post

    Hello Arjun,

    In this case I would advise that you add the return false; statement to the OnClientClick handler to cancel the postback and then manually call the postback in the RadPrompt's callback function. This approach is shown in this post of one of the code libraries: http://www.telerik.com/community/code-library/aspnet-ajax/window/block-the-execution-thread-with-radconfirm.aspx#1701380.


    Best wishes,
    Marin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top