Hi,
I extensively use RadWindow to edit records from a dataset and this has all been working great. I recently switched from using asp:button to RadButton and my CloseWindow() code does not seem to work when called from RadButton.
I have added both an asp:button and telerik:Radbutton to a page as below:
The asp:button correctly closes the window, but the RadButton does not. Am I doing something wrong here?
When I click on the button I get the following message from explorer:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; FDM)
Timestamp: Fri, 10 Jun 2011 11:13:14 UTC
Message: Expected '}'
Line: 639
Char: 262
Code: 0
URI: http://localhost:1580/P5Time/(S(1jnywutrtzbw552lk2ry5mgd))/EditEvent.aspx?Mode=Insert&Start=2011-06-07+09%3a30&IsAllDay=false&duration=15&rwndrnd=0.9248140078625935
And the source indicated is shown below:
The error seems to indicate an issue around the btnDelete definition but it looks the same as all the others. Other RadButtons on the same page appear to work correctly, but they all call server code whereas this Cancel button only calls a javascript function.
David Penny
I extensively use RadWindow to edit records from a dataset and this has all been working great. I recently switched from using asp:button to RadButton and my CloseWindow() code does not seem to work when called from RadButton.
I have added both an asp:button and telerik:Radbutton to a page as below:
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Cancel"
Width
=
"100px"
OnClientClick
=
"CloseWindow();"
/>
<
telerik:RadButton
ID
=
"btnCancel"
runat
=
"server"
Text
=
"Cancel"
Width
=
"100px"
OnClientClicked
=
"CloseWindow();"
CausesValidation
=
"false"
></
telerik:RadButton
>
The asp:button correctly closes the window, but the RadButton does not. Am I doing something wrong here?
When I click on the button I get the following message from explorer:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; FDM)
Timestamp: Fri, 10 Jun 2011 11:13:14 UTC
Message: Expected '}'
Line: 639
Char: 262
Code: 0
URI: http://localhost:1580/P5Time/(S(1jnywutrtzbw552lk2ry5mgd))/EditEvent.aspx?Mode=Insert&Start=2011-06-07+09%3a30&IsAllDay=false&duration=15&rwndrnd=0.9248140078625935
And the source indicated is shown below:
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnAddFavourite_ClientState","iconData":{},"imageData":{},"text":"Add Favourite","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnAddFavourite","width":"100px"}, null, null, $get("btnAddFavourite"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnSave_ClientState","iconData":{},"imageData":{},"text":"Save","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnSave","width":"100px"}, null, null, $get("btnSave"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnExport_ClientState","iconData":{},"imageData":{},"text":"Export","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnExport","width":"100px"}, null, null, $get("btnExport"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnSaveAndClose_ClientState","iconData":{},"imageData":{},"text":"Save + Close","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnSaveAndClose","width":"100px"}, null, null, $get("btnSaveAndClose"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnDelete_ClientState","iconData":{},"imageData":{},"text":"Delete","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnDelete","width":"100px"}, null, null, $get("btnDelete"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnCancel_ClientState","iconData":{},"imageData":{},"text":"Cancel","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnCancel","width":"100px"}, {"clicked":CloseWindow();}, null, $get("btnCancel"));
});
The error seems to indicate an issue around the btnDelete definition but it looks the same as all the others. Other RadButtons on the same page appear to work correctly, but they all call server code whereas this Cancel button only calls a javascript function.
David Penny