Wednesday, October 13, 2010

Unable to find control id referenced by the 'ControlToCompare' property

When adding a CustomControl dynamically, you receive "Unable to find control id referenced by the 'ControlToCompare' property" error.

I search for the Internet and found no solution. I achieved this bu using JavaScript and jQuery.

In page add a startup script. (I don't like Page.RegisterStartupScript)

$(document).ready(function() {

<%= this.StartUpScript %>


In code behind

CompareValidator cv = new CompareValidator();
cv.ID = "customvalidatorid";
cv.ValueToCompare ="Whatever"; // You must set a value. Else, you get an error.

this.StartUpScript += String.Format("document.getElementById(\"{0}\").controltovalidate=\"{1}\";", cv.ClientID, YourControlToCompareId);
this.StartUpScript += String.Format("document.getElementById(\"{0}\").removeAttribute(\"valuetocompare\");", cv.ClientID);

That's it!

Saturday, March 27, 2010

Install Aspose.BarCode for Reporting Services on Windows 7

Aspose Barcode installer requires administrative permissions to be installed. However, "Run as administrator" does not appear in the context menu. To achieve this, start a new command prompt with "Run as Administrator" and run the installer by entering the path of it.

Reference :

VS2003 and Windows 7

This week, I have upgraded to Windows 7. I have spent hours to run VS 2003 on my computer. You should the follow this article in the specified order After that, to run VS 2003 successfully follow the instructions in the following article For IIS modification