TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Paul Drake
NA
37
4.5k
Not sure how to convert int to C# object
Dec 24 2020 11:09 PM
I'm trying to pass a parameter to a controller method and I'm having problems with converting type int to C# object. Or more specifically type in to root.
@{
Layout =
null
;
Root movieResult = ViewData[
"movies"
] as Root;
MovieResults movies = ViewData[
"movies"
] as MovieResults;
}
<!doctype html>
<html lang=
"en"
>
<head>
<meta charset=
"UTF-8"
/>
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<title>Movie Streaming Availability App</title>
<link rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity=
"sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
crossorigin=
"anonymous"
>
<link rel=
"stylesheet"
type=
"text/css"
href=
"css/site.css"
>
</head>
<body>
<main>
<div
class
=
"container"
>
<div
class
=
"row"
>
@foreach (
var
movie
in
movies.Results)
{
<div
class
=
"col-3"
>
<a asp-controller=
"Movie"
asp-action=
"MoviePage"
asp-route-Id=
"@movie.Id"
><img src=
"https://image.tmdb.org/t/p/w300/@movie.PosterPath"
alt=
"@movie.Title"
></a>
<label>@movie.Title</label>
</div>
}
</div>
</div>
</main>
<footer>
<script type=
"text/javascript"
src=
"lib/jquery/dist/jquery.js"
></script>
<script type=
"text/javascript"
src=
"lib/bootstrap/dist/js/bootstrap.bundle.js"
></script>
<script type=
"text/javascript"
src=
"~/js/site.js"
asp-append-version=
"true"
></script>
</footer>
</body>
</html>
Reply
Answers (
3
)
Browser not reading style sheets error404
submit filename asp.net mvc