I have 2 different lists: EmployeeNames and Names
I read the values in Names and that of EmployeeNames.
If EmployeeNames exists in Names, I must not add that value to "ToSelectBox" but to "FromSelectBox".
If EmployeeNames doesn`t exist in Names, I must add that value to "ToSelectBox" but not to "FromSelectBox".
How can I do that dynam...
I'm using CakePHP but it's a question about the MVC pattern. I have in my form the input-text for the tags (separated by commas). To add the tags I've created a Tag model method that basically check if the tag exists and then add the new tag or just a new unit in the tag counter (the Tag model has these fields: id, name, slug, count).
In...
Is it correct to implement my caching object like this in my controller :
public class HomeController : BaseController
{
public static Cache cachingControl = new Cache();
...
And I Use it like this :
public ActionResult Home()
{
IndexViewData view = new IndexViewData();
view.UserId = UserId;
if (cachingControl.Get("view...
Hi
I am using MVC (C#) and the Entity Framework. I have a sql server database with tables called Profile, Gallery, ArtWork :
PROFILE:
UserName,
FirstName,
etc...
GALLERY:
GalleryID,
UserName,
GalleryName,
ARTWORK:
ImageGuid,
GalleryID,
Description,
PublishDate,
Views,
Downloads,
I have the following relationship between the tables:
...
I want to have a menu that when I click replaces the content of a "main" div with content from a mvc view. This works just fine if I use a .aspx page, but any master.page content is then doubled (like the and any css/js). If I do the same but uses a .ascx user control the content is loaded without the extras, but if any browser loads th...
I have a form that has a series of check boxes and some line items have a text input next to them that defines quantity of the item.
<input type="checkbox" name="measure[][input]" value="<?=$item->id?>">
<input class="item_mult" type="text" name="measure[][input]" />
What is the best way to capture the integer from the input field a...
I'm trying to process this array, first testing for the presence of a check, then extrapolating the data from quantity to return a valid price.
Here's the input for fixed amounts of items, with no variable quantity.
<input type="checkbox" name="measure[<?=$item->id?>][checked]" value="<?=$item->id?>">
<input type="hidden" name="measure...
In Area VIPUsers I have controller ProfileController and other controllers.
If I want every method in ProfileController to have parameter (id)
and every method in other controllers to have parameter (userid and id)
how would I map it?
Would it be
context.MapRoute("ProfileMapping", "VIPUsers/Profile/{action}/{id}",
new {controller="M...
Hi all,
I have got a question with regards to upgrading asp.net mvc applications from v1 to v2...
I've noticed in the ASP.NET MVC v2 Release notes that we need to add this code (please see below) when upgrading, but it did not state what would be the purpose of it because I've tried experimenting some of my apps to asp.net mvc 2 withou...
I'm not getting back data from my DB like I'm expecting. I know that I can get data from the DB because I have other functions working. With this page, what I'm trying to do is the following:
If no postback, then I would like it to echo "No Category Selected"
If a category has been chosen, then I would like for it to get that data from...
I want a visual tool to build the html for my ASP.NET MVC views, and Expression Web 3 is on sale. Alternative would be Dreamweaver. But I have not used either tool so I don't know if they 'play well' with MVC. I basically want a tool to design a clean, professional looking web front end without having to type up all the HTML by hand i...
Hi guys,
I'm working on a site which i'm developing using an MVC structure. My models will represent all of data in the site, but i'm struggling a bit to decide on a good controller structure. The site will allow users to login/register and see personal data on a number of pages, but also still have access to public pages, e.g FAQs, Co...
Up until now, I have maintained a 'dictionary' table in my database, for example:
+-----------+---------------------------------------+-----------------------------------------------+--------+
| phrase | en | fr | etc... |
+-----------+---------------------...
We are using MVC in our application; the Views we are using get created by other team. The problem is that they use their own names for input HTML controls which are different from the input text-box names in the Model. I have a strong feeling that this issue had already been addressed somewhere but cannot find any references. Could anyb...
I intended for this function to call my MVC action method that returns a CSV report.
$(function() {
$('#exportButton').click(function() {
$.get('/curReport/GetCSVReport');
});
});
If I make a button like the code below then, when it is clicked, I'm given the "Open with/Save File" window.
<input type="button" value="Ex...
If you read this article on Validation with the Data Annotation Validators, it shows that you can use the MetadataType attribute to add validation attributes to properties on partial classes. You use this when working with ORMs like LINQ to SQL, Entity Framework, or Subsonic. Then you can use the "automagic" client and server side vali...
I implemented a custom Profile object in code as described by Joel here:
http://stackoverflow.com/questions/426609/asp-net-membership-how-to-assign-profile-values
I can't get it to work when I'm creating a new user, however. When I do this:
Membership.CreateUser(userName, password);
Roles.AddUserToRole(userName, "MyRole");
the user...
I've a backend module which could only be accessed by authorized members. So I need to check authenticity for all actions and for all controllers. Currently I'm doing it inside preDispatch() functions inside controller classes. So it takes care of all the actions inside that controller. But still I've to do it for all controllers. Is the...
Hi.
I have a simple search form in my master page and a serach controller and view.
I'm trying to get the following route for the string search term "myterm" (for example):
root/search/myterm
The form in the master page :
<% using (Html.BeginForm("SearchResults", "Search", FormMethod.Post, new { id = "search_form" }))
...
Hi, How can I create a helper like the Html.Form helper, which closes the tag when you close the braces?
...