.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Checkboxes with MVC 2 Create/Edit views

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

I'm currently writing a game review site in MVC 2.  I'm having some problems both figuring out exactly what to use as my view models and how to display checkboxes in my form for a many-to-many relationship.  My main models generated by EF4.

The biggest problem at the moment is trying to figure out how to create checkboxes for a game's platforms.  There's a many-to-many relationship between games and platforms - each game can be available on a number of platforms (PS3, XBox 360, etc.), and each platform has a library of games.  In my Edit view, I need to list all of the platforms and have the ones the current game is listed for checked.  I have the following view model:

public class AdminGameReviewViewModel
public Game GameData { get; set; }
public List<Genre> Genres { get; set; }
public List<Platform> Platforms { get; set; }

And is populated with:

public ActionResult EditReview(int id)
var game = _siteDB.Games.Include("Content").Include("Platforms").Single(g => g.GameID == id);
var genres = _siteDB.Genres.ToList();
var platforms = _siteDB.Platforms.ToList();

var model = new AdminGameReviewViewModel { GameData =

View Complete Post

More Related Resource Links

Create SQL Views / Forms etc...

Hello, I have a databases and I would like to create a form to update it by manual input from several desktops. What is the best way to proceed? - Views - Forms - Queries It is SQL Server 2008 R2 database. Thanks, DominiqueSystem Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 Support

How to create SharePoint workflow[Visual studio] with Infopath multiple views?

Hi Every body,I have Travel Request infopath form with 3 views(Requester/Manager/Traveldesk).Ones the user submitt the data then workflow will be start. In manager view he will select next level approver also. Ones manager approve/reject then pass to Traveldesk and they will forward travel inforamtion to user.I am new to workflow so How to approach my requirment any ideas and examples.Thanks in advance  

create new custom list form in sharepoint designer and edit in browser

hi, i have created a new list using sharepoint designer 2007. now i inserted a custom list form to modify some field and add new ones. when i finished i will tight my new custom list to the custom form. what i want to know is. i see the status field in my new form. and i only want the status field to appear in the edit form for the one that has the permission to edit the status. then i tought of open the list in my browser and go to the list settings. but what i notice is i dont see my fields i have modified in sharepiont designer in the columns section i only see the ones from the existing list. my question is how can i hide the status field in the new item form that it only show in the edit form. and how do i get my new form in the column section so the end user can add more fields if they want without using sharepointdesigner thnx

Show last edit user for views

Is it possible to record down the last userid that last edit the view?

Unable to Edit or Create Page under new subsites Moss 2007

I have created new subsites and trying to create a page, but it shows access denied error. Eventhough i have logged in as site collection administrator and given access as full control for subsite and also tried giving master page and style library read access. when i click on create page, I can enter the page name and after that it shows ACCESS DENIED . but the page is physically created and unable to edit.... Appreciate your help on this Issue....    

create task edit form issues for sharepoint 2010 workflow using visual studio 2010

I use infopath 2007 created a task edit form and I use VS 2010 to create a sequential workflow.I want to use the custom tash edit form in the workflow.The problem I got is the InfoPath form doesn't get deployed to sharepoint. I'm able to upload the infopath form to sharepoint though central admin app. here is the element.xml :<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  <Workflow     Name="WorkflowProject4 - Workflow1"     Description="My SharePoint Workflow"     Id="e6aa6cdb-667f-456a-b216-7639a1dcd3c7"     CodeBesideClass="WorkflowProject4.Workflow1.Workflow1"     CodeBesideAssembly="$assemblyname$">    <Categories/>    <MetaData>      <AssociationCategories>List</AssociationCategories>            <Task0_FormURN>urn:schemas-microsoft-com:office:infopath:TaskForm:-myXSD-2009-12-10T22-33-23</Task0_FormURN>      <StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>    </MetaData>  </Workflow></Elements>and here is the feature1.template.xml<Feature xmlns="http://schemas.microsoft.com/sharepoint/">  <Properties>    <Property Key="GloballyAvailable" Value="true" />    <Property Key="RegisterForms" Value="*.xsn"/>  </Properties></Feature>anything

create and Edit Virtual directory through c#


Hi All,

I am working in a .net C# .In my application I have to create in the
IIS>local computer>Web Sites>Default Web Site - virtual directory

and also I want to be able to
change properties of this vitrual directory (All process of creation virtual directory in the IIS I want to do programmaticaly).

I had make a program in C# for create a Virtual Directory.But i didn't able to edit its property..

After this i have to implement all this program in .Net Remoting 0r WCF.So please guide its possible and how to i make it ,Please members or seniors help me.I'll wait for reply..

Warm Regards:-
    Gourav Vishnoi
   +91-9871157845 (M)

Sharepoint Foundation - Create and deploy custom edit/view forms for external lists


Firstly, we are using sharepoint foundation so Infopath forms are not an option for us.

We have a Visual Studio sharepoint project which deploys a complete sharepoint site. The site contains a number of external lists and we want to be able to create customised view/edit forms for these lists and add them to our Visual Studio project so they can be deployed as part of the new site. The idea is that we can deploy the solution to a fresh site with a default set of forms which can then be customised for different implementations of the site.

Here's the steps we have been using to try and do this:

1. Deploy the base project (BDC) to the sharepoint site

2. Create external lists based on the BDC content types

3. Use Sharepoint Designer to create new edit/view forms for the lists and set these as the default forms for the list

3. Save the site as a template

4. Import the template into a new Visual Studio project and select the lists we require. This gives us a List Definition, a pages module (with element file), an elements file and a schema file (both for the List Instance).

5. We then add the contents of the imported project to our main solution as follows:

  • Create a new List Definition (including List Instance)
  • Copy the contents of the imported Elements.xml to the Elements file for our List Instance.

Fine-grained User Permissions, create and view with restricted edit rights


I'm running a Sharepoint 2007 installation which is slowly being rolled out through the organisation. We have a group of calendars which are shared between 14 executive PAs. I've been asked to lock down the permissions so that whilst any of the users can add items, only the user who created the item can subsequently edit this. I thought I could handle this by creating a new permission level with create and view rights only, which does what it should, however the user can now no longer edit their own appointments either.

Is there a way that I can give the item creator specific permissions on their item by default?

How to create a custom content type with own custom view ,add, edit and delete form in sharepoint fo


How to create a custom content type with own custom view ,add, edit and delete form in sharepoint foundation server 2010 using visual studio 2010?

I donot want to use default form "form.aspx".

we can use my custom form in place of "form.aspx"?

List views - Can I create a filter for tomorrow's items?

I'm setting up some views for a list, and I've already got "John's Tasks for Today" created.  Is there a way to create a view that shows the items that are due tomorrow?  I tried to do this with a filter.  "Show the items when column (Due Date) (is equal to)" and then I typed [Tomorrow] in the field.  I get the error message "Filter value is not in a supported date format."

.How to Create Views Displaying Cross-Web and Joined List Data



This is said to be available option, and was planned for the series. We unfortunately didn't see anything after part 3, and I am asking part 9 topic!

Any help will be appreciated. I want to show a list frmo root site in sub-web.


Edit post works, Add (Create) new not working


I am new to MVC and have created my first app using the NerdDinner tutorial, however creating my own app, but following along using the tutorial.  However I am having issues once I created a DropDownList, where the data will not save when creating a new record.  The code in the tutorial didn't work for me, so i've had to do a lot of searching on the web to get to where I'm at.  Basically I've gotten it to where on Edit it will save the data (I had to pass a prefix - which i think is where the issue is).  However for the create, when I submit the form, it acts like it isn't seeing any values actually submitted, and all display Null even though I'm entering data in the form.  I am using a form view model, and have an ascx file I use for both the Create and Edit.  Thanks in advance for any help.


<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<stemsapp.Models.ClassesFormViewModel>" %>

<% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>


Sharepoint designer - Create alternative edit form



I have a problem with creating a new edit page on an existing list. This list has lots of attributes (>50) and has some 800 rows of content.

I can open het site, create a new page from the existing update page, delete the web part. So far so good. But when I try to add a custom list form with my list and content type selected, I get a time out (Error Code 1460: Timeout Background: xxx).

What can I do about this ? I've tried it several times, but without succes. I tried it at the customer site using the VPN, I even went on site, but it just did not work :-(

Regards, thanks,

Marc Nemegeer

How to Create views with Standard Custom List Fields


Hi Guys !

I have a requirement to create views with the following fields along with the fields created by us.

How to create this view ? Do we need to use SPD or VS or can we do it in the SharePoint using browser directly?

   Content Type ID   

   Has Copy Destinations

   Copy Source


   UI Version

   Select (web part connection)

   Instance ID


   Effective Permissions Mask

   Unique Id

   Client Id

   Edit Menu Table Start

   Edit Menu Table End

   Property Bag

   Level etc...



Thanks & Regards




Trying to create a custom edit form but when i go over formfield: 62 I get a web part error


Trying to create a custom edit form. What i do is drag over the text box and bring it in to the page and specify is a what data field and format as a list form field. It displays perfectly in sharepoint designer but when i go to the actual page. It says "Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator."

Can someone please help with this because im trying to create a new employee application form or is there another easier way of doing this. Please help.

Permissions for a user to read data and create Views


Hello Forum

is it possible to allow users to read data and create views without giving them dbo privileges?

The SQL Server version is 2008 R2.

Please click "Mark As Answer" if my post helped. Tony C.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend