1

I am using Visual Studio 2017 with IIS Express 10.0 in windows 10.

The design view of my page looks like this:

WebForms Design View

However when I run the application, the css doesn't get rendered correctly.

Here is the html output from Firefox inspect source:

<link href="css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/font-awesome.min.css" />
<link rel="stylesheet" href="css/animate.css" />
<link href="css/animate.min.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<form method="post" action="./Login.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="Y+iBhsvTjpuc5zgIsI/i4c9x9v3I1LeUdSJ8+lHgt7TMBhQF3FSgdZ8VTXCB6YMVb9eO7XVg4Ar5BDj7GzmsVJFfvBd+7FfI8gpoKobV3htrhGga9SBUu7HVK0cC3HRjiF8sfT2yKsMjQem8pUV3Ng==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>

Previously, there was no such error but for unknown reason the element tags are rendered in the server as aspNetHidden.

I have cleared cache of my browser and restarting application/pc without any success.

Is it because of new 2017 auto-sync CSS feature of VS 2017?
Any way of resolving the issue?

7
  • Those hidden fields are how WebForms maintains view state. It would be helpful to see an actual ASP.NET page, including the master page, assuming you are using one. Your server tags would normally use virtual paths (paths starting with the ~), which get resolved at runtime. Commented Dec 24, 2017 at 21:19
  • added the link to the code file. . I think it is a caching problem since it worked correctly before , and after some time I got this bug where text boxes are hidden. Commented Dec 24, 2017 at 21:25
  • Your question needs to contain enough to reproduce the issue without needing to link to an external resource. See How do I ask a good question? and How to create a Minimal, Complete, Verifiable Example. We don't need to see a code-behind file, just the server tag markup. Commented Dec 24, 2017 at 21:29
  • Using virtual path didnt make solve the issue. Is the reason because of IIS server cache or the new VS 2017 auto-sync css feature? Commented Dec 24, 2017 at 21:34
  • BrowserLink has been around longer than Visual Studio 2017 but, no, that shouldn't be the issue. Commented Dec 24, 2017 at 21:38

1 Answer 1

0

You are not including the <LINK href="path-to-css-file" rel="stylesheet" type = "text/css" />. It's likely because of that.

Sign up to request clarification or add additional context in comments.

9 Comments

I have included that! The html file I included is what was shown in Firefox inspect source
But I still don't see the link tag there, which is used to import css files that contain styling markup?
I only included the relevant tags, I have included the link tag in my code. Edited question with LINK tags.
Use the Network tab within F12 browser tools to make sure that those 2 CSS files are indeed downloaded. It may be that their paths are incorrect. If they are downloaded, then you'll need to analyze CSS markup within: perhaps CSS rules that you defined are invalid, or perhaps they are getting overridden by other rules). Can you upload the relevant part of that project somewhere?
You have both animate.css and animate.min.css included within site1.master file. You should probably remove one (remove the min one while debugging this, as that one is compressed). Perhaps you should replace all min stylesheets with non-min ones while you're developing. It may be that some css rules from the bootstrap theme are overriding your custom css rules. You can see whether this is the case via F12 browser tools, by finding and selecting HTML elements that are not appearing correctly. CSS rules that are overridden will appear crossed out.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.