I have an ActionResult returning from a strongly typed view where I manually validate some conditions, pass in an error message, but would like to preserve the users responses.
Since my View is strongly typed, I am calling it like this:
return View("PrincipalInvestigatorForm", new SmartFormViewModel(sections, questions));
My problem ...
<%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_GroupId }, new AjaxOptions {HttpMethod="Delete", Confirm="Delete Group with Group ID:" + item.int_GroupId + " Group Name:" + item.vcr_GroupName})%>|
[HttpDelete]
public ActionResult Delete(int id, FormCollection collection)
{
try
{
Gro...
I defined a few display templates for classes and they work well when I put them in views/shared/DisplayTemplates. However after I move them into an area, looks like ASP.NET MVC won't look inside Area to find the templates.
How to reference the DisplayTemplates defined in an Area from main project? Is that a good practise?
...
Hi,
I'm a new poster in stackoverflow. The community seems really nice so I'll go ahead and post my question.
I'm trying to style a asp.net MVC2 form so that instead of having all the fields on a strait line, I would like to have it like so:
Label: Text field
Label: Text field
I know you could do that with a table but I would lik...
Hello,
MVC is formatting my code horribly, and I was wondering if you can turn it off? I feel the answer is no, but I was hoping VS 2010 had built in a setting...
Here's what its formatting as:
<% if (org.UserKey.HasValue)
{ %>
<%= org.Reference(i => i.UserReference).Email%>
...
Hey,
How do you set the id of an Html.Form in ASP.NET MVC 2?
I tried this:
<% using (Html.BeginForm("Save", "Clients", new { id = "SubmitForm" })) {%>
But it doesn't work, my form still doesn't have an id property:
<form action="/TothSolutions/Secure/Clients/Save/SubmitForm" method="post">
I'm guessing this worked in ASP.NET MVC...
How can I design my portable areas such that the consumer can specify the MasterPage & various content placeholders & my portable area renders into those regions at run time?
Any code samples and/or ideas?
Thanks!
...
i have a language table which is as a foreign key in the link table , The link can be in 3 languages meaning there will be 3 rows in the link table every time i enter the record . i am using jQuery tabs to enter the records in 3 languages . OK so that thing is that there will be three text boxes for every field in the table.link name fie...
While designing a master page i am adding a number of images to it.
I have an image tag inside the master page,
<img src="../../Content/Images/img19.jpg" class="profileImage" />
When i run my app, the image doesn't show up in the browser because the src path in the page that browser gets is same as in the master page.
ie. "../../Co...
Hi,
I want to create a pagination helper. The only parameters that it needs are currentpage, pagecount and routename.
However, I do not know if it is possible to use the return value of another html helper inside the definition of my html helper. I am referring specifically to Html.RouteLink. How can I go about doing something like this ...
has someone make ajax.actionlink for delete to work properly.After deleting the record successfully at the end it is not refreshing the page properly. the page refresh is my problem. i have defined the updatetarget id and returning view(model) from my controller but it is returning the master page with it.
So the thing is that i am ha...
Apologies for the shortness of the question, however I don't think it needs much elaboration.
Any there any security implications caused by using the CSharpCodeProvider and could it open a server up for attack?
...
I am trying out ASP.NET MVC Framework 2 with the Microsoft Entity Framework and when I try and save new records I get this error:
Mapping and metadata information could not be found for EntityType 'WebUI.Controllers.PersonViewModel'
My Entity Framework container stores records of type Person and my view is strongly typed with class Pe...
What's the recommended way to deploy a website created with ASP.NET 4.0 and Visual Studio 2010?
I've previously always added a web setup project to my solution, and used that to create an MSI, even for small applications.
But when I build a web setup project in VS2010 it kind of works but some stuff still seems broken:
1. I need to tur...
Simple question, if you use the Html Helper from ASP.NET MVC Framework 1 it is easy to set a default value on a textbox because there is an overload Html.TextBox(string name, object value). When I tried using the Html.TextBoxFor method, my first guess was to try the following which did not work:
<%: Html.TextBoxFor(x => x.Age, new { va...
During debug builds I would like to show the duration it took, server side, to generate a page in the pages footer.
So for example if a page takes 250ms server side I would like that displayed in the footer, in debug builds. How can I achieve this in an ASP.NET MVC project?
...
With a view model containing the field:
public bool? IsDefault { get; set; }
I get an error when trying to map in the view:
<%= Html.CheckBoxFor(model => model.IsDefault) %>
Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)
I've tried casting, and using .Value and neither wor...
My Silvrlight 4 application hosted in ASP.NET MVC 2 working fine when used through Internet Explorer 8, both in development server and remote web server (IIS 6.0). However when I try to browse through Google Chrome (version 5.0.375.70) it throws "remote server returned not found" error. The code causing the problem is the following:
pub...
Hello,
Actually im doing a home page that only have an action called Index() that returns the view Index.ascx.
This index page will be composed by lastest news and lastest registered users, i think that create two partial views is the best idea (this way i could use it in other views).
for other hand i have a data access class that c...
I have a POST method declared in my controller:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UpdateComments(int id, string comments)
{
// ...
}
and an ActionLink in my view:
<%= Ajax.ActionLink("update", "UpdateComments",
new { id = Model.Id, comments = "test" },
new AjaxOpt...