Visual Studio client HTML Intellisense for WebForms server controls - html

I want the same HTML Intellisense as for <a runat="server"></a> to also display for <asp:HyperLink runat="server"></asp:HyperLink> as well (client events, attributes, etc).
I already tried creating and adding this file to "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\schemas\html":
<?xml version='1.0' encoding='utf-8' ?>
<xsd:schema xmlns='http://schemas.microsoft.com/intellisense/html5/asp'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://schemas.microsoft.com/intellisense/html5/asp'
xmlns:vs='http://schemas.microsoft.com/Visual-Studio-Intellisense'
xmlns:svg="http://www.w3.org/2000/svg"
vs:clientom="w3c-dom1.tlb"
vs:ishtmlschema="true"
vs:isserverschema="false"
vs:htmlflavor="5.0"
vs:cssschema="CSS 2.1"
vs:SuccinctFriendlyName="ASP HTML5"
vs:customattrprefix="data-">
<xsd:annotation>
<xsd:documentation>
Microsoft Visual Studio schema for ASP HTML5
</xsd:documentation>
</xsd:annotation>
<xsd:include schemaLocation="CommonHTML5Types.xsd" />
<xsd:attributeGroup name="coreAttributeGroup">
<xsd:attributeGroup ref="commonHTML5coreAttributeGroup" />
<xsd:attribute name="contenteditable" vs:standalone="noname">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
<xsd:enumeration value="inherit" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="draggable" vs:standalone="noname">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
<xsd:enumeration value="auto" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="spellcheck" vs:standalone="noname">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:attributeGroup>
<xsd:attributeGroup name="ariaAttributeGroup">
<xsd:attributeGroup ref="commonHTML5ariaAttributeGroup" />
<xsd:attribute name="aria-invalid" default="false" vs:category="WAI-ARIA">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="grammar" />
<xsd:enumeration value="false" />
<xsd:enumeration value="spelling" />
<xsd:enumeration value="true" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:attributeGroup>
<xsd:attributeGroup name="commonEventsGroup">
<xsd:attributeGroup ref="commonHTML5commonEventsGroup" />
</xsd:attributeGroup>
<xsd:attributeGroup name="commonAttributeGroup">
<xsd:attributeGroup ref="coreAttributeGroup" />
<xsd:attributeGroup ref="microdataAttributeGroup" />
<xsd:attributeGroup ref="ariaAttributeGroup" />
<xsd:attributeGroup ref="commonEventsGroup" />
<xsd:attributeGroup ref="coreServerAttributeGroup" />
</xsd:attributeGroup>
<xsd:group name="flowContent">
<xsd:choice>
<xsd:element ref="HyperLink" />
</xsd:choice>
</xsd:group>
<xsd:group name="phrasingContent">
<xsd:choice>
<xsd:element ref="HyperLink" />
</xsd:choice>
</xsd:group>
<xsd:group name="interactiveContent">
<xsd:choice>
<xsd:element ref="HyperLink" />
</xsd:choice>
</xsd:group>
<xsd:element name="HyperLink" vs:disallowedancestor="HyperLink" vs:contentmodel="transparent">
<xsd:complexType mixed="true">
<xsd:attributeGroup ref="commonAttributeGroup" />
<xsd:attributeGroup ref="aServerAttributeGroup" />
<xsd:attribute name="href" type="xsd:anyURI" vs:preferredextensions=".asp;.aspx;.cshtml;.vbhtml;.asmx;.asax;.ashx;.asix;.ascx;.htm;.html;.xml;.xsd;.config;.asa;.css;.shtm;.shtml;.php;.jsp" />
<xsd:attribute name="target" type="browsingContext" vs:requiredattribute="href" />
<xsd:attribute name="name" />
<xsd:attribute name="ping" vs:requiredattribute="href" />
<xsd:attribute name="rel" type="anchorLinkType" vs:requiredattribute="href" />
<xsd:attribute name="media" type="mediaType" default="screen" vs:requiredattribute="href" />
<xsd:attribute name="hreflang" type="i18LanguageCode" vs:requiredattribute="href" />
<xsd:attribute name="type" type="simpleContentType" vs:requiredattribute="href" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
And adding xmlns:asp='http://schemas.microsoft.com/intellisense/html5/asp' to the <body></body> tag, but I only get the usual server side only Intellisense.
I actually want this for my custom server controls, but can get there on my own from here.

Related

How to fix screen orientation to default (either potrit or landscape) for my whole PhoneGap app

I have created an app using phonegap. I have installed that app in my mobile. Can anyone explain me to how to rotate my app screen based on the mobile position?
My Config.xml file:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.mydomain.login_form" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>LoginForm</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="sample.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-intent href="market:*" />
<preference name="loglevel" value="DEBUG" />
<preference name="orientation" value="default" />
<plugin name="net.yoik.cordova.plugins.screenorientation" spec="1.3.1" source="pgb"></plugin>
<feature name="Whitelist">
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
<param name="onload" value="true" />
</feature>
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.geolocation.Geolocation" />
</feature>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker" />
<feature name="Compass">
<param name="android-package" value="org.apache.cordova.deviceorientation.CompassListener" />
</feature>
</widget>
Thanks in advance.
You can set orientation preference into config.xml file
<preference name="orientation" value="default" />
<!-- all: default means both landscape and portrait are enabled -->
or
<preference name="orientation" value="portrait" />
or
<preference name="orientation" value="landscape" />
You can check other all config related settings here in this link

Office AddIn button's icon won't show up

Here's extract from the manifest's Host
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<CustomTab id="MyTab">
<Group id="Raporty.GroupPabcd">
<Label resid="Raporty.GroupPabcd.Label" />
<Icon>
<bt:Image resid="Raporty.Icon1_16" size="16" />
<bt:Image resid="Raporty.Icon1_20" size="20" />
<bt:Image resid="Raporty.Icon1_24" size="24" />
<bt:Image resid="Raporty.Icon1_32" size="32" />
<bt:Image resid="Raporty.Icon1_40" size="40" />
<bt:Image resid="Raporty.Icon1_48" size="48" />
<bt:Image resid="Raporty.Icon1_64" size="64" />
<bt:Image resid="Raporty.Icon1_80" size="80" />
</Icon>
<Control xsi:type="Button" id="RaportPabcd.Button">
<Label resid="RaportPabcd.Button.Label" />
<Supertip>
<Title resid="RaportPabcd.Button.Label" />
<Description resid="RaportPabcd.Button.Tooltip" />
</Supertip>
<Icon>
<bt:Image resid="Raporty.Icon1_16" size="16" />
<bt:Image resid="Raporty.Icon1_20" size="20" />
<bt:Image resid="Raporty.Icon1_24" size="24" />
<bt:Image resid="Raporty.Icon1_32" size="32" />
<bt:Image resid="Raporty.Icon1_40" size="40" />
<bt:Image resid="Raporty.Icon1_48" size="48" />
<bt:Image resid="Raporty.Icon1_64" size="64" />
<bt:Image resid="Raporty.Icon1_80" size="80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>ButtonId1</TaskpaneId>
<SourceLocation resid="Contoso.Taskpane.Url" />
</Action>
</Control>
</Group>
<Label resid="Raporty.Tab.Label" />
</CustomTab>
</ExtensionPoint>
as well as the resources
<Resources>
<bt:Images>
<bt:Image id="Raporty.Icon1_16" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_16.png" />
<bt:Image id="Raporty.Icon1_20" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_20.png" />
<bt:Image id="Raporty.Icon1_24" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_24.png" />
<bt:Image id="Raporty.Icon1_32" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_32.png" />
<bt:Image id="Raporty.Icon1_40" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_40.png" />
<bt:Image id="Raporty.Icon1_48" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_48.png" />
<bt:Image id="Raporty.Icon1_64" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_64.png" />
<bt:Image id="Raporty.Icon1_80" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_80.png" />
</bt:Images>
</Resources>
Problem is that the button shows the default icon
I tried to access the image directly in the browser (i.e. http://localhost/ExcelWebWeb/Images/ReportIcons/report_1_32.png) and it does show up
I have taken a look at the IIS logs to see if the image was even queried by the Excel app, but it wasn't. I can only see access logs from my local browser to the icons while the addin only queries the html/js files (for the TaskPane) without querying for the button's image.
I had the same issue but found a solution. Please add the following to the manifest.xml file:
<Version>1.0.0.0</Version>
<ProviderName>abc</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of
the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="abc" />
<IconUrl DefaultValue="~remoteAppUrl/Images/add-in-icon-lo-res.png"/>
<HighResolutionIconUrl DefaultValue="~remoteAppUrl/Images/add-in-icon-hi-res.png"/>
Resolution for the image should be Iconurls 64 x 64 pixels with 8 bit depth in png and for HighResolutionIconUrl 128 x 128 pixels
try replacing '~remoteAppUrl' with localhost:[port number]. When you publish the app, this needs to be changed to the host and port number
<CustomTab id="MyTab">
<Group id="Raporty.MyTab.GroupPabcd">
<Label resid="Raporty.MyTab.GroupPabcd.Label" />
......
<Label resid="Raporty.MyTab.TabLabel" />
That is corect code for manifest.

How to enable title bar in Cordova Application?

Below is my code... I was not able to enable Title bar in my application.
How to enable that ?
config.xml
<widget id="com.example.hello" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<preference name="loglevel" value="DEBUG" />
<feature name="Whitelist">
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
<param name="onload" value="true" />
</feature>
<allow-intent href="market:*" />
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
</widget>
I tried this..
<preference name="Fullscreen" value="false">
but its not working... Still the activity is displayed in fullscreen mode... How to disable that fullscreen and show title bar ?
Add these two lines in config file
preference name="fullscreen" value="false"
preference name="showtitle" value="true"

log4net Mysql logging not working in my .net 3.5 application

I have a application where simple text file logging is working fine. now i also needed to logging in mysql database.
But nothing happened after my log entries of code.
My log4net configuration is
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<immediateFlush value="true" />
<bufferSize value="1" />
<connectionType value="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<connectionString value="data source=localhost;initial catalog=mytestdb;User ID=root;Password=" />
<commandText value="INSERT INTO system_log(thread,level,appname,message,action) VALUES (?thread, ?level, ?appname, ?message, ?action)" />
<parameter>
<parameterName value="thread" />
<dbType value="String" />
<size value="100" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%t" />
</layout>
</parameter>
<parameter>
<parameterName value="level" />
<dbType value="String" />
<size value="10" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%p" />
</layout>
</parameter>
<parameter>
<parameterName value="appname" />
<dbType value="String" />
<size value="10" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="My Web Service" />
</layout>
</parameter>
<parameter>
<parameterName value="message" />
<dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%m" />
</layout>
</parameter>
<parameter>
<parameterName value="action" />
<dbType value="String" />
<size value="45" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%5c{1}.%M" />
</layout>
</parameter>
<filter type="log4net.Filter.LevelRangeFilter">
<acceptOnMatch value="true" />
<levelMin value="DEBUG" />
<levelMax value="FATAL" />
</filter>
</appender>
<!--<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender" >
<file value="..\\Logs.txt" />
<appendToFile value="true" />
<datePattern value="yyyyMMdd" />
<rollingStyle value="Date" />
<filter type="log4net.Filter.LevelRangeFilter">
<acceptOnMatch value="true" />
<levelMin value="DEBUG" />
<levelMax value="FATAL" />
</filter>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d{yyyy-MM-dd HH:mm:ss.fff} %10p %-5property{_App} %-5property{_Node} [%2t] %5c{1}.%M - %m%n" />
</layout>
</appender>-->
<root>
<level value="ALL" />
<!--<appender-ref ref="RollingLogFileAppender" />-->
<appender-ref ref="AdoNetAppender" />
</root>
</log4net>
In current configuration buffersize was initially set to 100.. So I have to set it to 0 or 1 so that log4net immediately send message.
<bufferSize value="0" />
Second Problems was i were using commandparamter in wrong way
I have set it to
<commandText value="INSERT INTO system_log(thread_id,level,appname,message,action) VALUES (#threadParam,#levelParam,#appnameParam,#messageParam,#actionParam);" />
which works

Server control width won't apply with IE11 ?

I have this simple server control with a valid Width attribute : ( asp.net 4 , vs2010 )
<asp:TextBox runat="server" ID="TXT_UserName" Width="250px"></asp:TextBox>
On all browsers (all + ie<11) it does render as it should with the appropriate Width
But with ie11 ( windows 8.1 ) it wont render as it should : (it's even not in the view source ) :
Here is how I see it in other browsers ( including ie<11)
I've already added (for past problems which are now solved) the App_Browsers folder with the appropriate files for compatibility with IE versions :
Question :
Why I'm not seeing the width attribute and how can I fix it ?
Hmm...can't reproduce your error, and I don't have any special App_Browser folder, though I'm on VS2012 (4.5):
<asp:TextBox ID="styletextbox1" runat="server" Width="250px"></asp:TextBox>
Render Source (ie11):
<input name="ctl00$MainContent$styletextbox1" type="text" id="MainContent_styletextbox1" style="width:250px;" />
Dev tools (ie11):
So our diff are:
VS2012
4.5
App_Browser
Hth...
I had the same issue and fixed.
Your App_Browsers folder should contain:
firefox.browser, ie.browser, and ie11.browser
The ie11.browser content:
<browsers>
<browser id="IE11" parentID="Mozilla">
<identification>
<userAgent match="Trident\/7.0; rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)" />
<userAgent nonMatch="IEMobile" />
</identification>
<capture>
<userAgent match="Trident/(?'layoutVersion'\d+)" />
</capture>
<capabilities>
<capability name="browser" value="IE" />
<capability name="layoutEngine" value="Trident" />
<capability name="layoutEngineVersion" value="${layoutVersion}" />
<capability name="extra" value="${extra}" />
<capability name="isColor" value="true" />
<capability name="letters" value="${letters}" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="screenBitDepth" value="8" />
<capability name="type" value="IE${major}" />
<capability name="version" value="${version}" />
</capabilities>
</browser>
<!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11,0) like Gecko -->
<browser id="IE110" parentID="IE11">
<identification>
<capability name="majorversion" match="11" />
</identification>
<capabilities>
<capability name="ecmascriptversion" value="3.0" />
<capability name="jscriptversion" value="5.6" />
<capability name="javascript" value="true" />
<capability name="javascriptversion" value="1.5" />
<capability name="msdomversion" value="${majorversion}.${minorversion}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="ExchangeOmaSupported" value="true" />
<capability name="activexcontrols" value="true" />
<capability name="backgroundsounds" value="true" />
<capability name="cookies" value="true" />
<capability name="frames" value="true" />
<capability name="javaapplets" value="true" />
<capability name="supportsCallback" value="true" />
<capability name="supportsFileUpload" value="true" />
<capability name="supportsMultilineTextBoxDisplay" value="true" />
<capability name="supportsMaintainScrollPositionOnPostback" value="true" />
<capability name="supportsVCard" value="true" />
<capability name="supportsXmlHttp" value="true" />
<capability name="tables" value="true" />
<capability name="supportsAccessKeyAttribute" value="true" />
<capability name="tagwriter" value="System.Web.UI.HtmlTextWriter" />
<capability name="vbscript" value="true" />
</capabilities>
</browser>
</browsers>