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

Calling RadWindow from Server-Side

7 Answers 157 Views
Window
This is a migrated thread and some comments may be shown as answers.
Liji Jose
Top achievements
Rank 1
Liji Jose asked on 26 Apr 2010, 10:36 AM



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 

7 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 26 Apr 2010, 11:23 AM
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.
0
Princy
Top achievements
Rank 2
answered on 26 Apr 2010, 11:48 AM
Hi Liji,

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

Regards,
Princy.
0
Liji Jose
Top achievements
Rank 1
answered on 26 Apr 2010, 11:54 AM

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
0
Georgi Tunev
Telerik team
answered on 26 Apr 2010, 01:39 PM
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.
0
Liji Jose
Top achievements
Rank 1
answered on 26 Apr 2010, 03:36 PM


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
0
Georgi Tunev
Telerik team
answered on 29 Apr 2010, 11:25 AM
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.
0
Liji Jose
Top achievements
Rank 1
answered on 04 May 2010, 01:05 PM


Hi Georgi,


Thanks for your reply and it solved my problem :)

Also thanks for the coding tip provided by you.

- Liji Gilesh
Tags
Window
Asked by
Liji Jose
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Princy
Top achievements
Rank 2
Liji Jose
Top achievements
Rank 1
Share this question
or