Click here to Skip to main content
15,887,267 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Kornfeld Eliyahu Peter16-Aug-16 0:29
professionalKornfeld Eliyahu Peter16-Aug-16 0:29 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Usman ali16-Aug-16 19:46
Usman ali16-Aug-16 19:46 
SuggestionRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Kornfeld Eliyahu Peter16-Aug-16 20:06
professionalKornfeld Eliyahu Peter16-Aug-16 20:06 
GeneralRe: VS2012 cannot open MVC4 application - the system cannot find the file specified (exception from HRESULT 0x80070002) Pin
Usman ali24-Aug-16 22:27
Usman ali24-Aug-16 22:27 
QuestionAsp.net C# Export to excel stop working Pin
BigLitz15-Aug-16 6:57
BigLitz15-Aug-16 6:57 
AnswerRe: Asp.net C# Export to excel stop working Pin
Richard Deeming15-Aug-16 7:41
mveRichard Deeming15-Aug-16 7:41 
GeneralRe: Asp.net C# Export to excel stop working Pin
BigLitz15-Aug-16 13:14
BigLitz15-Aug-16 13:14 
Questionhow to make delete row from table using linq Pin
ahmed_sa14-Aug-16 7:20
ahmed_sa14-Aug-16 7:20 
In my Relation i have two tables relation (one to many)

table country

Id (primary key)

Countryname

table City

Id (primary key)

Cityname

Countryid (forign key)

I have controller City have the following function

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LinqProject.Models;
namespace LinqProject.Controllers
{
public class CityController : Controller
{
mytaskdbEntities db = new mytaskdbEntities();

// GET: City
public ActionResult List()
{
return View(db.Cities.ToList());
}


and in view of List as following

C#
<body>
<div> 
<table>
@foreach (var item in Model)
{
<tr><td>@item.Cityname</td><td>@item.Country.Countryname</td></tr>
}
</table>
</div>
</body>


What i need actually adding delete button to view of list of city

and i can delete city when click button delete

how to do deleting record by linq

the final result as following

USA NEWYORK DELETEBUTTON

USA WASHINTON DELETEBUTTON

FRANCE PARIS DELETEBUTTON

when click delete button for row USA NEWYORK it will delete

and remaining two record

USA WASHINTON DELETEBUTTON

FRANCE PARIS DELETEBUTTON
AnswerRe: how to make delete row from table using linq Pin
John C Rayan16-Aug-16 1:30
professionalJohn C Rayan16-Aug-16 1:30 
QuestionTrying to EDIT 2 separate, one-to-one database tables with ONE form/ViewModel Pin
TheOnlyRealTodd11-Aug-16 20:32
professionalTheOnlyRealTodd11-Aug-16 20:32 
AnswerRe: Trying to EDIT 2 separate, one-to-one database tables with ONE form/ViewModel Pin
F-ES Sitecore12-Aug-16 0:34
professionalF-ES Sitecore12-Aug-16 0:34 
QuestionPrintPageEventHandler not working when I upload my site to IIS Pin
awinash kr6-Aug-16 19:21
awinash kr6-Aug-16 19:21 
QuestionRe: PrintPageEventHandler not working when I upload my site to IIS Pin
Richard MacCutchan6-Aug-16 20:24
mveRichard MacCutchan6-Aug-16 20:24 
AnswerRe: PrintPageEventHandler not working when I upload my site to IIS Pin
awinash kr6-Aug-16 20:28
awinash kr6-Aug-16 20:28 
SuggestionRe: PrintPageEventHandler not working when I upload my site to IIS Pin
Kornfeld Eliyahu Peter6-Aug-16 22:35
professionalKornfeld Eliyahu Peter6-Aug-16 22:35 
GeneralRe: PrintPageEventHandler not working when I upload my site to IIS Pin
awinash kr6-Aug-16 22:47
awinash kr6-Aug-16 22:47 
AnswerRe: PrintPageEventHandler not working when I upload my site to IIS Pin
Richard Deeming8-Aug-16 1:35
mveRichard Deeming8-Aug-16 1:35 
Questionwebform Pin
Member 126713194-Aug-16 21:46
Member 126713194-Aug-16 21:46 
AnswerRe: webform Pin
Richard MacCutchan4-Aug-16 22:09
mveRichard MacCutchan4-Aug-16 22:09 
Questioninstallation of asp.net Pin
AMIT SINGH 20164-Aug-16 8:27
AMIT SINGH 20164-Aug-16 8:27 
QuestionCould not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
Otekpo Emmanuel2-Aug-16 6:33
Otekpo Emmanuel2-Aug-16 6:33 
AnswerRe: Could not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
jkirkerx2-Aug-16 9:19
professionaljkirkerx2-Aug-16 9:19 
GeneralRe: Could not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
Otekpo Emmanuel3-Aug-16 7:16
Otekpo Emmanuel3-Aug-16 7:16 
GeneralRe: Could not find a part of the path "\ASP.Net Practical\Website\Site1\UploadedImgs \".. Pin
jkirkerx3-Aug-16 7:40
professionaljkirkerx3-Aug-16 7:40 
QuestionRegarding DataTable width Pin
harikreddy31-Jul-16 21:48
harikreddy31-Jul-16 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.