I'd like to have a section of my page where, lets say, some basic contact fields can be entered. Without having to hit the "Save" submit button, the user can add more contacts by hitting a "+" button, which adds more fields to the page.
This would be fairly easy in standard web forms, but I'm a little lost as to how it should work in MV...
I have a partial view which has a Ajax.BeginForm, with a UpdateTargetID set. When the validation on the form fails the update target id is replaced with the validation errors, but when there are no validation errors users should be redirected to a new page.
The code in my Partial view is
<div id="div_UID">
<% using (Ajax.BeginForm...
As a followup to this question, I'm wondering what's happening to my TempData.
Scenario 1:
user logs in
user provides email address
user receives email with validation code
user clicks on validation url
user is validated
success msg is displayed via TempData set in Validate action
Scenario 2:
user logs in
user provides email addr...
I've read several different posts on paging w/ in MVC but none describe a scenario where I have something like a search form and then want to display the results of the search criteria (with paging) beneath the form once the user clicks submit.
My problem is that, the paging solution I'm using will create <a href="..."> links that will ...
For now, I just want to use the <audio> and <video> tags and maybe try out the drag and drop features since these are supported by Firefox 3.6. The project will just be a test project, not necessarily for production.
...
My app has these models:
patient, which has one patient_info, which has one history and has many exams.... I want to create a Report view where I show all this data.. right now Im creating the view and its turning out to be ugly and long.. is there a way I could create separate views for each of this things and then just render them in ...
I'm reading Pro ASP.NET MVC Framework book. In an example on 106 - 111 the author walks through creating an NUnit test for a HTMLHelper class.
I noticed that when I ran my HTMLHelper code in NUnit the links appeared like this:
<a href="Page1">1</a>
<a class="selected" href="Page2">2</a>
<a href="Page3">3</a>
But when I see them in t...
I have a simple jquery click event
<script type="text/javascript">
$(function() {
$('#post').click(function() {
alert("test");
});
});
</script>
and a jquery reference defined in the site.master
<script src="<%=ResolveUrl("~/Scripts/jquery-1.3.2.js")%>" type="text/javascript"></script>
I have ch...
Possible Duplicate:
How do I calculate someones age in C#?
I want to write an ASP.NET helper method which returns the age of a person given his or her birthday.
I've tried code like this:
public static string Age(this HtmlHelper helper, DateTime birthday)
{
return (DateTime.Now - birthday); //??
}
But it's not working....
I have a controller on my site that handles unknown actions and returns a view if it exists. This is so that static content can be added to this particular area of the site without having to modify the controller. The problem I am faced with now is to create a sitemap.xml file that contains links to all of these "unknown" views. What ...
I have a view for editing department details. In this view, all employees are listed and user selects which employees work in this department. Is there a way to submit only the selected employees as department.Employees (without using javascript)?
public ActionResult(Department department)
{
Save(department); // department.Employees...
How do I compile an ASP.Net MVC project using MSBuild? We use a Continuous Integration server to compile and deploy our applications. To keep things simple I created an MVC 1.0 project in VS2008. I immediately created an MSBuild script file to compile it. I did not change any code in the project. The MSBuild script contained th...
My action is creating a large zip file (more than a gig) on the fly based on some business logic.
I can output to the response stream directly in my action. This is advantageous because I am not buffering the entire file in memory before I start streaming.
This seems to go against mvc pattern though.
Is there a way to return some t...
I am retrieving a partial view with Ajax that is a form that can be submitted. If the form is submitted and ModelState is not valid I return the view and hookup the buttons again for the form. With that I get the validation error messages which works quite nice. But when ModelState is valid I want to return a different partial view that ...
I have a bunch of elements with names similar to "comp[1].Field" or "comp[3].AnotherField" where the index (1 or 3) changes. I'm trying to extract the index from the name.
Right now I'm using:
var index = $(":input:last").attr("name").match(/\[(\d+)\]/)[1];
but I don't feel like this is the best way to do this.
Any suggestions?
...
I have HTML table on the ASP.NET MVC View page. Now I have to export this table to Excel.
(1) I have used partial view (Inquiries.ascx) to display the table data from database (using LINQ to Entity)
(2) I also have used UITableFilter plugin to filter the records (Ex: http://gregweber.info/projects/demo/flavorzoom.html )
(3) At any po...
I have a route added by the code
routes.MapRoute("MyRoute", "TheUrl", new { controller = "MyController", action = "MyAction" });
I can then do a reverse lookup with the arguments like UrlHelper.Action("MyAction", "MyController"), and it will return a nice url like ~/TheUrl
However, for this route I want the generated URL to be ~/TheU...
We have several asp.net MVC apps in the following setup
SecurityApp (root application - handles forms auth for SSO and has a profile edit page)
Application1 (virtual directory)
Application2 (virtual directory)
Application3 (virtual directory)
so that domain.com points to SecurityApp and domain.com/Application1 etc point to their associ...
I am looking for the most appropiate way of dealing with a user activity feed on my social networking site. At the moment i have several activities which can appear on the news feed such as:
Users joins the site
User comments on a post
User adds a a post to their favourites
User adds a new post to the site
Here is a simplified versio...
Here is the problem,
i have one controller:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Detail(SomeObjectX a)
{
SomeObjectY b = new SomeObjectY();
b.merge(a); //i already have merge method.
return RedirectToAction("SomeAction", "SomeController", new { c = b });
}
is it possible to pass object b to...