I create a subscribe block in my page, include text box and button submit. I have a view name SubMail, this is it’s content :
<%@ Page Language="C#"
Inherits="System.Web.Mvc.ViewPage<Areas.Admin.Models.SubscribeMail>" %>
<!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>SubscribeMail</title></head>
<body>
<div style="color:#353535;font-size:small;font-family:Verdana;">
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) {%>
<%: Html.ValidationSummary(true) %>
<div class="editor-label">
Subscribe For Latest Information:
<%: Html.ValidationMessageFor(model => model.Email) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Email, new { @class =
"flathtmlcontrol", name="Email"})%>
<input type="submit" value=" Submit " class="flathtmlcontrol" />
</div>
<% } %>
</div>
</body>
</html>
I used user control to render the content to my web page, This is my user control file :
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<iframe src="<%: Url.Action("SubMail","Portfolio") %>" frameborder="0"
scrolling="no" height="70px"></iframe>
The problem is : when I clicked button submit, after page done, The control text box and submit button disappeared in my page, Until I refresh a page, the control is appear normally in my page.
Can anyone tell me , what problem is it?
The control is in an iframe, when you post the form the control contains it loads the iframe with the results of the action method the form posted to.