Asked Questions

I'm starting to learn code in .net core 2.0 and as the first application I decided to write a simple blog system. I encountered a problem when i wanted put different header background image to the each post details page and the main one on index page. Image is passing by ViewData["Image"] to the _Layout. I tried to put the same image to the both views Index and Details but image displays only on Index page.

Index View

@model PaginatedList<MHBlog.Models.Post>
@{
    ViewData["Title"] = "Index";
    ViewData["Image"] = "11.jpg";
}
<h2>Index</h2>

Details View

@model MHBlog.Models.Post
@{
    ViewData["Title"] = "Index";
    ViewData["Image"] = Model.ImageName;
}
<h2>Details</h2>

_Layout

<header class="masthead" style="background-image: url(images/@ViewData["Image"])">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-10 mx-auto">
                <div class="post-heading">
                    <h1>Blog</h1>
                    <span class="subheading">My First Blog</span>
                </div>
            </div>
        </div>
    </div>
</header>

CSS

header.masthead {
  margin-bottom: 50px;
  background: no-repeat center center;
  background-color: #777777;
  background-attachment: scroll;  
}
header.masthead .page-heading,
header.masthead .post-heading,
header.masthead .site-heading {
  padding: 200px 0 150px;
  color: white; }
@media only screen and (min-width: 768px) {
  header.masthead .page-heading,
  header.masthead .post-heading,
  header.masthead .site-heading {
    padding: 200px 0; } }
header.masthead .page-heading,
header.masthead .site-heading,
header.masthead .post-heading{
  text-align: center;
}
header.masthead .page-heading h1,
header.masthead .site-heading h1 {
  font-size: 50px;
  margin-top: 0; }
header.masthead .page-heading .subheading,
header.masthead .site-heading .subheading {
  font-size: 24px;
  font-weight: 300;
  line-height: 1.1;
  display: block;
  margin: 10px 0 0;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
@media only screen and (min-width: 768px) {
  header.masthead .page-heading h1,
  header.masthead .site-heading h1 {
    font-size: 80px; } }
header.masthead .post-heading h1 {
  font-size: 35px; }
header.masthead .post-heading .meta,
header.masthead .post-heading .subheading {
  line-height: 1.1;
  display: block; }
header.masthead .post-heading .subheading {
  font-size: 24px;
  font-weight: 600;
  margin: 10px 0 30px;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
header.masthead .post-heading .meta {
  font-size: 20px;
  font-weight: 300;
  font-style: italic;
  font-family: 'Lora', 'Times New Roman', serif; }
header.masthead .post-heading .meta a {
  color: white; }
@media only screen and (min-width: 768px) {
  header.masthead .post-heading h1 {
    font-size: 55px; }
header.masthead .post-heading .subheading {
  font-size: 30px; } }

Index page:

\"enter

Details page:

\"enter

I tried to set details ViewData Image to @ViewData["Image"] = "11.jpg"

But nothing changed on details page.

Views
23
Answers
0
Views
23
Answers
0
Views
14
Answers
0

I am searching for 2 days for my problem and i had no luck in finding it.

my problem :

I have comodo ssl/tls certificate installed on my server, and I am using android volley library for connecting to server, until now i was using just \"https://...\" for my url and connecting via https connection to my server with no problem. but i recently installed \"packet capture\" android application on my phone, by default settings and a phone which is not rooted it cannot retrieve post/response information from my app to the server, but when you use a rooted phone, the packet capture app asks you to install a custom certificate on the phone so it can retrieve even ssl/tls connection, At first I though it\'s joking, but after installing the certificate it shows the whole information used in ssl connection to my server... I am so worried about the security of my app, which a hacker can use that capturing app to know what to send to my server and sets his coin number for example to 100000 :(

please show me a way to make my app\'s connection more secured . * I do\'nt have a custom certificate installed on the app because the server certificate is trusted and working ok with the default use.

sorry for my poor English typing :)

Edit : thanks to @Ch4t4r for the idea... I did searched and find this for pinning the public key and it\'s so great, here is the github link : https://github.com/faruktoptas/volley-public-key-pinning

hope it helps others having the same problem

Views
16
Answers
0
Edit Account
LOGIN INFORMATION
Change Settings
Email Notifications Notifications will be sent to abcd@gmail.com
Select option for your email notifications:
Mature / News Filter We'll send on email when new jobs are posted
Option 2 for email notification We'll send on email when new jobs are posted