ASP.Net error - type is not compatible with the type of control - asp.net

I have a web site i created using VS2012 web edition,
Running a VB.net asp web site,
In the VS2012 debug/release mode it compiles and everything works good,
When i upload it to a server (Windows server 2008 R2) I get the following error:
The base class includes the field 'html', but its type (System.Web.UI.HtmlControls.HtmlElement) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 4: <html id="html" xmlns="http://www.w3.org/1999/xhtml" dir="ltr" runat="server">
Line 5: <head id="Head1" runat="server">
Line 6: <title></title>
I looked a bit on the web and found this :
VS 2010: Value of type 'System.Web.UI.HtmlControls.HtmlGenericControl' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'
Installed it but no help,
The site i created was re-created from another vb.net project so i used a web.config with from the old one, maybe it has something to do with it, i have no "assembly" properties it this XML.
Other pages that are not related to that master page (that html tag is running on a master page...) work's fine.

OK,
So after trying a lot of stuff that didnt work i found a solution, i dont like this solution but it works,
I went to the page.designer.vb file, and then looked for the 'html' and 'Head1' properties that were generated there,
In there i replaced their types to System.Web.UI.HtmlControls.HtmlGenericControl
Afterwards, it worked.
Weird bug, nothing else (including the "hot fixes" that are mentioned in other posts helped.
Hope this would help some one out there .

Somehow the designer file and the markup file get out of sync, even if the types appear to match.
I changed the ID attribute of the problematic control, saved, and rebuilt in the markup file. I then changed it back to the original ID, saved, and rebuilt.
Problem goes away!

Weird issue it is I am not sure if there is a proper solution for this but what worked for me was simply changing the Control ID. and then designer.cs file was changed and all worked good.

I fixed it by Cleaning Solution/project -> Rebuild

Related

html_nodes no longer extracts table rows after website update

Some years ago I asked for help scraping the available model list on nomads.ncep.noaa.gov. The solution is documented here. I added the first answer into my R package rNOMADS and have been using it ever since. However, ever since NCEP announced they'd switch to https, the solution is failing. I know it is not just due to the switch, because other https sites (like imdb) are still scrapeable.
I suspect they actually changed the structure of the website. I tried to use Selectorgadget to figure out if I could just set a new css selector, but no luck.
I am at a loss...websites that use rNOMADS as a backend are failing, my users are sending me emails, and I am not sure how to fix the problem.
Any guidance is appreciated/desperately needed.
I took a crack at it, and my guess the place to start is with your earlier post using XML::htmlParse
library(XML)
library(dplyr)
library(rvest)
doc_http <- htmlParse("http://nomads.ncep.noaa.gov/")
doc_https <- htmlParse("https://nomads.ncep.noaa.gov/")
doc_http returns
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
followed by two scripts, one a long Citrix script
doc_http returns only
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>https://nomads.ncep.noaa.gov/</p></body></html>
meaning no XML. So, to the extent that RNomads html parsing relies on its XML import, it looks like you're in for some serious refactoring.
All functions from rNOMADS are working for me changing the server URL.
On e-mail from [NCEP.list.NOMADS-ftpprd] say:
At this time only the following website URLs have the new changes for testing:
https://nomads-cprk.ncep.noaa.gov/
https://origin.ftp.ncep.noaa.gov/
New URLs are working!

HTTP Meta Tags in SQL Server SSRS 2012 Web Pages

We have SQL Server 2012 with SSRS installed on Windows Server 2008.
There are some issues with reports not displaying correctly unless compatibility mode is enabled in IE 10.
We also have a development server with the same setup but there the reports load fine because all pages rendered by the report server have the following meta tag:
<META HTTP-EQUIV="X-UA-Compatible" CONTENT="IE=5">
Our production server does not have this and I am trying to add the same meta tag there but can't figure out how and the person who originally setup our dev server is no longer here.
I tried looking at MSRS11.MSSQLSERVER\Reporting Services\ReportServerPages and editing ReportViewer.aspx but it doesn't matter how I modify the meta tag or even if I completely remove it from the file, all rendered pages still have the original one that I mentioned above.
I then tried looking in MSRS11.MSSQLSERVER\Reporting Services\ReportManager\Pages thinking that I can edit the individual files like Folder.aspx or Report.aspx but when I open those files all they contain is this:
<%# Page language="c#" Codebehind="Folder.aspx.cs" AutoEventWireup="false" Inherits="Microsoft.ReportingServices.UI.FolderPage" EnableEventValidation="false" %>
<%# Register TagPrefix="MSRS" Namespace="Microsoft.ReportingServices.UI" Assembly="ReportingServicesWebUserInterface" %>
So there is no place to add the meta tag.
I also looked in web.config and I don't see anything there that is adding the meta tag to all the pages.
I am not sure where else to look and can't figure out how the meta tag was added.
It's obviously not a default out of the box setting since it's not there on our production box.
I have found a workaround that seems to be working ok allthough the markup looks strange. You just simply add to ... \ReportManager\Pages\Report.aspx the markup bellow
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
</head>
When it is rendered the source contains both meta tags but it uses this one (teste on IE 11).

How to convert .aspx pages and master pages to html pages?

I am doing one project in asp .net.Its completed,then the same project will be done in html5. How to convert the .aspx pages and master pages to html 5? Is it possible?If any one know please tell me.
You can technically make the page HTML5 by changing the doctype...
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
It is also recommended that you specify a lang attribute on the html tag and include the meta tag to define your character set.
This won't give you instant HTML5 semantics, but this is essentially step one. Using the right elements for the right kinds of content will be down to you, for example deciding when to use header, article, section, footer instead of plain div elements and so on.
You should also be able to select "DOCTYPE:HTML5" from the toolbar in Visual Studio - I don't know what version you are using, but I think in the previous version you could download a HTML5 language extension, I'm pretty sure it is included by default in Visual Studio 2012.
what you can do... if I understand your question correctly is, rightclick and say view page source and copy your html or install google chrome and the on each page you can go rightclick and inspect element. you can copy and paste the html of each page including the masterpage content. Its a sloppy way but will work if you only want the html
One of the way that i think you can do is to use http://modernizr.com/ kind of framework to switch between html5 and normal html easily .

Tridion Rich Text Field DWT   output to "?"

Rich text field value <div> </div>
output <div>?</div>
DWT:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
##Component.Fields.Text##
</html>
what did i miss?
thanks
I can't try it out now due to lack of time, but a few things come to mind:
What's the encoding set on your publication target?
Do you get the same result in Template Builder and Preview?
If you open the published file with a text editor like Notepad++, what does it show?
EDIT
In preview I get this:
<div> </div>
After publishing I get the same as you:
<div>?</div>
So I changed my publication target to use "Unicode (UTF-8)" instead of "System Default", and now when I publish I get this:
<div> </div>
I then referred to Elena's excellent 7 clues to deal with encoding, and figured out I was missing this on my web.config:
<globalization fileEncoding="UTF-8" requestEncoding="UTF-8" responseEncoding="UTF-8"/>
This still didn't do it, it was still loading this weird character in between the tags. This last clue was because the encoding was not being applied to pages with the ".html" extension. Renamed my page template to have a .aspx extension, published, pressed F5 and magic, my div now shows:
<div> </div>
EDIT 2 If you want to use the .html extension, just add this to your page's <head>:
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">

Blank ASPX page rendered

My web application has one page default.aspx that renders a blank html.
I have some CSS and Javascript files included into the page, but in the browser if I see view source then it shows only:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>
Sometimes it works...but most of the time it doesn't. Refresh doesn't help either.
Whereas there are plenty of Link references and JavaScript references, none of them are included into the page. I tried to put a debug pointer (and also logging from the page load) but it never gets a hit.
IIS - web dev server does not make any difference. I don't even think its a OS, IIS related issue. because the same code on another project working perfectly on the same machine.
By the way my JavaScript file has some un-usual characters in a string like:
Quote: '»',
DOT_ESCAPE : '_DOT_',
NL_ESCAPE: "↕"
Is it a problem or not? I have no idea even what's going on. Can anybody suggest something?
I have resolved this issue. The problem was the js file has wrong code page.

Resources