Calling RadWindow from Server-Side

8 posts, 0 answers
  1. Liji Jose
    Liji Jose avatar
    52 posts
    Member since:
    Jan 2010

    Posted 26 Apr 2010 Link to this post




    Hi,


    My requirement is to call the RadWindow - specifically RadAlert from server-side. I can achieve the same using the following code:

     Dim radalertscript As String = "<script language='javascript'>function f(){radalert('Duplicate Contract Found - Contract Selection Failed', 350, 150);};</script>"
       Me.Page.ClientScript.RegisterStartupScript(Page.GetType(), "radalert", radalertscript)

    But my problem is when I invoke the above code after doing a __doPostBack() from client-side it is not working, the radAlert is not at all shown, where am i doing wrong, could you provide me with an idea?

    -Liji Gilesh 
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 26 Apr 2010 Link to this post

    Hello Liji,

    Please check the following blog post - I believe that it would be of help:
    http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx


    Greetings,
    Georgi Tunev
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Apr 2010 Link to this post

    Hi Liji,

    Checkout the Knowledge Base which shows how to show radalert from code behind in different scenarios.
    Calling radalert from codebehind

    Regards,
    Princy.
  4. Liji Jose
    Liji Jose avatar
    52 posts
    Member since:
    Jan 2010

    Posted 26 Apr 2010 Link to this post


    Hi Georgi,

    Thanks for your response.....

    Again, could you tell me why the same code as mentioned in the blog is not working after an explicit __do PostBack() is done from client-side and invoked from a linkbutton click event...

    I am so confused , i can't figure out the reason please help me ....

    -Liji Gilesh
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 26 Apr 2010 Link to this post

    Hi Liji,

    To be able to help, I need to get a better view over your exact setup and logic. Please open a support ticket and send me a sample page where this issue could be reproduced. I will check it and get back to you right away.

    Kind regards,
    Georgi Tunev
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  6. Liji Jose
    Liji Jose avatar
    52 posts
    Member since:
    Jan 2010

    Posted 26 Apr 2010 Link to this post



    Hi Georgi,

    I have opened a support ticket and uploaded my file.
    Ticket ID: 304013

    Please provide me a solution at the earliest.

    Thanks in advance

    -Liji Gilesh
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Apr 2010 Link to this post

    Hi Liji,

    I have replied your support ticket. For convenience I am pasting my reply below:

    The reason for this problem in your case is that you call a JavaScript function in the OnClientClick event handler which makes a postback to the server. You however, do not cancel the "original" postback - the one that happens when you click that button. What happens in your logic is that the JavaScript function is executed and a postback occurs (because of the __doPostback() function), but there is also a second postback that comes from the button itself.
    To avoid that, you should cancel the original postback - OnClientClick ="fnOpenContractSelection(); return false;"

    Another thing that I noticed is that you are trying to send a custom argument to the server (as a second parameter in the __doPostback() function) - note that in this case, you would get an event validation error because of the ASP.NET 2x / 3x security. To avoid that you should either set EnablePageValidation to false for that page, or use Page.ClientScript.RegisterForEventValidation() in Render.

    Please note however that this issue is not related to the RadWindow control - you will get the same problem with any other standard controls.



    Greetings,
    Georgi Tunev
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  8. Liji Jose
    Liji Jose avatar
    52 posts
    Member since:
    Jan 2010

    Posted 04 May 2010 Link to this post



    Hi Georgi,


    Thanks for your reply and it solved my problem :)

    Also thanks for the coding tip provided by you.

    - Liji Gilesh
Back to Top