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 :
http://ask-leo.com/how_do_i_install_an_msi_file_that_requires_administrative_privileges_in_windows_vista.html

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 http://blogs.iis.net/bills/archive/2008/06/02/installing-asp-net-1-1-with-iis7-on-vista-and-windows-2008.aspx. After that, to run VS 2003 successfully follow the instructions in the following article http://technikhil.wordpress.com/2010/01/12/visual-studio-2003-and-windows-7-can-get-along-really/. For IIS modification http://blogs.iis.net/wonyoo/archive/2009/06/18/workaround-running-asp-net-1-1-on-vista-sp2-ws08-sp2.aspx.