.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Invalid XAML errors while using

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :WPF

I've been using Expression Blend to work with some WPF/E (Silverlight 4) code that was previously designed in Visual Studio.  The following code seems to work OK in the runtime,  but I get "Invalid XAML" when I look at it in Expression Blend:


      <Setter Property="Template">
          <ControlTemplate TargetType="HyperlinkButton">
            <Grid Cursor="{TemplateBinding Cursor} 

View Complete Post

More Related Resource Links

How to set a style's TargetType property in XAML to a Generic Class?


I've just moved to .NET 4.0 / Visual Studio 2010 and am hoping there is a new answer to this question, found on StackOverflow from over a year ago:

Is it possible to set a style's TargetType property in XAML to a Generic Class?

public class Selector<T> : Control { }

and then in xaml

<Style x:TargetType="Selector">
<Setter Property="MyProperty" Value="Green" />

I found this on the WPF Tutorial, and would like to find a similar mechanism for this situation above.

<!-- XAML 2009 -->
<ObservableCollection x:TypeArguments="Employee">
 <l:Employee FirstName="John" Name="Doe" />
 <l:Employee FirstName="Tim" Name="Smith" />
</ObservableCollection />



What's new in XAML of .NET 4.0

With .NET 4.0 Microsoft will bring up a improved version of XAML. This arcitle shows you the language enhancements they made.
Easy Object References with {x:Reference}

Built-in Types

Generics in XAML with x:TypeArguments

Support for Arbitrary Dictionary Keys

Use of Non-Default Constructors with x:Arguments

Use of Static Factory Methods with x:FactoryMethod

How can I be sure that my entire project is up-to-date and free of errors in VS2010?


Seems like a stupid question, but I will go to Build > Build Solution many many times and the build will succeed many many times, then I will put in a minor syntax error and the build will fail, BUT the build will not fail because of the minor syntax error; it will fail because of an unresolved type that I put in about twenty compiles ago. And then I will fix the minor syntax eror, and the compiler will still complain about the unresolved type. Here is my code:

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
  <form runat="server">
  Hello World!!  

Pretty simple, really. I go to Buld > Build WebApplication1 and it runs OK. Now, if I put in a minor syntax error, such as substitute "forrrrrrrm" for "form" and then try to Build Solution, it complains not about the misspelled word, but about the FreeTextBox. And then if I correct the misspelled wird, it still complains about the FreeTextBox. Which leads me to believe that Building the Solution does not check absolutely 100% everything that needs to be checked. Is there a more thorough way of compiling a program that I need to use?

Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

Invalid length for a Base-64 char array for my coding in ASP.net C#. How to solve it ?


Hi Friends ,

I have done encrypted password and decode but i got error  like  this  " Invalid length for a Base-64 char array" .

Pls help . Thanks


psswd = txtPassword.Text;

pwed = base64Decode(psswd);

public string base64Decode(string sData)
            System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
            System.Text.Decoder utf8Decode = encoder.GetDecoder();
            byte[] todecode_byte = Convert.FromBase64String(sData);
            int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
            char[] decoded_char = new char[charCount];
            utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
            string result = new String(decoded_char); return result;

Silverlight: Create Animations with XAML and Expression Blend


In this excerpt from his upcoming book, Laurence Moroney explains the basics of Silverlight animation and the animation tools available in Expression Blend.

Lawrence Moroney

MSDN Magazine August 2008

Toolbox: Logging Web App Errors, Learning LINQ, and More


See how to log Web application errors for better health monitoring, what to read if you're thinking about LINQ, and which blog Scott recommends reading this month.

Scott Mitchell

MSDN Magazine April 2008

Enterprise Library: Take Exception To Critical Errors With Custom Application Blocks


Enterprise Library is a collection of application functionality blocks that you can re-use in your application for common functionality you'd otherwise have to write again and again. Here Jay Hilyard explains how to use them.

Jay Hilyard

MSDN Magazine September 2006

Toolbox: Synchronize Data, Review Runtime Errors, and More


This month we bring you products that let you synchronize data, correct runtime errors, and more.

Scott Mitchell

MSDN Magazine August 2006

ASP.NET MVC3 Areas and Razor views produce errors?


The view at '~/Areas/SomeArea/Views/List/Index.cshtml' must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl.

The project structure is pretty much default. There is one area called SomeArea. It has a single controller called List. It does nothing except:

public ActionResult Index()
    return View("~/Areas/SomeArea/Views/List/Index.cshtml");

The view looks like:

@inherits System.Web.Mvc.WebViewPage<dynamic>
    View.Title = "Index";
    LayoutPage = "~/Views/Shared/_Layout.cshtml";


I have tried emptying the entire file part by part and nothing seems to help. If I create a controller and view outside the area it works just fine. If I create an aspx view it works fine as well. Is it possible the default razor view engine doesn't support areas at this time?

The areas are registered too.

public static void RegisterRoutes(RouteCollection routes)
        "Default", // Route name
        "{controller}/{action}/{id}", // URL with parameters

Think that there is actually errors in ajax toolkit for 2.0 framework...hmm


Im using VS2008, asp.net C# 2.0.


Recently i tryed to correct some stuff on my page and i had a friend to take a look at the stuff...


What i did was that i have Examples page with code examples. Then accordion panes for each code piece...And syntaxhighlighter for each code piece. The code that i presented is read from the txt files wich makes it easyer for me to put new examples on the site...

But the problem is now that two of my accordion panes are not working...and everything works in all other browsers this just happens in Internet Explorer. This is kind of weird and my friends explaination was that there is actually errors in the ajax toolkit dll.


Im using the latest version of ajax toolkit for framework 2.0 wich is 1.0.20229.

My friend said its actually amazing that the toolkit has been out there for that long and it has not been tested that well and that there i still errors in it.


You can test this by your self by doing the exact as i explain:


go here: http://www.simpa.dk/Examples.aspx?cookieCheck=true

click Csharp

and try to open the accordion that is from the bottom 2 or 1 they dont collapse...

but this works in all other browsers then Internet Explore

Linq2Sql error: "Invalid attempt to call Read when reader is closed."


I've read up on this error from other posts and on other sites, but haven't found a solid resolution to the issue yet. My setup is as follows:

I have a RepositoryBase class that fields certain db calls that all repositories need to perform. In one such call, "GetSecurityGroup", it works most of the time, but will seemingly at random throw an exception with the error "Invalid attempt to call Read when reader is closed." All other Repository classes inherit from this one, and they all use the same DataContext object, which I understand isn't thread safe. Since there could be multiple calls to the DataContext object on the same page, perhaps one is using the DataContext when the next tries to do so. I'm not sure. What can I do to ensure this doesn't happen?

How to CATCH "Invalid postback or callback argument" exception?



How can I catch this exception? I do not want it to stop my page execution. Can/Should I do that?

Server Error in '/' Application.
Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally

WebResource.axd - Padding is invalid and cannot be removed error



I'm working on a site that is hosted externally, and the admin just sent me an email syaing they're getting this following error:


Event code: 3005 

Event message: An unhandled exception has occurred.

Event time: 11/17/2008 8:11:24 AM

Event time (UTC): 11/17/2008 8:11:24 AM

Event ID: 5d3b54c09a24463ca8fb03f22692e0bb

Event sequence: 731

Event occurrence: 3

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1776482879/ROOT-1-128713348984007217

Trust level: Full

Application Virtual Path: /

Application Path: D:\....

Machine name: ****

Process information:

Process ID: 2272

Process name: w3wp.exe

Account name: ****

Exception information:

Exception type: CryptographicException

Exception message: Padding is invalid and cannot be removed.

Request information:

Request URL: http://sitename/WebResource.axd?d=_O9D297IUE-qcgMP0yFe-w2&t=633468747532779057

Request path: /WebResource.axd

User host address:


Is authenticated: False

Authentication Type:

Thread ac

Validation errors and getting the site disability accessibile


I'm using the official validator from the World Wide Web Consortium, http://validator.w3.org/

And I'm seeing a lot of validation errors. What can be done to make my sharepoint publishing site a little more accessibility friendly?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend