c# - server-relative List URL is not working (strange characters in link) -


i have strange issue server object model... creating timerjob, has run item.update() function , rest of work done event receiver.

server url - demo2010a:2010  sitecolletion url - http://www.contoso.com/sites/test/  list url - http://www.contoso.com/sites/test/lists/zadania%20naprawcze%20t/ 

the problem in:

        spsite site = new spsite("http://www.contoso.com/sites/test/");         spweb web = site.openweb("sites/test");          splist ldk_list = web.getlist("http://www.contoso.com/sites/test/lists/zadania naprawcze t"); //this working fine ! cant use absolute url !!!         splistitem item = ldk_list.getitembyid(5);         item["title"] = "testestestestes";         item.update(); 

this "test" code. list name "zadania naprawcze -t" in url strange working http://www.contoso.com/sites/test/lists/zadania naprawcze t want : web.getlist("/sites/zadania naprawcze -t"); or tried cut - etc. tell me should do? code running timer job.

your question isn't clear. "lists/zadania naprawcze t" works , url of list. "/lists/zadania%20naprawcze%20t/" same thing encoded (%20 = space). you're asking -t, - from? there difference between list title , list url, know right? getlist method requires provide list url, there splistcollection.trygetlist method provide title of list (web.lists.trygetlist()).


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -