Latest posts on tagged on "MVC"

set viewbag in jquery

10 June 2016

In this example I will show you how to bind viewbag value to an html control using jQuery in mvc.

Radio button mvc

8 June 2016

Radio button allows user to select one option from series of choices. In this example I will show you how to generate a radiobuttonlist in mvc using Html.RadioButtonFor.

Controller to a view Integer array in asp.net mvc

6 June 2016

In this example I will show you how to pass integer array from controller to a view. I stored list of numbers in an integer array and index function will return that in a view.

Passing string to view mvc

5 June 2016

In this example I will show you how to pass string to view mvc in application. The appropriate way to you must cast in to an object and return as view. In view model you must define the object type and write the string in required place.

Passing IEnumerable string to view mvc

5 June 2016

In this example I will show you how to pass IEnumerable string to view mvc in application. I used string array with array elements contains list of names. I filtered names having length >=5 and assigned to IEnumerable string varable. The appropriate way to pass data from controller to view, is to pass the filterednames to the view

How to delete multiple rows in datatables grid using asp.net MVC?

31 May 2016

In this article we will discuss how to delete multiple rows in datatables grid using in asp.net. We are binding record(s) using datatable grid each row contains check box.If the user wants to delete multiple rows by select using checkbox.

A potentially dangerous Request.Form value was detected from the client.

26 May 2016

I have created a table “article” with columns articleId and article_content. I am also using html editor for “article_content” column. When I am trying to save I got the following error. It was resolved by adding [AllowHtml] to Description property in class.

How to read text file using fileupload control in asp.net MVC?

25 May 2016

In this step by step article describes how to read text file using fileupload control in asp.net MVC.create a post form method with html controls file, button and create a folder name with Document in the project. When user choose the text file and click the submit button the controller will receive file type, name etc. we will save the file in our project document folder.

[Solved] The relationship model was not loaded because the type model is not available.The following information may be useful in resolving the previous error: The required property does not exist on the type model class

25 May 2016

When I created new table “post” and give foreign key relation to another “category” table after that run the custom tool by right click on edmx file. While running the application I got the following error. It was cleared by including post table foreign key relation to the category class.