Tuesday, October 28, 2014

Get ASPX control value in ASCX page

Hello,

To achieve this scenario, you have to first define public property in aspx page like this.
public DropDownList AffinityGroupDDL
        {
            get
            {
                return ddlAffinityGroup;
            }
        }

After that you can access your page controls like below
var dropDownList = ((StMainDashboard)Page).AffinityGroupDDL;

Try this.

Tuesday, April 22, 2014

List locally installed digital certificates with C#

X509Store store = new X509Store(StoreName.Root,StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly);
Console.WriteLine("Friendly Name\t\t\t\t\t Expiration date");
foreach (X509Certificate2 certificate in store.Certificates)
{
   Console.WriteLine("{0}\t{1}", certificate.FriendlyName,certificate.NotAfter);
}
store.Close();
 
Note: You should import this namespace (System.Security.Cryptography.X509Certificates) 

Keyset does not exist

I got this error message when get installed certificates in my server. The problem was permission issue. Follow these steps to resolve it.
 1) Open Windows Explorer and navigate to the directory where the keys are located: C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys

 2) Make sure you’re not using the "Simple File Sharing" mode in Windows Explorer. In the Windows Explorer Tools menu, select "Folder Options". Then select the "View" tab. Scroll down and make sure the "Use simple file sharing" checkbox is unchecked.

3) Right-click on the MachineKeys folder. Select "Properties", then select the "Security" tab. (Note: If you didn’t turn off simple file sharing, you wouldn’t see the "security" tab.)

 4) You’re going to add your IUSR_**** account and give it full permission. Click the "Add.." button. Type your IUSR account name and click "Check Names". Then click "OK".

5) The IUSR account is now listed. Select it and then check the "Full Control" checkbox (causing all the other Allow checkboxes to be selected). Then click "Apply". Thanks

Wednesday, December 18, 2013

Parameter index is out of range nhibernate

I figured out that two fields in the .hbm.xml mapping file reference the same column in a table.

Monday, December 9, 2013

I Built a New Kind of Number Puzzle Game (And You Can Play It Free)

 For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...