I'm attempting to create a generic controller, ie:
public class MyController<T> : Controller where T : SomeType
{ ... }
However, when I try to use it, I'm running into this error everywhere...
Controller name must end in 'Controller'
So, my question, Is it possible to make a generic controller in asp.net mvc?
Thanks!
...
I have IIS 5.1 on a XP machine, and visual studio 2005. How do I go about attaching my debugger to IIS instance.
BTW: I'm not seeing the IIS process within the running processes or probably I don't know what to look for .
...
I have two results from a data set. I want to add both results in one gridview column. I do not want to merge in the code behind. Is there another way to do that?
<asp:TemplateField HeaderText="Entered Date" SortExpression="Date">
<ItemTemplate>
<div style="text-align: center;">
...
While trying to implement an MVC file upload example on Scott Hanselman's blog. I ran into trouble with this example code:
foreach (string file in Request.Files)
{
HttpPostedFile hpf = Request.Files[file] as HttpPostedFile;
if (hpf.ContentLength == 0)
continue;
string savedFileName = Path.Combine(
AppDomain.CurrentD...
Can anyone hijack (via js) the asp.net forms cookie and change the expire date?
What can stop them from grabbing it and changing the expire date? i.e. effectively letting the user stay logged in?
Update
Does the .net framework forms auth. cookie rely on the cookie's expiration date or does it encypt that?
...
I have a VS 2005 Web Site project (not the web application project model, the 'web site' project model) and I want to be able to include the PDB files for the page assemblies in the bin folder via the "Publish Website" command within Visual Studio to help out with debugging an issue.
No matter what I try with regard to the "Debug/Releas...
Hello,
According to my book, if role management is enabled, then RoleManagerModule creates the security context of the user by assigning RolePrincipal object to the HttpRequest.User. But isn’t security context already created ( thus principal object being assigned to HttpContext.User ) by FormsAuthenticationModule, which is called pr...
I am barely starting out with my first project on the ASP.NET MVC project type and I am creating a Details page where instead of passing the templated (int id), I would like to pass a string instead. But when I am in debug mode, and enter this in the URL, "myString" is null. Why so? Do I have to change anything else somehwere else?
S...
I am creating an ASP.NET application in which the administrator of the program will be able to define custom fields for forms that the users will fill out and submit.
The admin needs to define various types of fields like checkboxes, radio buttons, textboxes, and textareas for the user to fill out. The admin also can define whether thes...
Hi,
My goal is to write a cookie when the user authenticates. We are using a crappy framework that hides its source code and event model so when I use their login control I can't set a session timeout on it!
Anyhow, I am trying to write a cookie when the user is logged in, and then refresh the cookie expire time on subsequent page vie...
Is the generated aspnetdb.mdf ever meant to be used online? It has been a while since I looked at it, but from what I remember the generated username database could only be configured and maintained locally within your visual studio environment. Is this still true? Does anyone use this online for big apps?
EDIT:
I ask because all th...
I have an asp.net web form application running in a web farm?
All the machine keys are configured the same in web.config according to MSDN recommendation, still, it periodically throw out "System.Web.HttpException: Invalid viewstate.", and according to the stack.
It's in this line
Request : /{applicationname}/ScriptResource.axd +92
N...
I don't want to do anything fancy on Twitter except post to it via my site once a day. I have searched around a bit and there are all sorts of super-complex ways to do every little thing that Twitter does, but there seems to be little documentation on how to do the simplest thing, which is make a post!
Does anyone know how to do this? O...
I am working on an asp.net 3.5 project which has 55 projects in a solution. When opening the solution in visual studio 2008 it takes over a minute to open - about 1 second for each project. However, if I disconnect the network cable before opening the solution, it only takes about 15 seconds! Any ideas about what could be causing the ...
I am working on a traditional WebForms project. In the project I am trying out some Linq datasources with plans to eventually migrate to an MVC architecture. I am still very new to Linq.
I have a GridView using a Linq datasource. The entities I am showing has a to many relationship and I would like to get the maximum value of a column i...
I'm creating a JsonArray such as:
JsonArray jsonValues = new JsonArray();
for( int i = 0; i < values.Count; i++ )
{
var someSingleValue = values[i];
jsonValues.Add( string.Format( "Name: {0}", someSingleValue ) );
}
After that I'm shipping json values to my javascript in .aspx page via call:
HtmlPage.Window.Invoke("call", js...
How should I handle a custom property in a situation where I use partial classes with the EF-generated classes?
Here's the setup:
TimeSheet Table - this stores an employee's hours
- TimeSheetID (auto, int, PK)
- EntryDate (DateTime)
- Hours (int)
- EmployeeID (int)
EmployeeHourlyRate table - this stores an employee's current hourly r...
I'm running .NET on a windows box and I would like to have a function run every night at midnight. Of course since HTTP stateless and Windows doesn't have a "cron job" type function (that I know of), I will either have to visit my site myself every night at midnight or just wait for a user to visit the site to rely on it being updated.
...
I have an asp.net mvc project, and I replaced the default css the wizard built with the iui css and javascript package. They were placed in ~/Content/iui/ folder. When i ran the site through the dev web server, the css didnt get used. I managed to fix it by adding the iui folder to the project in the project explorer. That's all I di...
I've got a virtual directory with a vast subfolder hierarchy and thousands of classic ASP files, all of which have varying permissions set at the NT folder level (don't ask.. shakes head).
Is there any way to setup all these virtual directories with their own web.config so i can control access via configuring system.web.authorization p...