Error in displaying page number in rdlc report - visual-studio-2010

I m getting error while trying to display page numbers using "Globals!PageNumber" in expression.. the place holder is accepting the expression but when i run the report i get #error in the page number field..is there any other way to do it ?

I've found two workarounds for this problem:
1) Changing Target Framework from 4.0 to 3.5 in the project settings
2) Adding the following line inside the web.config in the system.web section:
<trust legacyCasModel="true" level="Full"/>

Related

The Fragment element contains an unhandled extension element 'util:XmlFile'

I am writing a setup project for wix v3 in visual studio. The purpose of the project is to install a bunch of files to certain directories and then alter an XML file by setting values for elements. Everything builds fine until I add the XmlFile element to edit the XML file. Here is a code snippet of the element:
<Fragment>
<util:XmlFile
File="[INSTALLDIR]⁄Server/MEScontrol.config"
Id="config"
Action="setValue"
Name="connectionString"
ElementPath="⁄MEScontrol⁄DatabaseServer⁄Package[\[]#name='core'[\]]/add[[]#Assembly[\]]"
Value="[\[]#name='BINGBONG'[\]]" />
</Fragment>
The error I get when building is this:
"The Fragment element contains an unhandled extension element 'util:XmlFile'. Please ensure that the extension for elements in the 'http:⁄⁄schemas.microsoft.com⁄wix⁄UtilExtension' namespace has been provided"
I know that I need to add the namespaces
xmlns="http://schemas.microsoft.com/wix/2006/wi" and
xmlns:util="http://schemas.microsoft.com⁄wix⁄UtilExtension"
to my code and then add the reference WixUtilExtension to the project, which I have done, but I still get this error when building. Is it possible that I miss something in my code or references? I have also tried adding the util:XmlFile element as a Component inside my Directory structure but still the same error
Don't worry everybody I figured it out almost as soon as i posted this question. Apparently the "/" I was using in the namespace was not actually the correct character for a URL and that was causing the error. Silly me

Use Umbraco .NET Custom Control

I want to use Umbraco .NET Custom Control in Macro.
I have gone through following steps:
1) I have created new Macro with name TestProperty
2) Browse and Add Pramater from Assembly
3) Use Macro in Template
I did not get any problem till last step. But when i am previewing my Content then I am getting Page with Error as Below:
How can I get my Property Value in this case?
TestProperty is an Int. Try
new {TestProperty=2}
See http://blog.darren-ferguson.com/2014/05/13/typed-access-to-umbraco-marco-parameters-in-partial-views/

Running ASP.NET on Mono Resource Access Errors

Summary of Solutons: The core issue was that I had my resx files in subfolders within App_LocalResources and App_GlobalResources. Separating things into folders is fine on .NET but Mono only looks at the files in those folders ignoring any sub folders.
Issue #2 works only at runtime. In other words the Resources namespace can be used in the aspx or in code in a script block in the page but not in the code behind. It seems that I've never used the Resources namespace in the code-behind proper so all 3 of my issues are solved.
I have an ASP.NET application I was previously working on on .NET on a PC and am trying to move over to a Mac to develop using Mono and MonoDevelop. The application utilizes the App_GlobalResources and App_LocalResources folders. The application worked on .NET but does not function properly on Mono as I will outline. The version information is below:
OS: Mac OS 10.8.2
Mono: 2.10.9
ASP.NET: 4.0.30319.1
MonoDevelop: 3.0.5
I've tagged this with MonoDevelop because I'm not sure what server is being used and whether it is a part of MonoDevelop or Mono itself or is separate. I'm not familiar enough yet with Mono and it's parts...
The issues I'm having revolve around accessing resources and I'm having various related issues which I'll outline below:
Issue 1: meta:resourcekey doesn't work and "a resource object was not found at the specified virtualPath." error
I have App_LocalResources folders and resx files for each page at the root of the application as well as in sub-folders where page localization is required. Elements on the page that have a meta:resourcekey attribute do not have the relevant property assigned the value in the resx file.
So for example I have: /Site/Home.aspx with a /Site/App_LocalResources/Home folder which contains home.aspx.resx and related translations
N.B. as I was writing this I realised the names don't match up with regards the files case, but that is not the issue, I've tested with another page in the same folder and it doesn't render out the resource values.
The page in question has no code behind.
A different page in the root of the application called PageNotFound.aspx has related resx files in /App_LocalResources/PageNotFound/PageNotFound.aspx.resx
This page content is basically as follows (if I remove both the page renders)
<h2><asp:Literal runat="server" meta:resourcekey="PageNotFound" /></h2>
<% string message = GetLocalResourceObject("Sorry.Template").ToString(); %>
I get the same error whether I remove the first or the second of these lines. The error starts:
System.Resources.MissingManifestResourceException: A resource object was not
found at the specified virtualPath at
System.Web.Compilation.DefaultResourceProvider.GetLocalResourcesAssembly
If I remove the first line is actually builds and tries to render the page but crashes giving the above error.
If I remove the second line I get the error as well but it is while the page is being parsed and the runtime is trying to build the page class.
So for one page is seems build and run with meta:resourcekey attributes but isn't binding the resource value to the properties of the underlying controls, on another page it seems to crash trying to access the resources. The odd thing is the page that crashes is a very simple page without a master page and it basically only has the above content, the other page is quite complex with a master page and it renders (i.e. no parser error) but without the resourcekey values assigned....
The only differences that I can see are that one page is in the root directory and no master page, the other is in a sub folder and has a master page? Go figure! Any ideas?
Issue 2: Resources namespace doesn't exist
If I access a page that uses the 'Resources' namespaces that is available in .NET, I get a runtime compilation error, as in the app builds when compiled, but as the page is parsed and compiled it causes a (runtime) exception...
Compilation Error: CS0103: The name 'Resources' does not exist in the current context
The code would be in the code behind: (EDIT: The following line I think, was me testing, my code never uses this namespace in a code behind (compile time) class. Once the global resources functioned then the namespaces worked at runtime, but not in scenarios where the namespace needs to be verified at compile time as outlined in the summary at the top of the question)
msg.Subject = Resources.EmailResources.Request_SubjectLine
or in a script block in the aspx itself i.e.
<%= Resources.EmailResources.Request_SubjectLine %>
Neither of these types of access to the Resources namespace work. Why does this not work in Mono. Does the Mono framework not generate this stuff for us like .NET does? (I'm fairly sure this namespace hierarchy is generated by the ASP.NET framework on .NET and therefore wonder if this just has not been implemented in Mono?)
Issue 3: GetGlobalResourceObject(...) Call Returns Null
In the code-behind I have calls to GetGlobalResourceObject() which works on .NET, but when I run it on Mono my code is throwing an exception. For example:
hlContact.Text = GetGlobalResourceObject("CommonResources", "Contact").ToString();
My folder structures is:
App_GlobalResources > CommonResources > CommonResources.resx and the designer file (CommonResources.Designer.cs) is there.
The resx files are all marked with build action of "EmbeddedResource", "Do not copy" use the Custom Tool "GlobalResourceProxyGenerator" and have a resource ID that makes sense for each file. (i.e. .App_GlobalResources.CommonResources)
The issue is that GetGlobalResourceObject() returns null... It's not finding the CommonResources resource....
Note that Mono is constructing '*.resource' files in the folder with the resx files.
Issue #1
Apparently mono doesn't search subdirectories for resources, that is you must keep them directly in App_LocalResources or App_GlobalResources. See the relevant part in the mono source code (line 134). If searching subdirectories is an official feature, then this is a bug, and can be easily fixed by changing the aforementioned line.
Issue #2
Works fine here (on linux).
Issue #3
I don't know how exactly you are embedding the resources, a small test project would help. For the App_GlobalResources the framework compiles them at runtime and then GetGlobalResourceObject works fine too.

How to resolve “Validation (): Element ‘x’ is not supported” warning in Visual Studio 2010

I have been getting all of these "Validation (): Element 'x' is not supported" warnings and I can't seem to find a way to get rid of them. Here are two examples:
Validation (XHTML 1.0 Transitional): Attribute 'name' is not a valid attribute of element 'ul'.
Validation (CSS 2.1): 'border-radius' is not a known CSS property name.
I have searched on the web and all solutions point to removing the following folder:
C:\Users\{username}\AppData\Roaming \Microsoft\VisualStudio\10.0\ReflectedSchemas
Which seems to fix 90% of people's issues, however I don't have that folder anywhere on my computer!
I am using Visual Studio 10 SP1 and this project is an MVC 3 project using Razor and HTML5.
So can anyone else suggest what else might be causing the issue?
Thanks very much.
I was encountering the same problem and ALL classic html elements (div, a, p, table..) in every page had green underlines. Intellisense did not give any help with these elements, as if they didn't exist. But all asp controls were fine and valid.
The error was the xmlns="https://www.w3.org/1999/xhtml" in the html tag in my master page. Html 5 does not seem to work well together with the xmlns declaration so I removed it, and voila - everything magically works again!
Those are valid warnings, not a bug or other sort of "issue." The list of valid attributes for <ul> is given in the W3C standards, and it doesn't include name. Meanwhile, border-radius was introduced in CSS 3, which means if you validate against CSS 2.1 it's not going to work.
You can either ignore them or figure out how to suppress those particular warnings in VS2010 (I know how to do that for VC++, but I haven't used VS for HTML before; there should be some section in the Properties window for it).
First of all you need to know it's not an error!
Steps to resolve the warning message for an element.
Right click the warning area, you will see a context menu.
Click "Formatting and Validation..." basically it's at the bottom of the menu.
Go to "Validation" in "HTML or HTML (Web Forms)" section. You'll see a checkbox with "Show errors" is checked to true with header "Options". Just unchecke it.
enter image description here
enter image description here
That's it, you are done...
You have to remove
xmlns="https://www.w3.org/1999/xhtml"
let it remain
<!DocType Html>
only above

selected menu item in mvc3

I am creating my first mvc3 application (no previous mvc either) I am wanting to create a top level menu and be able to add a "selected" or "active" css class to the select LI tag. I found this link active menu item - asp.net mvc3 master page Ihave tried to add it to a class however I get an error back "Error 1 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) G:\MvcMusicStore-v2.0\MvcMusicStore-Completed\MvcMusicStore\Helpers\HtmlHelpers.cs 26 31 MvcMusicStore
"
So I am thinking I am missing a reference to something however I don't know what. Can someone kindly tell me what I need to reference to get this to work.
Add the following using at the top of your HtmlHelpers.cs file:
using System.Web.Mvc.Html;
Now the htmlHelper.ActionLink line should compile just fine.

Resources