Hi there, I'm using a configuration within the global.asax.cs to register the components but it looks the container hasn't been initialized yet at the first http request (HomeController > Index action) and it gives me a "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection." erro...
Hi,
I have a DateTime field in my Model. If I try to use this field in a strong typed partial view this way
<%= Html.TextBoxFor(model => model.DataUdienza.ToString("dd/MM/yyyy"), new { style = "width: 120px" }) %>
I will get the following compilation error at runtime
System.InvalidOperationException : Templates can be used only wit...
I have an MVC application, and I need to create and store a unique session Id for each application instance. In standard ASP.NET this is easy, I would have simply added a hidden field in the master page and stored a Guid there on the first Page_Load.
However, there is not code behind in MVC, and I also believe that you can't implement a...
I would like to have a simple sample NH project that you would consider best practice that people could refer to when getting started with NH?
I've been using it for a couple of months now and still struggle with the numerous ways there are to do things but not knowing which is the best approach to follow.
...
This is odd, and I hope I explain it correctly.
When I debug locally with VS2008, IE8 looks like FF and Chrome (minus the obvious). It works well, and I'm happy.
When I use IE8 with our IIS6 box (Win2003) or Cassini, buttons aren't aligned, javascript errors occur, and some other CSS anomolies occur: Table cells missing colored bor...
I have something like this
<%using (Html.BeginForm("X", "Y", FormMethod.Post, new { id="Z" })) { %>
<table align="center" style="width:70%;margin-bottom:15px;" cellspacing="5px";>
<tr>
<td width="40%">Nr.:</td>
<td width="60%"><%=Html.TextBox("Nr", Model.Nr, new { width = 130, maxlength = 10 })%></td>...
Why can't I pass in html attributes to EditorFor()? eg;
<%= Html.EditorFor(model => model.Control.PeriodType,
new { disabled = "disabled", readonly = "readonly" }) %>
I don't want to use metadata
Update: The solution was to call this from the view :
<%=Html.EditorFor( model => model.Control.PeriodEndDate, new {Modifiable=mode...
Decided to learn ASP.NET MVC and instantly got stuck on something simple.
In Web Forms user controls allowed to separate application into components based on functionality and facilitated reuse. It seems partial views are supposed to do something similar in ASP.NET MVC, but either I am getting this wrong, or each visible page is handled...
I am using Javascript's setInterval method to keep on updating the time of the Client computer. This is my code:
$(document).ready(function() {
setInterval(function() { setCookieForDate(); }, 500);
});
function setCookieForDate() {
var cookie_date = new Date();
var serverDateTime = '<%=DateTime.Now%>';
document.cookie =...
I have a javascript function that works in IE7, but is giving me trouble in Firefox.
JAVASCRIPT
function vehicleSelected() {
var ddlSelect = document.getElementById('ddlSelect');
var displayTable = document.getElementsByName('listTable')[0];
var strAuto = ddlSelect.options[ddlSelect.selectedIndex].value;
alert("ok, so far...
Hi everyone,
There is web site that is consuming wcf service and it's been working good for some time.
I changed one ws method, by adding to it one parameter.
Prior to copying files to destination, i built projects, published them locally, removed config files so they don't interfere with existing files, stopped services, copied files...
This thing was not noticed to be slow at first because there were not many 'tree nodes' in the database. Now it's really slow, at a glance is there anything major that is wrong with this? I really need to optimize it and before I rework the entire thing I was wondering if anything stands out as being the real pain point. I have narrowed ...
I have three databases, x, y, z. Let's assume MS can speak to all of them via odbc or something else.
When I was in webforms I would create a tableadapter and conduct a query. I could do this for each connection I had, so I had three queries.
I would drop each connection and dataset on my page. Each control I used would call the app...
I am currently building an ASP MVC 2 site and I am looking at hooking ELMAH in for my error logging however I'm not sure how to handle the different build environments.
Both my development machine and current test server are 32-Bit and the production server is 64-bit. I can set the MVC site to deploy in x86 and x64 without any problems ...
I am thinking of using nHibernate.Burrow in my mvc.net application. However there are several troubling things that I have read and I am hoping to get them sorted out before I embark on the project:
Are there any issues with running .Burrow with mvc.net?
Are there issues with running .Burrow with the 4.0 framework?
How tightly couple...
What are the best practices when it comes to mapping controllers to views? For example, say for the urls mysite.com/login and mysite.com/register...I can have my LoginController and a RegisterController map to Login/Index.aspx and Register/Index.aspx views. Alternatively, my HomeController could handle both of these and map them to Hom...
In my ASP.NET MVC application I have a custom cache provider inherited from base OutputCacheProvider class. Is there any way to get output cache profile for current request in my provider?
...
I need to upload images to my website, make some image processing(resize, get image size\resolution, convert to jpg format etc ) and then embed it to page of my website.
I have a few question:
How to check that uploading file is image?
Where is better store images - mssql or just folder?
How to detect image type. Is MIME trust source?
...
So, I personally think this is sort of whack.
I put a .aspx template in a nonstandard location. In this example, it has a virtual path of ~/Content/Sites/magical/Index.aspx.
I then created my own view engine as a test, which extends WebFormsViewEngine:
public class MagicalWebFormsViewEngine : WebFormViewEngine
{
public override ...
Is there a way to create my own charting palette in which I can specify my own colors?
The ones that are available from
chart.Palette = System.Web.UI.DataVisualization.Charting.ChartColorPalette. //palette
do not really fit in with our design, so creating my own would be nice if this is possible thanks!
...