Tuesday, November 27, 2012

Read Telerik drop downlist javascript

sometimes we need to read the value/text of a Telerik MVC dropDownList  items.
using JQUERY:

function getData()
{
var items= $('#dropdownlistName).data('tDropDownList').data;
// items is the items list
// items can be dealt as an array
// then we can get the text and the value of each item as following:
 
var text = items[0].Text;
var value = items[0].Value;
 
 
}

Note :
you have to read $('#dropdownlistName) " after document.read() function as we have to wait for  the Telerik JQuery library to be loaded.
it is preferred to be read pageLoad function of the Microsoft.Ajax library

function pageLoad()
{
    getData()
}

or at any event handler javascript function

Wednesday, November 14, 2012

certification under Network Service account


When your application use certification and you have a windows service, and  you set the user of the windows service to be for example Network Service to be able to access resources on network by the windows service , you may get the following exception

It is likely that certificate 'CN=XX' may not have a private key that is capable of key exchange or the process may not have access rights for the private key. Please see inner exception for detail. Keyset does not exist

 

 That mean the Network Service account have no access for the certification

Then You have to give authority for the Network Service account to access your certification

Then you can use WinHttpCertCfg

WinHttpCertCfg.exe -g -c LOCAL_MACHINE\MY -s "MyCompany" -a "NetworkService"

 

Reference