opc web trend (asp.net) controls are not displayed and showing Cross marks when configured with IIS7. Working fine in visual studio but when i publish this with IIS, it just shows cross marks. Below is the code.
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication7._Default" %>
<%# Register assembly="OPCWebTrends" namespace="OPCWebTrends" tagprefix="cc1" %>
<%# Register assembly="OPCWebControls" namespace="OPCWebControls" tagprefix="cc2" %>
<%# Register assembly="Dart.PowerWEB.LiveControls" namespace="Dart.PowerWEB.LiveControls" tagprefix="cc3" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="z-index: 1; left: 10px; top: 15px; position: relative; height: 616px; width: 1298px; background-color: #FFCC99">
<br />
<br />
<div style="border-style: outset; border-width: inherit; border-color: #0000FF; height: 435px">
<cc1:OPCWebTrend ID="OPCWebTrend2" runat="server" Height="379px" Width="490px" />
<cc2:OPCWebRefresh ID="OPCWebRefresh1" runat="server">
</cc2:OPCWebRefresh>
</div>
<br />
<br />
<br />
</div>
</form>
</body>
</html>
Related
I am a new one to ASP.NET and currently learning from the book "Beginning ASP.NET with Visual Studio 2015" by William Penberthy. In the chapter 7 about layout with master pages I created a custom master page WebForms with stylesheet RentMyWrox and moved the inline style for various controls of the page ManagedItems.aspx to RentMyWrox.css. This cause the layout to mess up.
When I switched back to default master page and added the inline style to default Site.css stylesheet the layout was displayed correctly. I downloaded the source code for the book and it has the same issue. Could anyone explain, what is the problem?
My custom master page WebForms.Master
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="WebForms.master.cs"
Inherits="RentMyWrox.WebForms" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<link href="Content/RentMyWrox.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="header">
</div>
<div id="nav">
Navigation content here
</div>
<div id="section">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="footer">
Footer content here
</div>
</form>
</body>
</html>
Stylesheet for custom master page RentMyWrox.css
body {
font-family: verdana;
}
#header {
background-color:#C40D42;
color:white;
text-align:center;
padding:5px;
}
#nav {
line-height:30px;
background-color:#eeeeee;
height:300px;
width:100px;
float:left;
padding:5px;
}
#section {
width:750px;
float:left;
padding:10px;
}
#footer {
background-color:#C40D42;
color:white;
clear:both;
text-align:center;
padding:5px;
}
.dataentry input{
width: 250px;
margin-left: 20px;
margin-top: 15px;
}
.dataentry textarea{
width: 250px;
margin-left: 20px;
margin-top: 15px;
}
.dataentry label{
width: 75px;
margin-left: 20px;
margin-top: 15px;
}
#fuPicture {
margin-top: -20px;
margin-left: 120px;
}
Page ManagedItems.aspx
<%# Page Title="" Language="C#" MasterPageFile="~/WebForms.Master" AutoEventWireup="true" CodeBehind="ManageItem.aspx.cs" Inherits="RentMyWrox.Admin.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div>
<div class="dataentry">
<asp:Label ID="Label1" runat="server" Text="Name"
AssociatedControlID="tbName"></asp:Label>
<asp:TextBox ID="tbName" runat="server"></asp:TextBox>
</div>
<div class="dataentry">
<asp:Label ID="Label2" runat="server" Text="Description"
AssociatedControlID="tbDescription"></asp:Label>
<asp:TextBox ID="tbDescription" runat="server"
TextMode="MultiLine" Rows="5"></asp:TextBox>
</div>
<div class="dataentry">
<asp:Label ID="Label3" runat="server" Text="Cost"
AssociatedControlID="tbCost"></asp:Label>
<asp:TextBox ID="tbCost" runat="server"></asp:TextBox>
</div>
<div class="dataentry">
<asp:Label runat="server" Text="Item Number" AssociatedControlID="tbItemNumber"/>
<asp:TextBox runat="server" ID="tbItemNumber" /> </div> <div class="dataentry">
<asp:Label runat="server" Text="Picture" AssociatedControlID="fuPicture" />
<asp:FileUpload ID="fuPicture" ClientIDMode="Static" runat="server" />
</div>
<div class="dataentry">
<asp:Label runat="server" Text="Acquired Date" AssociatedControlID="tbAcquiredDate"/>
<asp:TextBox runat="server" ID="tbAcquiredDate"/>
</div>
<asp:Button Text="Save Item" runat="server" OnClick="SaveItem_Click" />
</div>
</asp:Content>
This is how it should look according to the book
This is how it actually looks like
The source code can be downloaded at http://media.wiley.com/product_ancillary/27/11190774/DOWNLOAD/RentMyWrox_Chapter7_CSharp..zip
Is the code attached/linked the "before" or "after" modification code?
My recommendation is to use the tools of your browser to check if the CSS file was actually loaded. In Chrome, you can press F12 and then click on the "Sources" tab. This will show you what is loaded down the left, I'm guessing your CSS file is not there.
If that's the case, it might be your reference in your master file.
Currently you have it as:
But that link is not a valid link from your manageitem.aspx page which is inside the 'Admin' folder.
Instead, try "~/Content/RentMyWrox.css" - this should map the proper path from the root of your application, rather than relative to whichever child page is loading the master.
I have my aspx as below:
<%# Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager id="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
<div>
<asp:TextBox runat="server" ID="txtDateFerie" autopostback="True"/>
<asp:Button runat="Server" ID="ibtnDateFerie"
CausesValidation="False" />
<ajaxToolkit:CalendarExtender Format="dd/MM/yyyy" ID="cbeDateFerie" runat="server" Enabled="True"
TargetControlID="txtDateFerie" PopupButtonID="ibtnDateFerie" />
</div>
</form>
</body>
</html>
I have AjaxControlToolkit.dll and System.Web.Extensions.dll in my project. However, when I click on the button, the calendar is not shown. I have looked for an answer on the internet, and it seems I am not missing anything here. Any idea where the problem may be?
I keep get an error when I load a ContentPage inside a fancybox:
Cannot find ContentPlaceHolder 'ContentPlaceHolder1' in the master page '/MasterPage/Modal.Master', verify content control's ContentPlaceHolderID attribute in the content page.
I have this in the MasterPage (some code omitted for simplification):
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Modal.master.cs"
Inherits="TransportadoraEDI.App.Modal" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<title></title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div id="main-content">
<div style="width: 800px; height: 600px">
<asp:ContentPlaceHolder ID="cphConteudo" runat="server">
</asp:ContentPlaceHolder>
</div>
<!-- jQuery -->
<script src="../js/jquery.min.js"></script>
<script src="../js/init.js"></script>
<asp:ContentPlaceHolder ID="cphBlocoJs" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
And this code in a ContentPage (some code omitted for simplification):
<%# Page Title="" Language="C#" MasterPageFile="~/MasterPage/Modal.Master"
AutoEventWireup="true" CodeBehind="FormCadNotFis.aspx.cs" Inherits="TransportadoraEDI.App.Conemb.FormCadNotFis" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphConteudo" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphBlocoJs" runat="server">
</asp:Content>
How it's possible to the ContentPage look for a ContentPlaceHolder that doesn't even exists?
EDIT
My open fancybox function:
$(document).ready(function () {
function AbrirModal(url) {
$.fancybox.open({
fitToView: false,
autoSize: false,
href: url,
//width: _width,
//height: _height,
type: 'iframe',
transitionOut: 'none',
centerOnScroll: true,
hideOnOverlayClick: false,
padding: 0,
afterClose: function () {
parent.location.reload(true);
}
});
}; });
There is no ContentPlaceHolder named 'MainContent' in your master page,
A content place holder should be in your Master page like this:
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
And child pages like this:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>
I have a simple .aspx page and a textbox which I want to maske It using jquery.maskedinput-1.3.js and my page .aspx code is as follows , the issue is on first page load I the textbox is masked , but after an asyncPostback the masked input plugin is not working ! how can I make the masked input plugin working ? thx in advance .
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery.js" type="text/javascript"></script>
<script src="Scripts/jquery.maskedinput-1.3.js" type="text/javascript"></script>
<script type='text/javascript'>
jQuery(function ($) {
$("#txtMembershipCode").mask("999-9999-999-9999");
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="float: right" id="exDiv">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div style="float: right; width: 120px; font-family: Tahoma">
membership Code :</div>
<div style="float: left">
<asp:TextBox ID="txtMembershipCode" runat="server" CssClass="input" ClientIDMode="Static"
dir="ltr"></asp:TextBox>
</div>
<div style="font-family: Tahoma; float: left">
<asp:Button ID="btn" runat="server" Text="save" OnClick="btn_Click" CssClass="mybtn" /></div>
<div style="font-family: Tahoma; float: right">
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img src="Images/484.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
I have tried many different ways on the web but none of them are working !
Here is one way of solving this -
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery.js" type="text/javascript"></script>
<script src="Scripts/jquery.maskedinput-1.3.js" type="text/javascript"></script>
<script type='text/javascript'>
window.onload = function () {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);
}
function endRequestHandler(sender, args) {
init();
}
function init() {
$("#<%=txtMembershipCode.ClientID %>").mask("999-9999-999-9999");
}
$(function() { // DOM ready
init();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="float: right" id="exDiv">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div style="float: right; width: 120px; font-family: Tahoma">
membership Code :</div>
<div style="float: left">
<asp:TextBox ID="txtMembershipCode" runat="server" CssClass="input" dir="ltr"></asp:TextBox>
</div>
<div style="font-family: Tahoma; float: left">
<asp:Button ID="btn" runat="server" Text="save" OnClick="btn_Click" CssClass="mybtn" /></div>
<div style="font-family: Tahoma; float: right">
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img src="Images/484.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
This approach uses the Sys.WebForms.PageRequestManager JavaScript class and is possible because you have a Script Manager on your .aspx page. Basically after every async postback the init() function will be called.
Notice the init() function is also called in DOM ready. This allows you to do everything to the DOM you need done again after content has changed during the async postback. I have used this technique before using various jQuery plugins including this one.
I used function pageLoad
<script type='text/javascript'>
function pageLoad() {
$("#<%=txtMembershipCode.ClientID %>").mask("999-9999-999-9999");
}
</script>
Here is a sample code I'm working on:
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.menu
{
border: 1px solid #C0C0C0;
color: #FFFFFF;
background-color: #66A6CC;
font-family: Cambria;
text-align: justify;
font-size: medium;
width: 200px;
padding:8px;
padding-left:0px;
text-indent:10px;
display:inline-table;
}
.menu:hover
{
background-color: #FFFFA6;
color: #000000;
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="float:left; margin:10px;">
<asp:Menu ID="Menu1" runat="server" StaticMenuItemStyle-CssClass="menu" >
<Items>
<asp:MenuItem Text="Menu row" Value="menurow"
NavigateUrl="Default2.aspx" ></asp:MenuItem>
<asp:MenuItem Text="Menu row" Value="menurow1"
NavigateUrl="Default2.aspx" ></asp:MenuItem>
<asp:MenuItem Text="Menu row" Value="menurow2"
NavigateUrl="Default2.aspx" ></asp:MenuItem>
</Items>
</asp:Menu>
</div>
</form>
</body>
</html>
I have a problem with hover. Here it is.
The whole cell should turn into yellow but it doesn't do because of padding.
EDIT: I removed padding but same thing happens again. I think it's because of display type. I tried most of display types but they are not convenient for a menu.
Solution: There is a problem with Chrome about rendering some components. There are online solutions, please Google "ASP.NET chrome menu problem".
I got it working from copying your HTML code. The only thing I changed was adding a missing closing bracket to the ".menu:hover" class.
I tested the page in Firefox and Internet Explorer 8.
Padding shouldn't be causing any issues with the yellow hover. What browser are you using?
this your code output in my chrome with padding 18px :