The context of the question is ASP.NET MVC2 / EF4. I have a number of lookup tables in the database which have previously been programmatically referenced, each from a number of other tables... So there might be a country table with country-id shortcode, desc, and half a dozen tables that have a countryid in them. Repeat for 5 or 6 other...
Hi all,
I have a long poll HTTP request using ASP.NET 4, MVC 2 and AsyncController. If a user closes their browser and kills the HTTP connection without the request completing, I'd like to know about it and completely clean up after them. If I don't, the open and incomplete requests just sit there and eventually IIS stops accepting new ...
Hi,
I am saving the user image in application domain file system. and storing path in database. I am getting the path in my User.PhotoPath property. I want to show image on page of this photopath . how to shwo it.
I am using the asp.net MVC 2 + C#.
Please guide me I am new in this environment.
...
Hi All,
I am creating a ASP.NET MVC 2 application where I want to generate a PDF report I have this code in my Report controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Text;
using System.Linq.Expressions;
using Microsoft.Repor...
I am using fullCalendar and I'm able to populate the calendar with events very easily. And I undertsand the best way to add events to the calendar is through the database. What I need now is to catch and populate an edit event form after the user clicks an event.
How would I do this when I am using asp.net mvc 2?
...
Hello,
How and where do I configure my application so that, when it launches, the action (thus the page to be displayed) be, not in the root structure, but rather in a given area of my choice?
Let's say, Action = "IndexOfArticles", Controller = "Articles", Area = "News". I want this setting to be the default when I launch the applicat...
Iv created an editor template for the boolean type. And it works fine in all modern browsers expect IE8 where any value changes seem to be lost when they are posted to the server.
I have read there are 'issues' with MVC checkboxs retaining their values, and as a result the Html.CheckBox helper includes a hidden field on the page to sto...
I'm trying to create an ASP.NET MVC2 route with a regular expression constraint to filter language names (like en-us, pt-br) but unfortunately it doesn't work. Have a look:
routes.MapRoute(
"Culture", // Route name
"{culture}", // URL with parameters
new { controller = "Home", action = "Culture" }, // Parameter defaults
...
I have a view that is displaying a Drop down list using the HTML helper DropDownListFor
<%: Html.DropDownListFor(Function(model) model.Manufacturer, New SelectList(Model.ManufacturerList, Model.Manufacturer))%>
My controller is passing the View a ViewModel containing the Manufacturer and the ManufacturerList
Function Search(ByVal ite...
I have a feature where users can submit pure XML in a form. When my server gets the response I will validate it against a XML schema then I store it in the database. I never show the XML on a webpage unless it is in a form for editing. I use the XML to render html forms or text in a webpage and I will encode the text and never show the a...
Hi guys,
I am struggling with generating outbound urls in asp.net mvc 2. Here is the scenario.
Controller: MoveController
Action: Index()
View: Index.aspx
Now what I would like is to have multiple urls mapping to same controller (MoveController) and action (Index) with different parameter (locationId) value
e.g.
url -> Rout...
Like many people using ASP.NET MVC, I've implemented my own custom 404 error handling scheme using an approach similar to the one described here: http://stackoverflow.com/questions/619895/how-can-i-properly-handle-404s-in-asp-net-mvc/2577095#2577095
(I actually discovered that post after implementing my own solution, but what I came up ...
Hi All,
As I am learning and working on Asp.Net MVC application, I want to know that what is the better place to write Business Logic and Data Access logic in MVC.
Where should I write DataAccess and Business Logic among three layers (Model, View and Controller) ??
Could anybody please tell me the correct way to write the code for thi...
I want to use NHibernate's Contextual Sessions in my ASP.NET MVC 2 application, but I'm having a hard time finding guidance on how to properly do this.
I'm interested in Session per request.
...
Hi could someone make a small example for me.
I wanna create a partial view with a textbox and a submit button.
When the user hits the submit button, I want to redirect to the following url
/Search/SearchQuery/
UPDATE
//This is my searchBox.ascx
<% using (Html.BeginForm("Index", "Search", new { area = "eCommerce" }, FormMethod.Pos...
So I have a ViewModel in the 'models' folder of my Mvc project with a namespace of 'Web.Models' (My Mvc project is called 'Web') I think its worth mentioning I have 3 other projects in my solution: Domain, Test, and Tasks. The view model is assigned properties from classes in my Domain.Entities folder. I can create a new instance of my ...
Hi - I'm a bit new to reflection in c#. I'm trying to generate a list of all controllers in order to test whether or not they are decorated with a specific actionfilter. When writing unit tests, how do you access the tested assembly?
This does not seem to work:
var myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
...
Hi!
I want to make my own authorization for my asp.net mvc2 application, I want to use the default LogOn user control, I add this code to user control:
<a id="log_in" href="#">log in</a>
<div id="dialog" title="Please sing in">
<p>Login:</p>
<p><input type="text" /></p>
<p><input type="text" /></p>
...
Hey there,
I'm trying to create a self referencing object using linqTOsql mapping. So far, I am definitely in over my head. Here's the code I have:
[Table]
public class Category
{
[Column(IsPrimaryKey=true, IsDbGenerated=true, AutoSync=AutoSync.OnInsert)]
public Int64 catID { get; set; }
public Int64 parentCatID { get; set;...
I have an application developed on MVC2 but I need it to change from HTTP to HTTPS after authentication. How do I manage that and where do I have to put the code?
Thank you,
Ignacio
...