Hello!
I know that this is an odd question, but i had been searching the forums with no luck. Something really weird is happening in my web app. i have a form with several controls (comboboxes, labels, textboxes, buttons, a radgrid, a radpanel and a radwindow. All third party controls are from Telerik) to keep some sort of order i have them grouped inside divs (divLeftMenu, divMain, divDetails, divGrid and divbuttons) all this inside an ajax panel.
I use to open the radwindow from code behind because most of the time i need to perform server side operations right before open the radwindow.
The other form (the buggy one) keeps the same structure, and here comes the weird part. None of my javascript functions run from code behind. not even a simple alert window. Needless to say i can't open my radwindow.
The working form:
In the working form i had to place the radwindow out of the ajaxpanel and place all the other controls inside that panel.
The code behind that trigger the javascript function is in the RadPanelBar itemclick event. where i set the page that the radwindow will display. To open the radwindow i use the following
The JS Function
The buggy form:
Nothing happens if i do as above. the radwindow wont open.
To make it work manually (i mean by manually open the radwindow with a button and the OnClientClick) i have to place everything inside the ajaxpanel.
I have tried radscriptblock, radwindows manager, Me.Page.ClientScript.RegisterStartupScript, ScriptManager.RegisterStartupScript, place the radpanel inside and outside of ajaxpanel, place the radwindow inside and outside. Add simple js functions to test if the problem is just with the js functions related to the radwindow or all of them.
Weird behaviour 1.
If i try to test for the script registration in the load event, the whole form freezes, comboboxes doesn't open, textboxes become readonly.
Weird behaviour 2.
Implementing the radscriptblock control run once, freezing the form and displaying the script text in the middle of the page.
To sum up:
trying several different ways and i still can't do something as trivial as open a radwindow in an ajaxifixied form.
Please if anyone can shade some light on this, will be so much appreciated.
Thanks!
I know that this is an odd question, but i had been searching the forums with no luck. Something really weird is happening in my web app. i have a form with several controls (comboboxes, labels, textboxes, buttons, a radgrid, a radpanel and a radwindow. All third party controls are from Telerik) to keep some sort of order i have them grouped inside divs (divLeftMenu, divMain, divDetails, divGrid and divbuttons) all this inside an ajax panel.
I use to open the radwindow from code behind because most of the time i need to perform server side operations right before open the radwindow.
The other form (the buggy one) keeps the same structure, and here comes the weird part. None of my javascript functions run from code behind. not even a simple alert window. Needless to say i can't open my radwindow.
The working form:
In the working form i had to place the radwindow out of the ajaxpanel and place all the other controls inside that panel.
The code behind that trigger the javascript function is in the RadPanelBar itemclick event. where i set the page that the radwindow will display. To open the radwindow i use the following
Protected
Sub
mnuLifts_ItemClick(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.RadPanelBarEventArgs)
Handles
mnuLifts.ItemClick
Dim
intDay
As
Integer
=
Date
.Today.Day - 1
Dim
strURL
As
String
=
String
.Empty
AllParams =
New
clsParameters
With
AllParams
.CustomerID =
Me
.cboCustomer.SelectedValue
.CustomerName =
Me
.cboCustomer.Text
Select
Case
Cint(e.Item.Value)
Case
1
.qryBase =
"uspStoredProc1"
.BDate =
CDate
(Today.
Date
)
.Edate =
CDate
(Today.
Date
)
strURL =
"xxxxxxxx.aspx"
AllParams.Title =
Me
.cboCustomer.Text &
"text here ommited"
Case
2
.qryBase =
"uspStoredProc2"
AllParams.BDate =
String
.Empty
AllParams.Edate =
String
.Empty
strURL =
"yyyyyyyyyy.aspx"
AllParams.Title =
Me
.cboCustomer.Text &
"text here ommited"
Case
"3"
' lifts per month
.qryBase =
"uspStoredProc3"
AllParams.BDate =
CDate
(DateAdd(DateInterval.Day, -intDay, Today.
Date
))
AllParams.Edate =
CDate
(Today.
Date
)
strURL =
"zzzzzz.aspx"
AllParams.Title =
Me
.cboCustomer.Text & ControlChars.CrLf &
"text here ommited "
& AllParams.BDate.ToString &
" to "
& AllParams.Edate.ToString
End
Select
End
With
ScriptManager.RegisterStartupScript(
Me
.Page, Page.
GetType
(),
"radWin"
,
"MyFunction(); return false"
,
True
)
End
Sub
<script type=
"text/javascript"
>
function
OpenCommun() {
var
wnd = $find(
"<%=dlgCommun.ClientID%>"
);
wnd.setUrl(
"xxxxxxxxxxxxxx.aspx"
);
wnd.show();
}
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
CloseCommun() {
GetRadWindow().close();
}
</script>
The buggy form:
Nothing happens if i do as above. the radwindow wont open.
To make it work manually (i mean by manually open the radwindow with a button and the OnClientClick) i have to place everything inside the ajaxpanel.
I have tried radscriptblock, radwindows manager, Me.Page.ClientScript.RegisterStartupScript, ScriptManager.RegisterStartupScript, place the radpanel inside and outside of ajaxpanel, place the radwindow inside and outside. Add simple js functions to test if the problem is just with the js functions related to the radwindow or all of them.
Weird behaviour 1.
If i try to test for the script registration in the load event, the whole form freezes, comboboxes doesn't open, textboxes become readonly.
Weird behaviour 2.
Implementing the radscriptblock control run once, freezing the form and displaying the script text in the middle of the page.
To sum up:
trying several different ways and i still can't do something as trivial as open a radwindow in an ajaxifixied form.
Please if anyone can shade some light on this, will be so much appreciated.
Thanks!