I have certain entities that have audit trail elements like LastUpdated and LastUpdatedBy. I am looking to determine the most appropriate way to effect an update of these fields to the current date and time and current user when a model is changed.
The simplest implementation would be to affect this change in my controller before I upda...
In my
public ActionResult Active()
{
var list = _entity.CALL_UP.Where(s => s.STATE == ICallUpsState.FULLY_SIGNED)
.Where(f => f.START_DATE <= DateTime.Today
&& f.END_DATE >= DateTime.Today)
.ToList();
return View(list);
}
This r...
Hey There
I have a ViewModel:
public class Page
{
public int Id { get; set; }
public Page Parent { get; set; }
public string Name { get; set; }
public string Title { get; set; }
}
I am passing that model to a view, and i need to create a hierarchical menu based on the model:
<ul>
<li>Page
<ul>
...
I'm faced with setting up a system which will allow users to:
Hit a button to initialize a "download & archive" command, which reads file lists via XML, pulls files over HTTP to a local directory, archives them, and stores them away for download.
Get a progress bar/indicator telling them their "request is being processed" immediately a...
Hi Guys,
Please find below my ActionResult Index:
public ActionResult Index(string SectionText)
{
var products = from p in db.Products
where p.CategoryID == SectionText
//orderby gs.SortBy
select p;
return View(products.ToList());
}
This is throwing the error below: -...
Also RenderAction and Action.
RenderXXX akaik write directly to response stream and XXX use additional string buffer.
I don't really want doing benchmark my myself, so maybe someone already do it.
...
I'm writing a jQuery grid plugin and I've designed it so it works independently from the language being used. The following is the basics of how my plugin is assigned:
$("#grid").grid({
enablePager: true,
dataPath: "Movement/GetGridPage",
columns: {
Edit: { title: "", cellCallback: editButtonCallBack, width:"16px" }...
I'm trying to use the swfupload plugin to upload files. The thing is, I want the user to be able to switch the directory to upload to.
The strange thing is (and maybe this is due to my limited knowledge of jQuery) that it seems like I have the correct directory when checking it with an alert, but still the upload goes to the previously ...
I want to make a login system just like Stackoverflow's which have at least Facebook, Twitter and Google openid system.
Is there a all-in-one library for this purpose which can be used in Asp.Net Mvc 2?
...
I've mostly worked in MVC1. I'm now working with some MVC2 code. I have fields with Strongly Typed Html Helpers like:
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Contract.client_name)%>
<%: Html.ValidationMessageFor(model => model.Contract.client_name) %>
</div>
How do I acce...
Hi all,
I'm trying to use WCF Data Service with Subsonic, but ran into this error when I try to access my "service.svc". I have 2 projects, one is a class library (called "OData") that has Subsonic t4 templates to generate the classes for my table. Another is an ASP.NET MVC2 project that references to the "OData" project.
I then create...
Here is a multilang table design. Is it possible to add a method for my CategoryText model to give me the CatName for a specific langID. LangID will be chosen by the customer and set in Session variable.
EXAMPLE :I would like to get the category name like this
var a = _db.Categories.Single(a=> a.AreaTypeID == 2);
string CatName = a....
I have a ASP.NET MVC 2 app I am building and users are allowed to post data in certain sections. I would like to display the "Posted At" in the same format that Stackoverflow and Facebook do.
i.e. On this site when I post this question it will display "asked 3 seconds ago" then "asked 3 mins ago" and after a few day it will display the...
I want to create an async version of my page to speed it up. However, the number of async requests I need depends on the user's personal settings.
For example, I have a dashboard that can display numerous things. I want to do something like this:
public void IndexAsync(string city) {
AsyncManager.OutstandingOperations.Increment(3);
N...
This has been asked before by others, but I have not been able to use their answers.
I am trying to sending some data by doing the following:
function addForumPost() {
var title = jQuery('#forumTitle').val();
var message = htmlEncode(jQuery('#message').htmlarea("toHtmlString"));
var tagNames = addTa...
I've got index of my elements:
<h2>Index</h2>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('button').click(function () {
$.post("Home/Swap", $("#log...
I deployed my first ASP.NET 4.0/MVC 2 application onto a staging and test server. The problem is that when I browse to the application I just get the ASP.NET 404 "The resource cannot be found." page.
The application was written using:
Visual Studio 2010 Premium
Target Framework: .NET 4.0
ASP.NET MVC 2.0
The application is deployed o...
I get this error:
a different object with the same
identifier value was already
associated with the session: 63, of
entity: Core.Domain.Model.Employee
Within my ASP.NET MVC controller actions I do this:
public ActionResult Index(int? page)
{
int totalCount;
Employee[] empData = _employeeRepository.GetPagedEmployees(p...
Hi everybody,
I have a situation with my ASP.NET MVC 2 application that when I use [Authorize(Roles = "Admin,User,Test")] attribute on any of the controller methods, my custom role provider is not called. Tricky part is that when I run the application in visual studio web dev server, this GetRolesForUser is called every time. When I ins...
I'm having trouble trying to understand what to do here.
My objective isn't as simple as a regular old CRUD form to create a new entity, but rather a browse index page that will list all of the Evaluations in my database.
Each evaluation is attached to a RegisteredCourse which in turn has a Teacher attached to it.
Here is how I'd like...