I have html code and want to split it between site.master and default.aspx
When I put a full code on site.master it works, but when I took a part of code and put it in default.aspx, it doesn't work!
I just want to know how to make default.aspx reach all classes in .css files
This is my tag which cant take a class from .css
<%# Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplicationClinicASP._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<section class="hero-wrap js-fullheight" style="background-image: url('images/bg_3.jpg');" data-section="home" data-stellar-background-ratio="0.5">
<div class="overlay"></div>
<div class="container">
<div class="row no-gutters slider-text js-fullheight align-items-center justify-content-start" data-scrollax-parent="true">
<div class="col-md-6 pt-5 ftco-animate">
<div class="mt-5">
<span class="subheading">Welcome to Mediplus</span>
<h1 class="mb-4">We are here <br>for your Care</h1>
<p class="mb-4">Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove.</p>
<p>Make an appointment</p>
</div>
</div>
</div>
</div>
</section>
</asp:Content>
Related
I've been trying to upload my site to my Hostinger domain for a few days now, however for some reason the .aspx file shows the raw code and doesn't show any of the GUI present when run through the browser.
How would you advise?
<%# Page Title="" Language="C#" MasterPageFile="~/Mater Pages/Primary.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.auto-style1 {
width: 873px;
height: 455px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<h2 style="text-align: center">
Hello and welcome to my personal website. I hope that you enjoy your visit.</h2>
<h3 style="text-align: center">
If for any reason you can't find exactly what you are looking for then please use the contact form here and you'll get a response within 2-3 working days</h3>
<h3 style="text-align: center">
<img alt="" class="auto-style1" src="Images/Default/image%20for%20hompage.png" /></h3>
<p style="text-align: center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Website Ad Test -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-8284273019831171"
data-ad-slot="7241345648"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
Looking at Hostinger's website it looks to me that they do not support .net framework.
it seems that your server does not execute the code in your .aspx web page, it just returns the content (the source code) of it.
Contact your web server provider and make sure they are serving .NET pages.
I have a page I have been working on, which has some nav tabs on it, which has been working fine until yesterday. When I booted up this am the page no longer shows the tabs. I have closed and reopened VS, I have rebooted my system as well as rebuilding the solution. I've gone through all my code to make sure all tags are closed. I've even gone as far as creating a whole new stand alone page with basic nav tab code and nothing, it doesn't show on the page at all. Any Ideas?
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Mango.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div class="container">
<ul class="nav nav-tabs" id="myTab">
<li class="active">TabA</li>
<li>TabB</li>
<li>TabC</li>
</ul>
<div class="tab-content">
<div id="TabA" class="tab-pane active">
TAB A
</div>
<div id="TabB" class="tab-pane">
TAB B
</div>
<div id="TabC" class="tab-pane">
TAB C
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#myTab a').click(function (e) {
e.preventDefault()
$(this).tab('show')
});
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
e.relatedTarget // previous tab
});
});
</script>
</asp:Content>
I need to render a conditional asp:content
how can I do this please?
**if( culture=fr)**
<asp:Content ContentPlaceHolderId="altColumnContent" ID="altColContent" runat="server">
<div class="altBloc">
content 1
</div>
<!-- END: Alternative Bloc -->
</asp:Content>
**if(culture=en)**
<asp:Content ContentPlaceHolderId="altColumnContent" ID="altColContent" runat="server">
<div class="altBloc">
content 2
</div>
</asp:Content>
When, I put 2 asp:content with the same ContentPlaceHolderId i have erros.
regards
If you just want to change the content based on the culture property value, then there is no need to render different content tags, and you better move the if statement inside your and render different content inside based on the culture value?
this is a pseudo-block for demonstration
<asp:Content ContentPlaceHolderId="altColumnContent" ID="altColContent" runat="server">
<div class="altBloc">
<% if(CultureValue == FIRST_VALUE){ %>
content 1 ==> // YOUR_FIRST_CONTENT
<%} else { %>
content 2 ==> // YOUR_SECOND_CONTENT
<%} %>
</div>
</asp:Content>
My question will probably sounds dumb to most of you but I have been struggling to find out the problem. I basically have a method and a view (created by right click-> Add View).
This is my method:
public ActionResult yearlyOverview(FormCollection values)
{
return View();
}
And this is my view:
<%# Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
yearlyOverview
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>yearlyOverview</h2>
</asp:Content>
The error message that I get comes from the browser:
Sys.ArgumentException: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON. Parameter name: data
This is the master page code:
<%# Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link href="../../Content/css/fullcalendar.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="page">
<div id="header">
<div id="title">
<h1>PS Administration</h1>
</div>
<div id="logindisplay">
</div>
<div id="menucontainer">
<ul id="menu">
<li><%= Html.ActionLink("Home", "Index", "Home")%></li>
<li><%= Html.ActionLink("Notices", "Index", "Notice")%></li>
<li><%= Html.ActionLink("Job Positions", "Index", "JobPosition")%></li>
</ul>
</div>
</div>
<div id="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
<div id="footer">
</div>
</div>
</div>
</body>
</html>
Has anybody already stumbled on this problem?
Ok my code was good but the mistake i made was to call the form using ajax.beginForm instead of a normal form, and I was trying to parse an object data that wasn't returned by the controller.
I have a master page with the following code:
<body>
<form id="form1" runat="server">
<!-- BEGIN: Sticky Header -->
<div id="header_container">
<div id="header">
<div id="headerBar">
<a href="<% = Page.ResolveUrl("~/default.aspx") %>">
<img src="<% = Page.ResolveUrl("~/images/logo.png") %>" id="logo" /></a> <span id="header_text">
Scrum Reports</span>
<asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="login_status" LogoutAction="Redirect"
LogoutPageUrl="~/default.aspx" />
<asp:LoginName ID="LoginName1" runat="server" CssClass="login_user" />
</div>
</div>
</div>
<div id="menuBar">
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" StaticDisplayLevels="2"
Orientation="Horizontal" >
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" SiteMapProvider="admin" runat="server" />
<asp:SiteMapDataSource ID="SiteMapDataSource2" SiteMapProvider="user" runat="server" />
</div>
<!-- END: Sticky Header -->
<!-- BEGIN: Page Content -->
<div id="mainContent">
<div id="container">
<div id="content">
<asp:ContentPlaceHolder ID="Main" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
</div>
<!-- END: Page Content -->
<!-- BEGIN: Sticky Footer -->
<div id="footer_container">
<div id="footer">
Developed by Application Solutions
</div>
</div>
<!-- END: Sticky Footer -->
</form>
</body>
Now I am using the following C# (as part of the master pages Page_Load method)to show or hide the sites menu depending on whether a user is logged in:
Menu1.Visible = Page.User.Identity.IsAuthenticated;
For some reason, this line of code is preventing content from being seen on another page when the user isn't logged in.
<%# Page Language="C#" AutoEventWireup="true" MasterPageFile="~/master/template.master" CodeFile="recoverpassword.aspx.cs" Inherits="password_recoverpassword" %>
<asp:Content ID="Content1" Visible="true" ContentPlaceHolderID="Main" runat="Server">
<div>
Cant see this content when not logged in.
</div>
</asp:Content>
Why is this happening? What can I do about it?
The code above:
Menu1.DataBind();
was causing the issue. When I removed it it it fixed it and everything else continued to work as normal.