Hi, when one of the controls of the FormTemplate has RequiredFieldValidator, clicking edit or Add new record not working. I am getting error:
"NetworkError:
500 Internal Server Error -
http:.../ScriptResource.axd?d=nv7asgRUU0tRmHNR2D6t1B_9fiS5OJY3KTRMAF4D17Hlkgb15LTvxIFD9V60xX_vkRJU81TFs8HNZhyOtmOQ3BeUAV6sJwN0m6XD0jm6Dg-1FSTXmC_cPUhXqUD-lmHVpRtmvKgLT4XLk7tOAE-VhQ2&t=362a7238"
When setting property EnableClientScript="False" it works.
I cannot use Client validation with RadGrid?
Regards,
Lev Rakhman
"NetworkError:
500 Internal Server Error -
http:.../ScriptResource.axd?d=nv7asgRUU0tRmHNR2D6t1B_9fiS5OJY3KTRMAF4D17Hlkgb15LTvxIFD9V60xX_vkRJU81TFs8HNZhyOtmOQ3BeUAV6sJwN0m6XD0jm6Dg-1FSTXmC_cPUhXqUD-lmHVpRtmvKgLT4XLk7tOAE-VhQ2&t=362a7238"
When setting property EnableClientScript="False" it works.
I cannot use Client validation with RadGrid?
Regards,
Lev Rakhman
3 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 07 May 2014, 06:50 AM
Hi Lev,
Its hard to identify the issue without your code snippet. Please try to replicate your issue with this Demo on Flexible Server-Side Validation. If this doesn't help, share your full code snippet.
Thanks,
Princy
Its hard to identify the issue without your code snippet. Please try to replicate your issue with this Demo on Flexible Server-Side Validation. If this doesn't help, share your full code snippet.
Thanks,
Princy
0

Lev
Top achievements
Rank 1
Iron
Iron
answered on 08 May 2014, 01:22 AM
Attached sample web app. When run under IIS 7.0 it gives an error with EnableClientScript = True
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication2._default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"radManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Path
=
"~/Scripts/jquery-1.11.0.min.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"radAjaxManager"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"gvTest"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gvTest"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
div
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"gvTest"
AutoGenerateColumns
=
"False"
OnNeedDataSource
=
"gvTest_OnNeedDataSource"
AllowPaging
=
"True"
AllowSorting
=
"True"
Skin
=
"Office2010Blue"
OnUpdateCommand
=
"gvTest_OnUpdateCommand"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
ClientSettings
EnableRowHoverStyle
=
"True"
></
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"ID"
EditMode
=
"PopUp"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ItemStyle-Width
=
"30px"
></
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"DOB"
DataField
=
"DOB"
HeaderText
=
"Date"
DataFormatString
=
"{0:MMM yyyy}"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Name"
DataField
=
"Name"
HeaderText
=
"Name"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Age"
DataField
=
"Age"
HeaderText
=
"Age"
></
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
InsertCaption
=
"New person"
EditFormType
=
"Template"
PopUpSettings-Modal
=
"true"
PopUpSettings-Width
=
"500"
>
<
FormTemplate
>
<
label
>Date:</
label
>
<
telerik:RadMonthYearPicker
runat
=
"server"
ID
=
"dtDate"
DbSelectedDate='<%#Bind("DOB") %>'></
telerik:RadMonthYearPicker
>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"valDate"
Display
=
"Dynamic"
ControlToValidate
=
"dtDate"
ErrorMessage
=
"Enter date"
EnableClientScript
=
"True"
></
asp:RequiredFieldValidator
>
<
asp:Button
runat
=
"server"
ID
=
"btnUpdate"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
<
asp:Button
ID
=
"btnCancel"
Text
=
"Cancel"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Cancel"
></
asp:Button
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
namespace
WebApplication2
{
public
partial
class
_default : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
protected
void
gvTest_OnNeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
List<ItemGrid> list =
new
List<ItemGrid>();
list.Add(
new
ItemGrid{ID = 1,Name =
"Test1"
,Age = 25, DOB = DateTime.Now});
list.Add(
new
ItemGrid { ID = 2, Name =
"Test2"
, Age = 35, DOB = DateTime.Now });
list.Add(
new
ItemGrid { ID = 3, Name =
"Test3"
, Age = 45, DOB = DateTime.Now });
list.Add(
new
ItemGrid { ID = 4, Name =
"Test4"
, Age = 55, DOB = DateTime.Now });
gvTest.DataSource = list;
}
protected
void
gvTest_OnUpdateCommand(
object
sender, GridCommandEventArgs e)
{
}
}
public
class
ItemGrid
{
public
int
ID {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
int
Age {
get
;
set
; }
public
DateTime DOB {
get
;
set
; }
}
}
<?
xml
version
=
"1.0"
?>
<!--
For more information on how to configure your ASP.NET application, please visit
-->
<
configuration
>
<
system.web
>
<
compilation
debug
=
"true"
targetFramework
=
"4.5"
/>
<
httpRuntime
targetFramework
=
"4.5"
maxRequestLength
=
"102400"
executionTimeout
=
"3600"
/>
<
httpHandlers
>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"ScriptResource.axd"
verb
=
"GET,HEAD"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
validate
=
"false"
/>
<
add
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.DialogHandler.aspx"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
validate
=
"false"
/>
</
httpHandlers
>
<
pages
controlRenderingCompatibilityVersion
=
"3.5"
clientIDMode
=
"AutoID"
>
<
controls
>
<
add
tagPrefix
=
"telerik"
namespace
=
"Telerik.Web.UI"
assembly
=
"Telerik.Web.UI"
/>
</
controls
>
</
pages
>
</
system.web
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
httpProtocol
>
<
customHeaders
>
<
clear
/>
<
add
name
=
"X-UA-Compatible"
value
=
"IE=10"
/>
</
customHeaders
>
</
httpProtocol
>
<
handlers
>
<
add
name
=
"Telerik_Web_UI_WebResource_axd"
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"ChartImage_axd"
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"Telerik_Web_UI_DialogHandler_aspx"
path
=
"Telerik.Web.UI.DialogHandler.aspx"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"Telerik_RadUploadProgressHandler_ashx"
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"ScriptResource_axd"
path
=
"ScriptResource.axd"
verb
=
"GET,HEAD"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
handlers
>
<
modules
runAllManagedModulesForAllRequests
=
"true"
/>
</
system.webServer
>
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.Web.UI"
publicKeyToken
=
"121fae78165ba3d4"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-2013.2.717.45"
newVersion
=
"2013.2.717.45"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
0
Hello Lev,
Could you please take a look at the following forum thread, which should help with the issue you are experiencing:
Most probably, the issue you are facing is related with the validation in .NET 4.5. The easiest way for handling this is to add the following in your web.config file:
Hope that helps.
Regards,
Konstantin Dikov
Telerik
Could you please take a look at the following forum thread, which should help with the issue you are experiencing:
Most probably, the issue you are facing is related with the validation in .NET 4.5. The easiest way for handling this is to add the following in your web.config file:
<
appSettings
>
<
add
key
=
"ValidationSettings:UnobtrusiveValidationMode"
value
=
"None"
/>
....
</
appSettings
>
Hope that helps.
Regards,
Konstantin Dikov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.