or
I've been stuck on this problem for a few hours now.
I need to save the value of a textbox on a form on ASPX Child Page which may contain html markup. The page also contains multiple Formviews bound to different datasources.
When I try and submit I get a "potentially dangerous request" error. I tried setting ValidateRequest="false" in the page header, but to no avail.
I assume the answer would be to strip the tags from the value before posting back to the server in javascript, but I cannot figure out a way to make the form perform a submit operation. I tried the page.submit() ; but it did nothing. And when I tried using the form control I get a javascript error stating submit is not a function.
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
...
<
asp:FormView
ID
=
"TwoWeekForm"
runat
=
"server"
DataSourceID
=
"TwoWeekDataSource"
DataKeyNames
=
"ID"
>
<
ItemTemplate
>
...
</
ItemTemplate
>
<
EditItemTemplate
>
...
<
asp:TextBox
ID
=
"TwoWeekText"
runat
=
"server"
Text='<%# Bind("Extended") %>' TextMode="MultiLine" CssClass="KeyEvent" style="color:Black"></
asp:TextBox
>
...
</
table
>
</
EditItemTemplate
>
...
</
asp:FormView
>
<
telerik:OpenAccessDataSource
ID
=
"TwoWeekDataSource"
runat
=
"server"
EnableDelete
=
"False"
EnableInsert
=
"False"
ObjectContextProvider
=
"CNTracker.OpenAccess.EntitiesModel, CNTracker.OpenAccess"
TypeName
=
"CNTracker.OpenAccess.Interaction"
Where
=
"this.Project == @Project AND this.Type == 17"
>
<
WhereParameters
>
<
asp:SessionParameter
DefaultValue
=
"1"
Name
=
"Project"
SessionField
=
"CurrentProject"
/>
</
WhereParameters
>
</
telerik:OpenAccessDataSource
>
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="RadWindowManager.ascx.vb" Inherits="Controls_RadWindowManager" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <telerik:RadWindowManager runat="server" RestrictionZoneID="offsetElement" EnableShadow="true" ShowOnTopWhenMaximized="false" VisibleStatusbar="false" Behaviors="Close, Move, Resize, Maximize" Opacity="99" Height="400" Width="400" > </telerik:RadWindowManager> <script type="text/javascript"> function OpenRadWindow(url, title, width, height, modal, onBeforeCloseEvent, onCloseEvent) { if (url == null) { url = "" } if (title == null) { title = "" } if (width == null) { width = 400 } if (height == null) { height = 400 } if (modal == null) { modal = true } var wnd = window.radopen(url, null); wnd.SetTitle(title); wnd.setSize(width, height); wnd.set_modal(modal); if (onBeforeCloseEvent != null) { wnd.add_beforeClose(onBeforeCloseEvent); } if (onCloseEvent != null) { wnd.add_onClose(onCloseEvent); } return false; } </script>
<%@ Register Src="~/Controls/RadWindowManager.ascx" TagName="RadWindowManager" TagPrefix="uc3" %>
<uc3:RadWindowManager ID="RadWindowManager" runat="server" />
function OpenAddProduct() { var url = <%= """" & ResolveUrl("~/Levels/Products.Aspx?Popup=1") & """" %>; OpenRadWindow(url, "Manage Products", 765, 500, true, null, alert("This is supposed to be a close event...")); }