Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using a form in an UpdatePanel

2 views
Skip to first unread message

Ned White

unread,
May 1, 2008, 5:11:33 PM5/1/08
to
Hi,

is it possible to use a html style form inside an UpdatePanel ?
Like that;

<%-- Page: Default.aspx --%>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<form id="try1" method="post" action="Default.aspx">
<input type="text" name="ExpDate_Month" value=""/>
<select name="cardType">
<option value="1">Visa</option>
<option value="2">MasterCard</option>
</select>
<input type="submit" value="Submit Payment"/>
<input type="hidden" name="total1" value="7.50">
</form>
</ContentTemplate>
</asp:UpdatePanel>

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Button ID="Btn1" runat="server" Text="Button" onclick="Button1_Click"
/>
<br />
<asp:Label ID="lblName" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>

</form>

-------

I am getting error when i use any controls of second UpdatePanel
(UpdatePanel2 )
Error Message is:

Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or
callback argument. Event validation is enabled using <pages
enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. For security purposes, this
feature verifies that arguments to postback or callback events originate
from the server control that originally rendered them. If the data is valid
and expected, use the ClientScriptManager.RegisterForEventValidation method
in order to register the postback or callback data for validation.

Thanks..


bruce barker

unread,
May 2, 2008, 12:19:00 PM5/2/08
to
yes, but because its an html form, it will do a standard form post and
replace current page (or whatever is the target) rather than an async
postback.

-- bruce (sqlwork.com)

David

unread,
May 3, 2008, 5:15:15 AM5/3/08
to
I would have though you would get a different error, as you cannot normally
nest form tags.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


"bruce barker" <bruce...@discussions.microsoft.com> wrote in message
news:39AD2EF9-8428-4E81...@microsoft.com...

0 new messages