When implementing a helper extension for a similar navigation widget to the one described in this article I notice that my HTML is now tied up in C# code, so if I want to re-skin the site with a new menu control that needs slightly different markup (e.g <ul class="foo">...</ul> or distinct class names for nested <li> tags) I now have to ...
I've been working through the book Pro ASP.NET MVC 2 Framework by Steven Sanderson. So far it's been phenominal... just when i think I know a decent amount I find a book that shows me just how little I know.
One of the things I know little about is how to use LINQtoSQL. In Steven's book, chapters 4-6 create a very nice little shopping c...
I have a custom IHttpHandler which is used by thick clients to download files using a url such as
http://url.ashx?id=123&version=456
the code handler basically ends with
context.Response.WriteFile(myLocalServerPath);
Is it possible to replace this using the typical asp.net mvc controller pattern ?
...
Following the example here:
http://www.highoncoding.com/Articles/689_Uploading_and_Displaying_Files_Using_ASP_NET_MVC_Framework.aspx
I have an .ascx file I'm using as an editor template, and I would like to use this method to upload files, my .ascx file looks like so
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<M...
Understanding question:
1.) "X_IndexViewModel" class
public class X_IndexViewModel
{
public List<SelectListItem> CheckBox_1 { get; set; }
...
}
2.) XController.cs
public ActionResult Index()
{
X_IndexViewModel viewModel = new X_IndexViewModel
{
CheckBox_1 = new List<SelectListItem>()
{
ne...
I'm writing an ASP.NET MVC site where I plan to use Lucene.Net for searching. Some of my site content has a location attribute, and I'm thinking of incorporating location into the searching functionality.
Does functionality exist in Lucene where, if I were to define latitude and longitude fields for my documents, the user inputs some co...
Is this a bug or a feature?
All code below has been simplified for the sake of brevity and easy replication and does not actually do anything useful other than highlight the behavior.
I have a class that includes an int named ID:
public class FooterLink
{
public int ID { get; set; }
}
In my controller, I have an Edit actionresul...
I'm looking at an example of a save method in a Products repository from Steven Sanderson's book, Pro ASP.NET MVC 2 Framework:
public void SaveProduct(Product product)
{
// if new product, attach to DataContext:
if (product.ProductID == 0)
productsTable.InsertOnSubmit(product);
else if (productsTable.GetOriginalEntit...
This question title is likely to be worded poorly so feel free to adjust.
In my MVC application I have a custom attribute which i use to decorate email fields which then either passes or fails the model.
On one pge though I allow the use to submit a comment but I submit via ajax and so do not do a full postback and no model validation....
I have a Model that has several properties. When I submit a form, I pass along the values for those properties (generated by the jQuery $.serialize() method) and they are automatically bound. This works without a problem. However, now I want to add an Id to the string, and I have to do it manually since it's not a form field. I've done s...
I know similar questions have been posted before, but I have specific requirements that make this as far as I can find unanswered.
The project wants to have a typical 3-tier architecture, but they want the data layer to be abstracted by Entity Framework, the presentation layer to be MVC 2 and the application layer to be simple class lib...
If I have a model;
Name
[Required]
FirstName
[Required]
LastName
If I create the model in my jQuery postback thus;
Name name = new Name{ FirstName = param1, LastName = param2 };
Is there a way I can validate it using the data annotations that decorate the fields?
This is not happening in a postback event on the view, it's ...
Hello,
I noticed in the solrnet examples it is not possible to drill down into search results. That is, you are presented with a list of products but cannot see the details for those products.
My question is as follows:
The MVC controller that calls SOLR and populates the index page essentially contains the model for each detail view...
I have this simple snippet with an ActionLink that is supposed to display some text as a link, but it's not working.
Here's the code snippet.
<div id = "Div1">
<table id = "Table1">
<% while ((category = SomeNamespace.Helper.GetNextCategory(categoryIndex++)) != null)
{ %>
<tr>
...
This should be simple and I don't know why the compiler is complaining.
I have a view and I want to shorten this call inside it:
<div id = "catalog">
<table id = "catalogContainer">
<% while ((category = SomeNamespace.Helper.
GetNextCategory(categoryIndex++)) != null)
to not quali...
Sometimes the dang thing works and at other times it doesn't. I have many tables in my app and the CSS for all of them is working. There's nothing different for this one, except for it, the CSS isn't being applied, God knows why. Help.
table.catalogContainer
{
border: none;
padding: 50px;
margin-left: 100px;
margin-right...
Is there a good reason to use the strongly typed html helper...
<%: Html.DisplayTextFor(model => model.Email) %>
As opposed to...
<%: Model.Email %>
...
I have a partial class in a dbml file.
public partial class Comment
string email
Clearly I can't put a decorator on it because this is a generated file and you shouldn't make change in it yourself.
So I created another partial class;
public partial class Comment
[IsEmailAddress]
string email
The above doesn't work but I need...
I'm working on an ASP.NET MVC App that has buttons that have the server return an rdp file, which is created by my business layer.
What I want is to be able to have the server create this rdp file, then serve it, without having it stored on disk.
What would be the best way to go about this?
Thanks.
...
Hi all,
I currently have a web application written by ASP.NET MVC. Now I want to add a web service so that some people can easily build application upon it. Shall I just create the asmx in the MVC Web project or create another project referencing to the Model project? And what's the pros and cons?
Thanks in advance!
...