I'm new to web development. In my view, I want to conditionally show a button if Model.TemplateLocation (which is a string) is not null or empty. Below is the code that is rendering the button currently:
<div class="WPButton MyButton">
<%=Html.ActionLink(Model.TemplateLinkName, "DownloadTemplate", "ExternalData", new ArgsDownloa...
what im trying to archive is to load some images from external servers flickr, but i want to re-size the image before rendering, i want to know if there is any way to load that external image check the size and if its too big then with some c# code do the resizing and then send it to the client?
Thx in advance.
...
Hey all,
I have an ASP.NET MVC POST action for saving an entity on submit of a form. It works fine for insert but doesn't work for update, the database doesn't get called, so it's clearly not tracking the changes, as it's "detached". I'm using Entity Framework w/.NET 4:
//POST: /Developers/Save/
[AcceptVerbs(HttpVerbs.Post)]
...
The following are true:
One of my columns (BirthDate) is of type Date in SQL Server.
This very same column (BirthDate) is of type DateTime when EF generates the model.
I am using JQuery UI Datepicker on the client side to be able to select the BirthDate.
I have the following validation logic in my buddy class:
[Required(ErrorMessage...
I just installed the Azure 1.2 tools update and would like to get to work on an Azure project running locally using ASP.Net MVC and .Net 4, but I cannot get MVC pages to load.
If I just create a new Azure project in VS 2010, add a ASP.Net MVC web role, and run the application, pages never load. It appears that routing is somehow at f...
How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice.
If not use Ajax, it maybe much easier, just return View, but if use AJAX, what data structure should return?I just use Json to return the data, but i found each JSON data model return to the client browser, the JS have to use different code to p...
I have an asp.net mvc app with a form.
When you submit the form, it adds records to the sql database with linq-to-sql. After adding the records, the controller displays the form again, and should show those new values on the form. But, when it displays the form, the values are blank, until you refresh the page.
While tracing through ...
I am interested in looking for Step by step(screen shots) setup of nhibernate with asp.net mvc.... Any good links would be really useful...
...
I thought of using Fluent nhibernate for data access with my asp.net mvc web application...Any good article that describes about the setup of Fluent nHibernate with asp.net MVC web application...
...
Is there any way, in ASP.Net MVC, to condense the following code to a single foreach loop?
<table class="table">
<tr>
<td>
Name
</td>
<%
foreach (var item in Model)
{
%>
<td>
<%= item.Name %>
</td>
<%
}
...
I am having a model and I am using ajax.post. I can see that the model binding isn`t being done for the arraylists in my model, though binding done for the properties of int or string type. Why is that so? My code is as below.
I have a model with the following properties
public class ProjectModel
{
public int ID { get; set; }
...
I've Application based on MVC architecture.
- WEBproject
- BLLproject
- DALproject
In the web I use class "commands" attached to the pages "views" aspx.
I use a gridview connected to a ObjectDataSource (ods) with data stored in session.
the ods uses methods update, insert, delete to query a list of objects stored in session.
My probl...
I have a route with several optional parameters. These are possible search terms in different fields. So, for example, if I have fields key, itemtype and text then I have in global.asax:
routes.MapRoute( _
"Search", _
"Admin.aspx/Search/{Key}/{ItemType}/{Text}", _
New With {.controller = "Admin", .action = "Sea...
Why can't I set ShowForEdit model metadata with an attribute?
It seems that the only attribute provided to alter this is [ScaffoldColumn], which sets both ShowForEdit and ShowForDisplay, which is not what I want to do. I want to be able to annotate the two separately from on my model.
...
How are people currently profiling the performance of their ASP.NET MVC applications?
I'd be most interested in simple and free approaches.
...
While trying to learn Unity, I keep seeing the following code for overriding GetControllerInstance in MVC:
if(!typeof(IController).IsAssignableFrom(controllerType)) { ... }
this seems to me a pretty convoluted way of basically writing
if(controllerType is IController) { ... }
I appreciate there are subtle differences between is and...
Hi,
In a View, I've created a <form> that posts some data to another Controller, which is different from that one that redirected me to the View. In this second controller, i perform some data validations and then, if errors are found, I need to redirect the user again to the source View but with the edited ModelState (so that i can sho...
I am in search of a tutorial which leads through the setup of Fluent Nhibernate in an asp.net mvc web application... Any good tutorial....
...
I am migrating a site from ASP.NET MVC 1 to ASP.NET MVC 2. At the moment, the site supports the following routes:
/{country}/{language}/{controller}/{action}
/{country}/{controller}/{action}
/{language}/{controller}/{action}
/{controller}/{action}
The formats for country and language are distinguishable by Regex and have suitable cons...
Hi,
We're looking into using orchard cms for a project. I know the CMS hasn't been around for a long time, but I was wondering if there were any known high profile and successful case studies using orchard cms or its predecessor Oxite ?
Thanks.
...