or
Before to begin Ajax request (async postback), I execute JavaScript function, which validate and correct values of the form (removes hyphens from telephone number). Call of alert() shows that value of a field has changed. However, to the server transferred not changed value of a field (old value - before correction).
Example: I typed '55-55-55' in field and clicked button. Value of a field changes on '555555', but to the server transferred old value (before correction) - '55-55-55'. I need to transfer the corrected value. How it to make?
<%@ Page Language="C#" AutoEventWireup="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <script type="text/javascript"> function formAdjustBeforeSubmit(sender, args) { var input = document.getElementById("phoneTextBox"); //debugger; var val = input.value.replace(/-/g, ""); input.value = val; // Here we modified value of a field (remove '-' from phone number) alert(input.value); } </script> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" ClientEvents-OnRequestStart="formAdjustBeforeSubmit"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="Panel1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="Panel1" UpdatePanelHeight="" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <asp:Panel ID="Panel1" runat="server"> Phone: <asp:TextBox ID="phoneTextBox" runat="server" ClientIDMode="Static" /> <asp:Button ID="Button1" runat="server" Text="Save" style="margin-left:20px;"/> </asp:Panel> </form> </body> </html> I am using 2010.3.1109.40 version of the Telerik.Web.UI.
Please help me out with this.
Thanks,
Steele.
MainPage.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="TestTelerikWebApp.MainPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="buttLaunch1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="buttLaunch1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="buttLaunch2"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="buttLaunch2" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadWindowManager ID="RadWindowManager1" runat="server" DestroyOnClose="True"> </telerik:RadWindowManager> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function OpenMyWindow() { var oManager = null; if (typeof (GetRadWindowManager) == 'function') // there is a radwindowmanager in scope, so use it oManager = GetRadWindowManager(); var oWnd = oManager.open('TestPopup.aspx', 'This is a test'); } </script> </telerik:RadCodeBlock> <div> <asp:Button ID="buttLaunch1" runat="server" Text="Launch1" onclick="buttLaunch1_Click" /> <asp:Button ID="buttLaunch2" runat="server" Text="Launch2" onclick="buttLaunch2_Click" /> </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; namespace TestTelerikWebApp { public partial class MainPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void buttLaunch1_Click(object sender, EventArgs e) { Session["ErrorInfo"] = "Launch1"; RadAjaxManager1.ResponseScripts.Add("OpenMyWindow();"); } protected void buttLaunch2_Click(object sender, EventArgs e) { Session["ErrorInfo"] = "Launch2"; RadAjaxManager1.ResponseScripts.Add("OpenMyWindow();"); } } } <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPopup.aspx.cs" Inherits="TestTelerikWebApp.TestPopup" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> I am a popup<br /> <asp:Label ID="lblMessage" runat="server"></asp:Label> </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; namespace TestTelerikWebApp { public partial class TestPopup : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lblMessage.Text = Session["ErrorInfo"].ToString(); } } }GridColumn SizeColumn = RadFileExplorer1.Grid.Columns.FindByUniqueNameSafe("Size"); SizeColumn.ItemStyle.Width = Unit.Pixel(1); SizeColumn.HeaderStyle.Width = Unit.Pixel(1);
Hello,
I have a problem with RadFormDecorator control.
Here is my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Test Page</title> <link rel="stylesheet" type="text/css" href="Skins/FormDecorator/00ccff/FormDecorator.00ccff.css" /> <link rel="stylesheet" type="text/css" href="Skins/FormDecorator/00ff00/FormDecorator.00ff00.css" /> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadFormDecorator runat="server" ID="RadFormDecorator1" Skin="00ccff" EnableEmbeddedSkins="false" DecoratedControls="CheckBoxes" DecorationZoneID="00ccffZoneID1" /> <telerik:RadFormDecorator runat="server" ID="RadFormDecorator2" Skin="00ff00" EnableEmbeddedSkins="false" DecoratedControls="CheckBoxes" DecorationZoneID="00ff00ZoneID1" /> <span id="00ccffZoneID1" > <asp:CheckBox ID="CheckBox1" runat="server" /> </span> <span id="00ff00ZoneID1"> <asp:CheckBox ID="CheckBox2" runat="server" /> </span> </form> </body> </html>/* RadFormDecorator for ASP.NET 00ccff Skin */ /* CSS class for styling the decoration zone or the <html /> tag of the page */ .RadForm_00ccff.rfdZone { background-color: Green; color:#00ccff; } /* Decorate <input type="checkbox" /> */ .RadForm_00ccff .rfdCheckboxUnchecked, .RadForm_00ccff .rfdInputDisabled.rfdCheckboxUnchecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 0; } .RadForm_00ccff .rfdCheckboxUnchecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -200px; } .RadForm_00ccff .rfdCheckboxChecked, .RadForm_00ccff .rfdInputDisabled.rfdCheckboxChecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -420px; } .RadForm_00ccff .rfdCheckboxChecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -640px; } /* the styling of radiobuttons and checkboxes in Safari and Chrome is already fully achieved with CSS */ @media screen and (-webkit-min-device-pixel-ratio: 0) { /* checkboxes */ .rfdCheckbox input[type="checkbox"], .rfdCheckbox input[type="checkbox"][disabled]:hover { background-image: url('CheckBox/CheckBoxSprites.gif'); } } @media screen and (-webkit-min-device-pixel-ratio: 0) { /* checkboxes */ #cc00ffZoneID1 input[type="checkbox"], #cc00ffZoneID1 input[type="checkbox"][disabled]:hover { background-image: url('CheckBox/CheckBoxSprites.gif'); } } /* RadFormDecorator for ASP.NET 00ff00 Skin */ /* CSS class for styling the decoration zone or the <html /> tag of the page */ .RadForm_00ff00.rfdZone { background-color: Green; color:#00ff00; } /* Decorate <input type="checkbox" /> */ .RadForm_00ff00 .rfdCheckboxUnchecked, .RadForm_00ff00 .rfdInputDisabled.rfdCheckboxUnchecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 0; } .RadForm_00ff00 .rfdCheckboxUnchecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -200px; } .RadForm_00ff00 .rfdCheckboxChecked, .RadForm_00ff00 .rfdInputDisabled.rfdCheckboxChecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -420px; } .RadForm_00ff00 .rfdCheckboxChecked:hover { background: transparent url('CheckBox/CheckBoxSprites.gif') no-repeat 0 -640px; } /* the styling of radiobuttons and checkboxes in Safari and Chrome is already fully achieved with CSS */ @media screen and (-webkit-min-device-pixel-ratio: 0) { /* checkboxes */ .rfdCheckbox input[type="checkbox"], .rfdCheckbox input[type="checkbox"][disabled]:hover { background-image: url('CheckBox/CheckBoxSprites.gif'); } } /* the styling of radiobuttons and checkboxes in Safari and Chrome is already fully achieved with CSS */ @media screen and (-webkit-min-device-pixel-ratio: 0) { /* checkboxes */ #00ff00ZoneID1 input[type="checkbox"], #00ff00ZoneID1 input[type="checkbox"][disabled]:hover { background-image: url('CheckBox/CheckBoxSprites.gif'); } }