using a form in an UpdatePanel

N

Ned White

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..
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top