what is the best way to append data onto a file download? I figure that i can make my own class that implements InputStream and just consolidates two input streams (the file first, my additional data to append second.) but is there an existing view class that i can use to just return an InputStream or will i have to roll my own view cla...
Hello
I have a custom login-actionfilter where that I'm trying to "upgrade" to mvc 2 that uses areas.
private void RedirectToRoute(ActionExecutingContext context, object routeValues)
{
var rc = new RequestContext(context.HttpContext, context.RouteData);
string url = RouteTable.Routes.GetVirtualPath(rc,
...
Hello!,
I have a question about global.asax that I don't really understand. My scenario is that I have this route defined :
routes.MapRoute(
"Suspensions",
"Suspension/{action}/{id}/{prev}",
new { controller = "Suspension", action = "Index", id = "", prev = "" }
);
T...
I have a logoff action on a controller as so:
public ActionResult Logoff()
{
var x = Request.IsAuthenticated;
var y = User.Identity.IsAuthenticated;
FormsAuthentication.SignOut();
Session.Abandon();
var a = Request.IsAuthenticated;
var b = User.Identity.IsAuthenticated;
...
I am trying to write an html helper extension within the asp.net mvc framework.
public static MvcHtmlString PlatformNumericTextBoxFor<TModel>(this HtmlHelper instance, TModel model, Expression<Func<TModel,double>> selector)
where TModel : TableServiceEntity
{
var viewModel = new PlatformNumericTextBox();
var...
Hi I just opened up a project I done in MVC a while back, fired right up I looked at in the browser and now all the sudden it just wont find the [HttpPost] & [HttpPostAttribute]. What can be the problem?
errormessage
The type or namespace name 'HttpPost' could not be found (are you missing a using directive or an assembly reference...
Hello,
I would like to know is this platfoerm (MVC or WebForms) good technology of creating webBrowser based games and if so maybe You have got some tutorials, books, any resources which may be helpfull in beggining with such things.
thanks for help, bye
...
Hi
I have a page in MVC where i want to take the email adddress as the input which can be of format like:"Jone Davi" <[email protected]>, "Ben Miller" <[email protected]>, "Jane Ton" <[email protected]>,
Then from this I want to parse the valid emailaddress.But on click of the submit button getting error message" A potentially dangerous Reques...
This is probably a very simple question that I am working through in an MVC project. Here's an example of what I am talking about.
I have an rdml file linked to a database with a table called Users that has 500,000 rows. But I only want to find the Users who were entered on 5/7/2010. So let's say I do this in my UserRepository:
from ...
In my project I am using Autofac. Previously it was working fine. Now I have added some new code in Autofac and it's giving me "The creation delegate must not return null " error.
The changes that I have made are as follows
builder.Register<Rep>(c => {
/*Get Session and LoginId*/
...
Obviously, it's easier to do with some developers, but I'm sure many of us are on teams that prefer the status quo.
You know the type. You see some benefit in a piece of new technology and they prefer the tried and true methods.
Try, for example, DBA/C# programmer the advantages of using LinQ ( not necessarily LinQ to SQL, just LinQ in...
hi, i am having a dropdown box showing list of roles, i used Roles.GetAllroles() for showin' all roles in dropdown box but i don't wanna show a role named "Admin" in the dropdown box.
...
The question is likely confusing and I apologize. I wasn't sure how best to word it.
I am using jqGrid in a jQueryUI dialog which is inside a form. The user will use this form to create and edit Events.
Upon editing, the user can click a button to open a dialog showing a grid of saved locations for the event. I want to give them the...
When I publish my Asp.Net MVC website to the production server (via VS2008), the web.config & castle.xml files are overwritten. The content of these files is obviously different between my local dev environment and the production server.
How do I prevent these files from being published?
...
In my html, I use Model.Subcontract.company
How can I reference that data in my jQuery?
...
hi,
I have a logOn forn in ascx files and I render it as partial.
How I can add a clinet side validation to this form, have any idea ?
My below code does not work
<%= Html.ValidationSummary(true, "Giriş başarısız oldu. Lütfen hataları düzeltip tekrar deneyin.") %>
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm...
Hi All, i have an MVC app and i'm trying to deploy it to a 2008 server running IIS6 with .Net 4 installed. The project is built with VS2010. Thanks!
...
Given the follow classes:
using System.ComponentModel.DataAnnotations;
public class Book{
public Contact PrimaryContact{get; set;}
public Contact SecondaryContact{get; set;}
[Required(ErrorMessage="Book name is required")]
public string Name{get; set;}
}
public class Contact{
[Required(ErrorMessage="Name is required")]...
I'm designing a larger enterprise architecture and I'm in a doubt about how to separate the models and design those.
There are several points I'd like suggestions for:
- models to define
- way to define models
Currently my idea is to define:
Core (domain) model
Repositories to
get data to that domain model from a
database or other sto...
I have a page that a user selects what he wants to download, the submit button posts the form to
public FileStreamResult GetFiles(FileSelectionModel model)
{
//zips files into one zip
return File();
}
However, what if the model wasn't in a valid state? How do I check it? It wouldn't let me return View() or return RedirectToActi...