Has any one ever downloaded and made use of the mvcContrib template gallery for asp.net mvc. I cant find where to download the templates from and there is no documentation for how to use it?
...
I am working on a CMS managing my website's pages' static content. There is a PageController (the default route www.mysite.com/pages/2/page-title is used) and the corresponding Views displaying the pages' static content that can be managed using WYSIWYG editors in the administration interface.
I need to be able to specify that any arbit...
When I have the following action in a form tag, what does the '/Account/Profile` part mean?
<form method="post" action="/Account/Profile"
Is it a Filename for a view? Is it an action?
...
For some reason the paramater OriginalLocation is always null in the following code. What am I doing wrong?
Controller:
[HttpPost]
public ActionResult File(HttpPostedFileBase OriginalLocation, FileModel model)
{
byte[] binaryData = null;
if (OriginalLocation != null && OriginalLocation.ContentLength > 0)
{
bi...
Hello,
I have 2 tables, master, detail.
1.master table have fields (id, username, plan)-->id is primary key (PK)
2. detail table have fields (srNo,id, worksummary, ... )--> srNo is PK.
I have created foreign key relationship from detail to .master table for "id" field.
the code is:
IList<detail> objDetail=new List<detail> (); ...
Possible Duplicate:
Whats your choice for your next ASP.NET project: WebForms or MVC?
Can you list some reasons that would make you use ASP.NET webforms for a new project, instead of MVC? I've heard a lot about the opposite, but not things that are done easier or better with webforms. I'm not talking about developer preference...
In my ASP.NET MVC app, I have an interface which acts as the template for several different view models:
public interface IMyViewModel
{
Client Client1 { get; set; }
Client Client2 { get; set; }
Validator Validate();
}
So, my view models are defined like this:
public interface MyViewModel1 : IMyViewModel
{
Client Cli...
I'm working on a sortable table, that is refreshed asynchronously when the column headers are clicked. The parameters determining the column I'm sorting by and the direction are stored in the query string. The first time I click the header, the table is sorted by that column ascending, the second time it's sorted descending. But the thir...
Hi,
I am trying to bind a dynamic array of elements to a view model where there might be missing indexes in the html
e.g. with the view model
class FooViewModel
{
public List<BarViewModel> Bars { get; set; }
}
class BarViewModel
{
public string Something { get; set; }
}
and the html
<input type="text" name="Bars[1].Someth...
What can I do to avoid the repeated loading of static data every time a page is loaded in ASP.NET MVC2? This is pretty wasteful, and I would like to fix it.
My master page has the typical User Name + Company Name display in the top right corner. But because of the stateless nature of MVC, this data has to be looked up every single time...
Hello,
Let's say I have a page view called "PagePreview.aspx". on that page I've placed a UI tab Widget with 3 tabs, tab 1, tab2, and tab3. there's a link on each tab that leads to different pages on the site.
When the user accesses the PagePreview, I'd like a tab to be pre-selected depending on the view where he comes from. For insta...
I'm using an Anti XSS Output encoder similar to the one htat Phil Hacck put forward here
Unfortuantely, it's running rampant over my Site.master and fouling up the meta-tags like so:
<meta name="robots" content="all, follow" />
And in Site.master it is written simply as:
<meta name="robots" content="all, follow" />
Which woul...
I have a controller action declared as follows:
[Authorize(Order = 0, Roles = "Requester,Controller,Installer")]
public FileStreamResult ExportJobCards()
The body of this method builds a collection of CSV lines, and attempts to return them as a file as follows:
using (var sw = new StreamWriter(new MemoryStream()))
{
foreach (var ...
I want to save images that are uploaded with httppostedfilebase into a database.
How do I do this? How do I structure the database fields? What code do I write to save it to the database?
...
Related to my previous question on this matter, where the file was not being produced, the file returned by the following code is now empty. My controller action is declared as follows, then has a body that generates CSV lines from records for export. The CSV generation works.
[Authorize(Order = 0, Roles = "Requester,Controller,Instal...
I am wondering how to ensure that an employee cannot access information from another company). This is not an authentication / roles based question on applying roles or permissions to actions, but rather ensuring that the data somebody is try to access actually belongs to them.
Users belong to a department which in turn belongs to a com...
Hi
In ASP.NET MVC 2 <%: tag was introduced to replace <%= for Html helpers. But what does it mean and what is the difference to the previous one? When shall I use <%= and when <%:?
Thank you
...
I have saved an image on the database and want to display it to the user.
The table the image is stored in looks like this:
Images
------
ImageData Byte
ImageName String
ContentType String
What should I do to load and show it in my View?
...
I have been working in an MVC project, and have seen both of these used. I was wondering what the difference between them is? Is it incorrect to use one over the other? My understanding is that I should be using Url.Content(), but VirtualPathUtility.ToAbsolute() seems to be working as well.
...
I'm trying to create a form which will be used by clients to place an order for variable amount of models. It's similar to example from Steve Sanderson's blog, but I'm not using any javascript - I just have multiple submits in my form.
Everything works fine, I can add as many items as I want, but when I delete an item always the last on...