How to create a simple blog using asp.net mvc c# 4.6 bootstrap

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends welcome to my channel this is Sharon in this video I will show you how to create a simple custom block in Embassy and here we got the final output notice the latest blocks is displaying at the top after that in the navigation menu our blog name is a sample blog and the menu contains the home owner which is an index view the click for so notice here I'm getting only the food articles if I click sports the sports articles and then click movies the movie articles displaying all the articles let's check in the database right now this table condensed for articles to food 1 movies and 1 sports category we want to read the article and here we got the article of the world's best opt and further that's it we have created a simple blog and if you are a first-time visitor to my channel please subscribe to get the latest updates before writing the coding part in MVC first we'll create a new table in SQL Server management studio and Max finding the root folder as well as the databases in this database as the node is there is a new TB which is a user database I want to create a new table in this new DB tearaways select the new DB database right-click the mouse go to new query let's create a table [Music] let's add the columns the ID which is a blog id integer type not now it's a primary key and I'm adding the identity column 1 comma 1 block title and Val caps 150 blog category and 150 and description and the blog URL is inverted let's create a table execute and here we got a massage command completed successfully let's check this block table is added or not in this new DEA database let's expand the new DVD editors as well as a tables folder let's refresh the tables and here we got the blog table is added successfully into a new DB database let's browse a table blog it's not top thousand dollars right now this block table contains zeros let's insert the block details using a museum for this video tutorial I'm creating a new MVC application go to file new project and from the web templates I'm selecting asp.net web application and the dotnet framework am using 4.6.1 the application name is MDC is my project name click OK and from the earls product on campus I'm selecting Emma C click OK and the project is created successfully let's closes output mrs. box open solution Explorer first in this project I am adding ad word dotnet entity data model right click the project name had and selecting L do doesn't entity data model the model name is and from the model contents and selecting the first option if design firm data is good next let's create a new SQL Server connection I'm adding after adding as call 7m now I'm selecting the database name the table we have created in this new DP database so I am selecting new DB just gonna trim it succeeded ok and here we got our connection string and the connection string name is a new DB entities and I'm saving this connection string in the web config file click Next let's select the table from this database and expanding the tables folder as well as dbo the table name is a blog and selected that one could finish and here the entity model is a litter project after that the next step up in solution Explorer minimize the references folder I am adding a new controller in this controllers folder right-click the controllers add controller and selecting nbc4 controller empty block controller and here we got our controller now in this controller I'm adding a new action result public action [Music] and this one is a ton of you let's cut this one and this action result is the HTTP method HTTP POST and the upload block I am adding our table name which is a block table BG is the object and after that let's insert the block details into the block table some new DB database new DB entities Prisma connection string name and D is object no no DNA's after that and the dot blocks add method and this add method I am adding this blog entity object named BJ after that let's share changes method then once the records once the block details are inserted successful there I want to display the message for that I'm using view back you got message is equals to blog details so successful that's it it's a very simple call to insert the records into the blog table now we required the view page of this upload Blau so before adding the view page first we must build the application build build solution and the project builds successfully let's close this farm select the upload blog action result right click demos at vo the view name is the upload browse the tablet and selecting the create template the create template is used to insert the recalls and the model class the table name is a blog after that the data context class we have to add a connection string entity name which is a new DBAs that's it and here we got our view page upload blog I'm changing the header and notice we got all the columns of the table log titled the category above description everything now what I'm doing I'm adding this blog category fast above the title now this category I want to display in a drop-down is control I'm adding three catalyst for my blog one is a food second one is a sports and the third one is a movies so instead of reader 4 I'm adding the select option element I'm adding this HTML dot named for metal and this name for metal I'm adding the model dot B category after that the options option [Music] select cattle and next options the first one is a food and next one is the sports and the last option is the movies so after adding the drop-down list control for the category next come to the bottom I want to change the label of the bottom control instead of create I'm adding insert block then once the records are inserted successfully I want to destroy the message for that we have used the view back dot message in the controller let's call index at you back dot message that's it now before run this application they require the index view page also so again switch back to the controller let's add some coding in the index view page I want to display all the blog articles the coding is in stuff hanging here got insane I'm adding at the top so I don't require to add again and again blog details is equals to Andy dot Bluffs dot truelist method blog details that's it and the index Rupesh we can get all the blog details in a table so now we require the view page of this action is an index I can build the application fast and here we got a message build succeeded let close assortment message box select the index method action result right click the mouse add view the view name is index a template empty without model so I'm selecting the list template the morale class is a blog and have you got the index view results are first in this index view page I'm adding I'm changing the header tag homepage the index view page is a blog homepage after that I don't require the action link create these links and in the table I don't require this header tags I'm deleting those also come to the bottom and the table that is there edit details and delete action links and don't require those ones also that's it let's check the basic output how it looks at designing part on the browser but before on this application the most important here notice our controller name is a blog it's a blog so we have to change the controller name for that open solution Explorer in the project there is a happened score start folder expand that one rod conflicted says file open that one notice here the controller is a home which is a default one I'm deleting that home controller name and I'm adding my controller name is blog and the action result is an index view page which is our home page let's check the output how it looks at designing part and here we got the output of that call note is the index Mukesh contains a blog homepage I'd know this index page contains only the the title had a diamond now let's insert some blog details the controller name is upload blog the index and now let's insert some blog details here first one the blog category I'm adding the category food category the title is and the description is and the description is wrong best recipes some random taxi alarm adding just for the demo purpose I'm adding some random text and the last one is a blog URL here the blog URL is our view page names so the top 10 recipes in the world the article the unionism is a view page name let's copy that one let's insert that it called insert block and notice here we got the message block details of saved successfully let's check in that database I'm executing the table again execute and here we got the results of the table notice that blog one is added successfully now let's check in the index view page also these blog details are displaying or not go to next view page back to list see here now in the index view page we got the blog details are adding the next aim is I want to align this table in the index view page according to about blog requirement and I want to make this body the layout of the body and two layers the first layer which contains a blog articles and the second layer which is a sidebar and also I want to change our menu bar also the application name I want to change the sample blog and the menu item the links also I want to change and I'm removing this register and login links from this menu bar so let's finish the rest of the core stop debugging so now fuss will change the layout open solution Explorer in the project notice there is a shared folder expander on the shared folder there is a layout dot CSS TMI let's open that one and here in the layout the application name I'm changing to and the viewpager index only and controller name is our controller name is blah and I'm adding the controller names this blog the home index the second one food the view page is a food and the link name is a sports the view page name enter sports in the last one movies and movies and I don't require this resistor and login so let's delete that one so I'm deleting this at that partial and after that I want to make this the body into two layers for that let's open get boots up comm is an official website where we can find the latest boost up snippets and also it's an open-source toolkit so anyone can use faylene now get started and I'm searching for and layout in the layout there is a grid system served at one the grid system I required and notice here the columns is 12 so each grid contains the tool columns come to the ball of my reply two column layout is this one let's copy this one this show and control also do class until that's closest to and in the first deal and said this row I am hiding the body in that body copy this one and paste here let's come in this spot and the second do is a sidebar yes that's it we'll have done the descending part in the layout now index.html let's format this table the TR the title I want to display in the bold letter B small B style the color I'm adding to the title it's adding Brown just by the font size after the dynamic next I want to destroy the description so copy this one question this TV yeah let's add the description now after that add the category the category I'm adding the hits of length H stuff is equals to tilt the URL the tilt forward slash that URL is the controller name which is the blog or controller name is blog then the category at item dot explosives and the blog URL did this one Toodee the studio I'm adding it's a fling and so far in this part copy this one and paste here I'm adding at item this one I'm building this one this prefer a real complete article it's did this to TV don't hit by any more around so this to do that's it we have alanda table according to a blonde requirement next switch to the controller blog I am adding three action results one for the food second one for the sports and a third one for the movies public action result I mean this action result food I'm adding the variable food article and D which is my connection string entity blocks dot weight class and adding the lambda expression X dot block category 2 double equal to within double quotes are not in full and in the return we are melding the food now the next action result for the sports let's copy this one this year sports change the variable sports article and the blocks will be category sports the last one is a movie action result movies variable movies articles is equals to andy dot blogstock red class let's follow them the extra speed category public pulse to movies semicolon they tell me you turn your method and adding this variable movie articles and here one important point I want to mention make sure these action result food methods the same here the index food sports and movies these are the action view pages now after that in our table we have a recipe world view page let's add that one also now we're apart this food sports movies and less peaceful view pages so before adding that one how to build application fast and build solution and the project build successfully let's close this out word message box now create the view page of this foot action result right click the fold add view the Vietnamese food the template I am adding the list template the model class is a blog hide and here we got the foot view page I'm relating this action links and changing the food heading titles put articles I don't require this headings did that one and also don't require this edit details and delete links and we need to format so instead of format again just copy this part from for each loop from the index repairs and in the food sales channel the next view pĂȘche sports served the sports action link if I click the mouse had view the view name is sports template I'm selecting the list embed the model class is a table is a blog table and the data contacts class is new DB entities click a high and here we got the sports view page I'm changing the header and sports I'm deleting the create action link as well as the headings from the table come to the bottom deleting the action links elite details and delete now let's copy this one the next view page now control movies suck the movies folder suck the movies if I click the mouse add view the view name is movies template is a list template the model class our table name is love and here we got that movie view Parrish I'm reading the action link create changing the headings movies articles horizontal line after that undulating the headings from the table come to the bottom and believing the links from the table just copy this part yeah now the last one they refer the recipe wall self better world I took the mouse ad view the view name is a Swiss world only the tablet empty without moral and he ever got the view page of the subset recipe spoiled and changing the recipes born and this recipes world that title is a top-10 displays in the world so let's add that heading after the horizontal on here we can write the article about the world's best top and food so far the demographers are not adding anything let's check the final output in the excerpt CSS tml Google Chrome and here we got the final output notice the menu bar the sample blog is our blog name the home food sports and more is and the below that in the body section we got two layers two columns and this one the article title after that they forgot to give break here and this is a description this is a title and read the complete article and the category is food that's at a break Thank You Dax so the food also required sports and Moe is let's check again the output in Dexter says channel Google Chrome and here we got the final output and notice in the menu bar is a blog title sample blog or blog name of a dad the menu links home food sports and movies and below that the index view page contains that this is a blog title blog description with the complete article save all best top tenth particles then the categories for all right now they have only one article let's add some more articles / upload blog the blog category his movies and the title is the blog description the best Morris some random text is a description and the blog URL and this blog URL is the view pages we have to add English models is a view page name that's inside this blog details in such and here we got the block details of sales successfully let's check in the database table right now this block contains only one blog article which is a top tender space in the wall let's execute the blog so now we've got the second block details top 10 English most 2019 let's check in the index view page home so now we got the second article also topped and English movies let's add some more articles upload blog and this time I'm adding sports bigness tutorials on how to play cricket [Music] and said blow and the blog details of sales successfully let's check the home so here in the index view page we've got three articles right now one is the food category second one is the movies and third one is the sports that's at the another article on the food let's add one more article in the category of food [Music] food and the blog is a case which is a view page name and said blog and here we got a message block details ourselves successfully now I check in the index view page we'll get four records for woodblock details so one two three and four and here one more thing if you notice the blog articles the latest article is displaying at the bottom the new article must be displayed the top so we need to add the descending order let's add that one also the controller - list - dot ordered by dissonance start the ID which is a blog array I want to display the records in the descending order according to the blog IDs so now we check the output funnel approach index.html and here we got the final output notice the latest blocks is displaying at the top after that in the navigation menu our blog name is a sample blog and the menu contains the home owner which is an index view the click full so notice here I'm getting only the full articles if I click sports the sports articles and then click movies the movie articles home displaying all the articles let's check in the database right now this table contains four articles to food 1 movies and 1 sports category we want to read the article and here we got the article of the world's best opt and further that's it we have created a simple blog in MVC
Info
Channel: Haritha Computers & Technology
Views: 7,853
Rating: undefined out of 5
Keywords: mvc project blog create, custom blog mvc
Id: CcPItyRljQA
Channel Id: undefined
Length: 42min 19sec (2539 seconds)
Published: Sat Sep 21 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.