I have two submit buttons and a few textboxes on my page. When I enter details in the textbox and hit the enter button the form should actuate the start new button. But the form is actuating the old button. I don't want to add on click to button because I am checking some conditions and redirecting from my controller. What do I have to do to avoid my form from actuating by default for old value button on hitting the enter button any suggestions, please?
controller :
public ActionResult Index(MyModel model, string new, string old)
{
if (new == "new")
{
if (rows > 0)
{
return ProcessAction();
}
else
{
return ProcessAction();
}
}
if (old == "old")
{
if (rowsAmount > 0)
{
//do something
}
else
{
//do something
}
}
return View();
}
View:
#using (Html.BeginForm("Index", "Application", FormMethod.Post))
{
#Html.AntiForgeryToken()
<div class="col aligncenter">
<div class="form-row topMargin">
<div class="col-md-6 form-group">
#Html.TextBoxFor(model => model.Email)
</div>
<div class="col-md-4 form-group">
#Html.TextBoxFor(model => model.FirsttName)
</div>
<div class="col-md-2 form-group">
#Html.TextBoxFor(model => model.LastName)
</div>
</div>
<div class="form-row">
<div class="col-md-9 form-group text-right">
<button class="btn" type="submit" name="old" value="old">Get History</button>
</div>
<div class="col-md-3 form-group text-right">
<button class="btn" type="submit" name=newr" value="new">Start New</button>
</div>
</div>
</div>
}
to cange form submitting through old button just Change button type from type="submit" to type="button"
<div class="form-row">
<div class="col-md-9 form-group text-right">
<button class="btn" type="btn" name="old" value="old">Get History</button>
</div>
<div class="col-md-3 form-group text-right">
<button class="btn" type="submit" name=newr" value="new">Start New</button>
</div>
</div>
update
you can give Get History button a click event you can make an Ajax call through javascript function and give that to get history or bind your controller action in the anchor link and
Your buttons have type="submit" which means they will submit the form when pressed. Instead use type="button" to avoid submitting the form. You can also use type="reset" if you want to provide a way to reset the form inputs.
<form>
First name:<br>
<input type="text" name="firstname"><br>
Last name:<br>
<input type="text" name="lastname">
<button type="button">Just a button</button>
<button type="submit">Submit</button>
<button type="reset">Reset the form</button>
</form>
Related
I am facing the issue of data validation being executed on load of a new page even though it is clearly coming from a Get method. Is there something that's triggering the validations on page load?
I have a button on a view to add a new Student record in the new screen :
View :
<a type="button" id="btnAddStudent" href='#Url.Action("Details","Student")' class="btn btn-tertiary" title="Add Student">Add Student</a>
The controller code for the Details action method in Student Controller is as follows.
[HttpGet]
public ActionResult Details(StudentInfo model)
{
//This is populating the model parameters as expected.
helper.StudentInfo(ref model);
return View(model);
}
The view for the Details screen is as follows. The page loads but is throwing validation errors even though it's a Get method.
<form id="frmSubmit" asp-action="Details" asp-controller="Student" method="post">
<input type="hidden" asp-for="StudentId" />
<div class="row">
<div class="col-xs-12">
#Html.ValidationSummary("", new { #class = "alert alert-danger validation" })
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label asp-for="Name">*StudentName</label><br />
<input asp-for="Name" class="form-control" maxlength="100" placeholder="Enter student name..." />
<span asp-validation-for="Name" class="text-danger"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label asp-for="AddressLine1"></label><br />
<input asp-for="AddressLine1" class="form-control" placeholder="Enter address..." />
<span asp-validation-for="AddressLine1" class="text-danger"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label asp-for="AddressLine2"></label><br />
<input asp-for="AddressLine2" class="form-control" maxlength="100" />
<span asp-validation-for="AddressLine2" class="text-danger"></span>
</div>
</div>
</div>
<div class="box">
<div class="form-group pull-right">
<button type="submit" class="btn btn-primary" value="save"> Save</button>
</div>
</div>
Is there something I am doing wrong? I have verified that the debug control goes to the Get method.There's alos no on load scripts which are doing any sort of validation.
1.Your get method contains the model parameter, when the request hit the method it will judge the ModelState by default. And when you hit the get method by your shared <a>, it send request without any data, so the ModelState is invalid.
2.Default Tag helper displays ModelState's value not Model.
In conclusion, you will render the ModelState error although it is a get method.
Two ways you can resolve this problem. The first way is that you can add ModelState.Clear() before you return View:
public ActionResult Details(StudentInfo model)
{
ModelState.Clear(); //add this....
helper.StudentInfo(ref model);
return View(model);
}
The second way is do not add the model as parameter:
public ActionResult Details()
{
var model = new StudentInfo();
helper.StudentInfo(ref model);
return View(model);
}
I am posting form data to my controller using AJAX, the form is located in a partial view which is called and displayed in a modal. When first submit the form to update my data it works fine, then if I post it again I notice in the console log that it posts the data twice, if I post it again, it posts three times, and so on. The only way to prevent that behavior is to refresh the page.
Here is the code for my partial view.
#model UserView
<div class="modal fade" id="edit-custom-view" tabindex="-1" role="dialog" aria-labelledby="edit-custom-view" aria-modal="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg modal-notify modal-primary" role="document">
<div class="modal-content">
<form id="ModalFormEditCustomView" enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<input type="text" asp-for="Id" hidden readonly />
<div class="col">
<div class="md-form form-group">
<label asp-for="ViewName">View Name</label>
<input type="text" required class="form-control" asp-for="ViewName" />
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-center">
<button type="button" data-save="edit-view" class="btn btn-info waves-effect waves-light">Update</button>
<button type="button" class="btn btn-secondary waves-effect waves-light" data-dismiss="modal">Close</button>
</div><!--/modal-footer-->
</form>
</div>
</div>
</div>
My function that posts the data. Please note, placeholderElement is a div that is the modal window.
placeholderElement.on('click', '[data-save="edit-view"]', function (event) {
//Prevent the standard behaviour
event.preventDefault();
var form = $(this).parents('.modal').find('form');
var actionUrl = form.attr('action');
var dataToSend = form.serialize();
$.post(actionUrl , dataToSend).done(function (data) {
var newBody = $('.modal-body', data);
placeholderElement.find('.modal-body').replaceWith(newBody);
placeholderElement.find('.modal').modal('hide');
});
});
Here is my controller
[HttpPost]
public JsonResult EditCustomView(UserView model) {
... update code goes here
return Json(model);
}
This is the button that opens the modal with the form in it.
<button data-view-id='#=Id#' onclick='editViewModal(this, event)' data-area='Home' data-context='Position' data-toggle='ajax-modal' data-target='#edit-custom-view' data-action='EditCustomView' data-url='/Home/EditViewModal/'>Button</button>
And finally, the code that opens the modal and fetches the partial view.
public IActionResult EditViewModal(int id)
{
string partial = "_EditCustomView";
UserView userView = _userViewService.GetUserView(id);
return PartialView(partial, userView);
}
So, when I click on submit, the ajax function is triggered to submit the data, and the modal closes. If I edit the same item again without refreshing the page, the form gets submitted twice and so on, adding an additional post-event each time. My question is, why? I can't see any reason as to why it would do this. Any help is appreciated.
I cannot reproduce your problem since the code you provided is not complete. Maybe you can show us the placeholderElement and the scripts of editViewModal(this, event) function in the button click event.
Besides, in your case, we can call and display the a modal in the following way.
Here is a work demo:
Model:
public class UserView
{
public int Id { get; set; }
public string ViewName { get; set; }
public string Address { get; set; }
public string Tel { get; set; }
}
Partial View:
#model UserView
<div class="modal fade" id="edit-custom-view" tabindex="-1" role="dialog" aria-labelledby="edit-custom-view" aria-modal="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg modal-notify modal-primary" role="document">
<div class="modal-content">
<form id="ModalFormEditCustomView" data-action="/Home/EditCustomView" enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<input type="text" asp-for="Id" hidden readonly />
<div class="col">
<div class="md-form form-group">
<label asp-for="ViewName">View Name</label>
<input type="text" required class="form-control" asp-for="ViewName" />
</div>
<div class="md-form form-group">
<label asp-for="Address">Address</label>
<input type="text" required class="form-control" asp-for="Address" />
</div>
<div class="md-form form-group">
<label asp-for="Tel">Tel</label>
<input type="text" required class="form-control" asp-for="Tel" />
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-center">
<button type="button" data-save="edit-view" class="btn btn-info waves-effect waves-light">Update</button>
<button type="button" class="btn btn-secondary waves-effect waves-light" data-dismiss="modal">Close</button>
</div><!--/modal-footer-->
</form>
</div>
</div>
</div>
Edit View:
#model UserView
<div class="row">
<div class="col-md-4">
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="ViewName" class="control-label"></label> :
<input asp-for="ViewName" class="form-control" readonly />
</div>
<div class="form-group">
<label asp-for="Address" class="control-label"></label> :
<input asp-for="Address" class="form-control" readonly />
</div>
<div class="form-group">
<label asp-for="Tel" class="control-label"></label> :
<input asp-for="Tel" class="form-control" readonly />
</div>
<div class="form-group">
<button name="btn" value="#Model.Id" class="btn btn-primary">Edit</button>
</div>
</div>
</div>
<div id="placeholderElement">
</div>
#section Scripts
{
<script>
$(".btn.btn-primary").on("click", function () {
var id = $(this).val();
$.ajax({
type: "get",
url: "/Home/EditViewModal?id=" + id,
success: function (result) {
$("#placeholderElement").html(result);
$("#edit-custom-view").modal('show');
}
});
})
$("#placeholderElement").on('click', '[data-save="edit-view"]', function (event) {
event.preventDefault();
var form = $(this).parents('.modal').find('form');
var actionUrl = form.data('action');
var dataToSend = form.serialize();
$.post(actionUrl, dataToSend).done(function (data) {
$("#placeholderElement").find('.modal').modal('hide');
$("#ViewName").val(data.viewName);
$("#Address").val(data.address);
$("#Tel").val(data.tel);
});
});
</script>
}
Controller:
public IActionResult Edit()
{
var model = _db.UserViews.Find(1);
return View(model);
}
public IActionResult EditViewModal(int id)
{
string partial = "_EditCustomView";
var userView = _db.UserViews.Find(id);
return PartialView(partial, userView);
}
[HttpPost]
public JsonResult EditCustomView(UserView model)
{
var model1 = _db.UserViews.Find(model.Id);
model1.ViewName = model.ViewName;
model1.Address = model.Address;
model1.Tel = model.Tel;
_db.Update(model1);
_db.SaveChanges();
return Json(model1);
}
Where is this script located? If it is inside of the partial that is what is causing the issue for you. Every time the partial is pulled in an extra event is attached to the element.
This would cause the behavior that you are describing.
I have a View (Index.cshtml) that it has two modals (Bootstrap modal).
I have loaded a Partial View in each modal. So in this View, I have two Partial Views(AddContractHistory.cshtml and AddCompany.cshtml).
I have a model that it's fields should be validated in each of the Partial Views.
I need to validate each of the partial views separately.
In same other issue, Html.BeginForm was used but I work on MVC module and DNN 8 that Html.BeginForm or Ajax.Html.BeginForm aren't supported.
For doing this work without having BeginForm, I tested many ways like below but I couldn't do it properly.
ASP.NET MVC Validation Groups?
ASP.NET MVC Multiple form in one page: Validation doesn't work
Index.cshtml (View)
#using MyProject.BusinessLogic
<div class="form-group">
<div class="col-sm-12">
<button type="button" class="btn btn-success" onclick="$('#AddContractHistory').modal('show');">
<i class="fa fa-plus"></i>
New ContractHistory
</button>
</div>
<div class="col-sm-12">
<button type="button" class="btn btn-success" onclick="$('#AddCompany').modal('show');">
<i class="fa fa-plus"></i>
New Company
</button>
</div>
</div>
<div id="AddContractHistory" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg" id="mymodal">
#Html.Partial("AddContractHistory", new ContractHistory())
</div>
</div>
<div id="AddCompany" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg" id="mymodal">
#Html.Partial("AddCompany", new Company())
</div>
</div>
AddContractHistory.cshtml (PartialView)
#inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<MyProject.BusinessLogic.ContractHistory>
<div id="myform">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">contract</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="panel-body">
<div class="form-horizontal">
#Html.ValidationSummary()
#Html.HiddenFor(c => c.ID)
<div class="form-group">
<div class="col-sm-6">
#Html.LabelFor(c => c.PlaceName)
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
</span>
#Html.EditorFor(c => c.PlaceName, new { htmlAttributes = new { #class = "form-control requierd-field" } })
</div>
</div>
<div class="col-sm-6">
#Html.LabelFor(c => c.ActivityDescription)
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
</span>
#Html.EditorFor(c => c.ActivityDescription, new { htmlAttributes = new { #class = "form-control requierd-field" } })
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success" formaction="AddContractHistory">
submit
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">cancel</button>
</div>
</div>
</div>
AddCompany.cshtml (PartialView)
#inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<MyProject.BusinessLogic.Company>
<div id="myform">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Company</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="panel-body">
<div class="form-horizontal">
#Html.ValidationSummary()
#Html.HiddenFor(c => c.ID)
<div class="form-group">
<div class="col-sm-6">
#Html.LabelFor(c => c.PlaceName)
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
</span>
#Html.EditorFor(c => c.PlaceName, new { htmlAttributes = new { #class = "form-control requierd-field" } })
</div>
</div>
<div class="col-sm-6">
#Html.LabelFor(c => c.ActivityDescription)
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
</span>
#Html.EditorFor(c => c.ActivityDescription, new { htmlAttributes = new { #class = "form-control requierd-field" } })
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success" formaction="AddCompany">
submit
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">cancel</button>
</div>
</div>
</div>
Thanks in advance!
You can implement your Html.BeginForm, which it's not supported in Dotnetnuke, in another way.
1. Change your buttons attributes
You should change buttons, which cause posting data to actions, like below:
<button id="btnAddContractHistory" type="button" class="btn btn-success">
submit
</button>
<button id="btnAddCompany" type="submit" class="btn btn-success">
submit
</button>
2. Add events click for buttons
Two click events call for posing data to desire actions. In this events, which are different in url, action attribute form are changed by your url and after that form.submit() causes pass data (model) to related action. Finally you would validate values of properties in two different actions.
<script>
$('.modal').find('#btnAddContractHistory').on('click', function () {
var url = 'AddContractHistory action url'; // It depends on your AddContractHistory action url
var form = $(this).closest('form');
form.prop('action', url);
form.submit();
});
$('.modal').find('#btnAddCompany').on('click', function () {
var url = 'AddCompany action url'; // It depends on your AddCompany action url
var form = $(this).closest('form');
form.prop('action', url);
form.submit();
});
</script>
In general, I recommend you to integrate more JS code (JQuery ?) in your views. In that way you'll be less bounded to some framework (DNN) that doesn't support basic MVC functionality you're used to. After all - a web app boils down to HTML+JS+CSS, so the better JS knowledge you have - the better control and flexibility you gain.
Regarding your question, MVC injects JS code for you to handle validation errors upon submitting. You can imitate this behavior yourself. It'll take you some time, but you'll gain full control over this process.
When page is loaded (JS event), you can complete some work via JS, like wrapping your partial views with your desired <form> tag, and/or bind to the submit events.
As simple as that.
But regular form submission will refresh your page, loosing the other partial view data/state. So, if you need, you can post/get your data via AJAX (again JQuery?) and update your page accordingly.
<form data-reza-ajaxform="true"
data-reza-targetId="#your-htmlcontrol-id"
action="#Url.Action("Your Action")"
method="POST/GET">
<div class="input-group">
<input type="text" ...>
...
<button class="btn btn-default" type="submit">Go!</button>
</div>
</form>
Then, in your script you can do something like this:
$('form[data-reza-ajaxform]').on('submit', submitAjaxForm);
...
function submitAjaxForm(e) {
var $form = $(this);
var options = {
url: $form.action,
method: $form.method,
data: $form.serialize()
};
$.ajax(options)
.success(function(res) {
var $target = $($form.attr('data-reza-targetId'));
$target.html(res);
$target.effect('highlight', 'slow');
});
e.preventDefault();
}
In this way you'll gain full control over your page and its parts. No matter in which framework you'll will work with. What can be better? :)
Hello I am trying build a comment section for some physics articles in my site and for now i would like that when i click on
<a asp-route-articleid="smth" asp-action="Create">Create New</a>
it creates a page with url: http://localhost:65401/Physics/Create?articleid=smth
<h2>Create</h2>
<form asp-action="Create">
<div class="form-horizontal">
<h4>Physics</h4>
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="CommentContext" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="CommentContext" class="form-control" />
<span asp-validation-for="CommentContext" class="text-danger" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
</form>
and now my question: How would I go about extracting that articleid in my controller? So far i tried this
public async Task<IActionResult> Create([Bind("ID,CommentContext,UserName,ArticleID")] Physics physics, string articleid)
{
if (ModelState.IsValid)
{
physics.UserName = HttpContext.User.Identity.Name;
physics.ArticleID = articleid;
_context.Add(physics);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(physics);
}
and also other desperate attempts by no luck so far. Any help would be appreciated.
EDIT:
using HttpContext.Request.GetEncodedUrl();gets me http://localhost:65401/Physics/Create but the point is I need that articleid=smth value.
Solution:
Request.Headers["Referer"].ToString();
will return string of full url including that 'articleid=smth' value.
If I understand I problem then you have following problem.
You have Create Button on One Page and that generate link you described. http://localhost:65401/Physics/Create?articleid=smth
Now when you click that link Your create method get called and it will return View that you have specified. ( At this time if you look articleId in your method then it will have that value).
Now after you value in comment and you submit the form. At that time You will not able to find articleId. This is because articleId not preserve anywhere.
If above is your issue then following will solve your problem.
Solution.
In Controller create two method
Get Method that will called when you click Create New. Another one is called when you submit the form.
Controller
[HttpGet]
public async Task<IActionResult> Create(string articleId)
{
Physics t = new Physics();
if(!string.IsNullOrEmpty(articleId))
{
t.ArticleID = articleId;
}
return View(t);
}
[HttpPost]
public async Task<IActionResult> Create([Bind("ID,CommentContext,UserName,ArticleID")]Physics physics)
{
if (ModelState.IsValid)
{
physics.UserName = HttpContext.User.Identity.Name;
//_context.Add(physics);
//await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(physics);
}
In your view I have made small change so articleId will preserve. ( See I have created hidden field for articleId)
<h2>Create</h2>
<form asp-action="Create">
<div class="form-horizontal">
<input asp-for="ArticleID" type="hidden" />
<h4>Physics</h4>
<hr />
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="CommentContext" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="CommentContext" class="form-control" />
<span asp-validation-for="CommentContext" class="text-danger" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
</form>
I hope that this solution will help you.
I'm trying upload a file from my page, but the request is not receiving posted file.
My form is into a normal Bootstrap modal, and this is the view.
#model InventarioWeb.Mvc.ViewModels.InventarioViewModel
<!-- Modal -->
<div id="ImportadorModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Importar Arquivo</h4>
</div>
<div class="modal-body">
#using (Html.BeginForm("ImportarItensInventario", "Inventario", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="row">
<div class="col-md-10">
#*<h4>Input Groups</h4>*#
<div class="input-group">
<span class="input-group-btn">
<span class="btn btn-primary btn-file">
Procurar…
<input type="file"
id="fileToUpload"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
</span>
</span>
<input type="text" class="form-control" readonly>
</div>
<span class="help-block">
Selecione um arquivo
</span>
</div>
<div class="col-md-10">
<input type="submit" id="SubmitArquivoInventario" name="Submit" value="Salvar Arquivo" class="btn btn-primary" disabled="disabled"/>
</div>
</div>
#*#Html.HiddenFor(x => x.InventarioId)*#
}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
And this is the controller's method
[HttpPost]
public ActionResult ImportarItensInventario(Guid inventarioId)
{
if (Request.Files["UploadInventarioItems"] == null || Request.Files["UploadInventarioItems"].ContentLength == 0)
{
return RedirectToAction(nameof(Details), new { id = inventarioId });
}
string path = $"{Server.MapPath("~/Uploads")}/{Request.Files["UploadInventarioItems"].FileName}";
if (System.IO.File.Exists(path))
{
System.IO.File.Delete(path);
}
Request.Files["UploadInventarioItems"].SaveAs(path);
var model = new InventarioViewModel {InventarioId = inventarioId};
var result = _arquivoAppService.ImportarArquivo(InventarioViewModel.ToModel(model), Request.Files["UploadInventarioItems"].FileName);
return RedirectToAction(nameof(Details), new { id = inventarioId});
}
When I request, the id parameter is received, but my file isn't.
Besides, the Request.Files does not have any item.
What I'm doing wrong??
Add name attribute to your input type file, you can workaround to get the file without this attribute, but it's more convenient.
<input type="file" id="fileToUpload" name="upload" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
and use in server this method to get the file:
if (Request.Files["upload"] == null || Request.Files["upload"].HasFile())
{
//do something
}
or like this for multiple files:
foreach (string inputTagName in Request.Files)
{
if (!Request.Files[inputTagName ].HasFile()) continue;
//... continue processing
}