에 기록하는 테이블 코드 URL에서 ID를 확인하고 내가 Interwier 테이블 여기</p> <p>이 데이터 테이블
CREATE TABLE [dbo].[Interwiers] (
[Interwier_id] INT IDENTITY (1, 1) NOT NULL,
[FIO] NVARCHAR (MAX) NULL,
[Email] NVARCHAR (MAX) NULL,
[Telephone] NVARCHAR (MAX) NULL,
[Birthday] DATETIME NOT NULL,
[City] NVARCHAR (MAX) NULL,
[Salary] NVARCHAR (MAX) NULL,
[English] NVARCHAR (MAX) NULL,
[Interview_Id] INT NULL,
[Status] NVARCHAR (MAX) NULL,
PRIMARY KEY CLUSTERED ([Interwier_id] ASC),
CONSTRAINT [FK_Interwiers_ToTable] FOREIGN KEY ([Interview_Id]) REFERENCES [dbo].[Interviews] ([Interview_Id]) ON DELETE CASCADE
)이다; 여기
내가 2093 지금
Interview_Id
인이http://localhost:51542/Interwier/Welcome/2093
같은 링크가
처럼 내보기 모습입니다이
public ActionResult Welcome()
{
return View();
}
// POST: Interwier/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Welcome([Bind(Include = "Id,FIO,Email,Telephone,Birthday,City,English,Salary")] Interwier interwierModel)
{
if (ModelState.IsValid)
{
db.InterwierModels.Add(interwierModel);
db.SaveChanges();
return RedirectToAction("WebCamCheck");
}
return View(interwierModel);
}
같은 데이터 테이블 외모에 쓰기에 대한 내 행동
ID를 링크에서 테이블로 작성해야합니다. 내가 어떻게 할 수 있니? Interview_Id에
HiddenFor를 작성하지
UPDATE 내가 ViewBag와 솔루션 및 얼굴 문제하려고
값은 enter image description here
왜 null가 아닌? 왜 쓰지 않는거야?
UPDATE
문제
@Shyju 방법 작동
해결된다. 감사의 친구
고맙습니다. –