Mark Tabor

Mark Tabor

  • 585
  • 2k
  • 460.7k

How to show create view and list view on same razor view

Aug 1 2024 7:31 PM

Can someone show me a reference example to show create and list view on same razor view might be using partial view using viewmodels , Second quesstion how I can achieve cascade dropdown list in asp.net core like I have one table with columns 

(ID,STATE,SCHOOL)  ID IS INTEGER AND STATE AND SCHOOL BOTH ARE STRING NOW  the issue is I have different ID's as its unique and primary key but STATE Are same and Schools are different like below 
 

ID STATE SCHOOL
1 MAIN  A
2 SIDE B
3 SIDE C
4 MAIN D

NOW I WANT TO SEGREGATE THE TABLE BASED ON STATE NOT ON ID , LIKE IF I SELECT MAIN THEN ALL MAIN SCHOOLS LIKE A AND D should appear and when I SELECT SIDE THEN ALL SIDE SCHOOLS LIKE B & C appear both are text , can someone share how to achieve this in razor view , either using jquery ,javascript or normal view.
My first question is about how to show create and list view in one razor view .


Answers (1)