Bubai Banerjee

Bubai Banerjee

  • 1.5k
  • 163
  • 43.3k

Previous and Next result display using Asp.net MVC

Jan 6 2014 1:10 AM

Dear Sir/Madam,
I am very new in the MVC coding. i have a below problem.please help me.Thanks in advance.
 
I have Three text box in asp.net MVC form. Author Id,Author Name and Author address.
I have two button(Previous and Next).when I click on the next button it will show one by one Author records from Sql server database.i used entity framework in MVC 4.
 
Design view in mvc
 

Author
@Html.DisplayNameFor(model => model.AuthorId)

@Html.DisplayFor(model => model.AuthorId)

 @Html.DisplayNameFor(model => model.Name)

@Html.DisplayFor(model => model.Name)

@Html.DisplayNameFor(model => model.Location)

@Html.DisplayFor(model => model.Location)

 <input type="submit" value="Previous" />
<input type="submit" value="Next" />

Database Details:
 
CREATE TABLE Author1
(
AuthorId INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
Name VARCHAR(100) NULL,
Location VARCHAR(50) NULL,
)
 
INSERT INTO Author1 VALUES('bubai','Kulti')
INSERT INTO Author1 VALUES('Ajay','Malad')
INSERT INTO Author1 VALUES('Rajesh','Kharghar')
INSERT INTO Author1 VALUES('Smita','Thane')
INSERT INTO Author1 VALUES('Amit','Burdwan')
INSERT INTO Author1 VALUES('Sumit','Golf Green')
 

select * from Author1
 
Please send me complete and simple code as i am very new(Fresher) in mvc coding.
 
Thanks for kind help.
Bubai Banerjee


Answers (3)