I apologize if I'm not posting this question in the right forum, but here's my problem.
For this particular asp.net page that I am working on, I have three questions, and for each question the user can answer yes or no via radio buttons. Initially, the first question is enabled, and the other questions/radio buttons are disabled. Each question/radio button list is inside it's own Infragistics asynchronous refresh panel. I did this because question 2 is enabled depending upon the answer to question 1, and question 3 is enabled depending upon the answer to question 2. I did not want the entire page to be refreshed whenever a question was answered.
If the user selects the "yes" radio button for question three, a javascript alert should be displayed to the user. Problem is, that alert does not display. I think the cause of this problem is the placement of the radio buttons in the asynchronous refresh panel (as an experiment, I removed all of the refresh panels, and the alert displayed when the "yes" radio button was selected for question 3).
Is there a way to make the javascript alert appear without removing the radio buttons from the asynchronous refresh panel?
Here's my code snippet, with the javascript portion in bold:
rbtnlstHalfMeals.BorderStyle = BorderStyle.None
If rbtnlstHalfMeals.SelectedIndex = 0 Then
Response.Write("<script language='javascript'>alert('This student is ineligible because more than 50% of meals are covered by a meal ticket.');</script>")
Session("FL_PLUS_50_MEALS_CVRD") = "Y"
DisableCriteria()
Else
Session("FL_PLUS_50_MEALS_CVRD") = "N"
EnableCriteria()
End If
End Sub
Thank you!
You can use this universal approach:
http://codecorner.galanter.net/2009/07/28/injecting-client-script-into-infragistics-async-postback/
it works no matter whether script is added on first page load, full postback or WARP panel postback
If warp is the name of you webAsyncRefreshPane; and script is string containing Javascript
Then add your script to your warp panel as below.This is working for me.
Dim c As New Literal() c.Text = String.Format("<script type='text/javascript'>{0}</script>", script) warp.Controls.Add(c)
Instead of using the response.write to register java script...Add your java script to the warp.
Even i am facing the same problem as Iqknox.
Scripts dont work if called by a control present inside WARP.
Anybody has a solution?
Please reply asap.
do sy have a solution for this problem ? without using any extra library ?
Hi,
you can use AJAX.Pro from Michael Schwarz. This is all ready to use in our company and this functionality is the best. You call server method and your callback works on clientside.
Read on Michael's Weblog (www.ajaxpro.info).