tag:blogger.com,1999:blog-51625886979882255142009-07-13T22:29:42.379-07:00Cyberactiva WEBWeb programming tips and moreClaudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5162588697988225514.post-24839326454505100392008-07-06T14:14:00.000-07:002008-07-06T14:34:03.938-07:00WEBSERVICES TO A SHAREPOINT SUBSITE<a href="http://bebruvsd01/eysdocmanagement/_vti_bin/lists.asmx" target="_blank"></a>Just a small tip that will help you to avoid to loose half a day looking for a solution...<br /><br />When using Sharepoint throught web services remember to set the WEB REFERENCE to the right website.<br /><br />If you have to access the main website point to http://<typehereyourdomain>/_vti_bin/lists.aspx <span style="font-weight: bold;">but</span>, if you need to work on a subsite, remember that you have to point to the right web service, i.e. http://<typehereyourdomain>/<typehereyoursubsite>/_vti_bin/lists.aspx.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5162588697988225514-2483932645450510039?l=www.cyberactiva.com%2Fdefault.htm'/></div>Claudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.com18tag:blogger.com,1999:blog-5162588697988225514.post-91956994048804818142008-03-06T01:22:00.000-08:002008-03-06T01:38:33.760-08:00EASY REGULAR EXPRESSIONS IN C#I really love using regular expressions.<br />It's so easy to check strings... for example if you want only alphanumeric or only numbers or a very specific format like two letters, one point, one number and a #, in the specific order.<br />In my opinion, it's highly difficult to create the reg exp from scratch.<br />I have found a very good shareware program which build and test them for me. <a href="http://www.ultrapico.com/">You can find it here.</a><br /><br />Once you have your regular expression, how can you use it in your code?<br />Let's say you just need to check if a string is composed only by alphanumeric chars.<br /><br />Here's a bit of C# code:<br /><br /><strong><span style="font-family:arial;font-size:85%;color:#3333ff;">string mystring = "HELLO";<br />string regExpString = "^\\w+$";</span></strong><br /><br /><strong><span style="font-family:arial;font-size:85%;color:#3333ff;">if (System.Text.RegularExpressions.Regex.IsMatch( mystring , regExpString))<br /> //here mystring contains only alphanumerics<br />else<br /> // here mystring contains also something else</span></strong><br /><br />So... isn't it easy?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5162588697988225514-9195699404880481814?l=www.cyberactiva.com%2Fdefault.htm'/></div>Claudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.com7tag:blogger.com,1999:blog-5162588697988225514.post-89936606839082511132008-02-26T00:54:00.000-08:002008-02-26T01:00:40.953-08:00SHAREPOINT: One of more field types are not installed properlyIf you get this error while debugging your Sharepoint application, you have probably to know that you must call the fields with their INTERNAL NAME, which can be different from the name you see on labels on the site.<br /><br />How can you find the correct internal name?<br />You can go to a page in which you have the possibility to edit all the fields and then look in the page source for the fieldname; otherwise you can also order a view by the specific field and then see what is written in the url.<br /><br />I got this problem while trying to use the method UpdateListItems<br />in the lists.asmx Sharepoint webservices.<br />Here is the code I used:<br /><br /><span style="font-style: italic;font-size:85%;" >XmlDocument doc = new XmlDocument();<br />XmlElement newFile = doc.CreateElement("Batch");<br />newFile.SetAttribute("OnError", "Return");<br /><br />// as field name, we must pass the INTERNAL NAMES of the fields, example: Title is the internal name of the field Subject<br /><br />newFile.InnerXml = "<method id="'1'" cmd="'New'">" +<br />"<field name="'ID'">New</field>" +<br />"<field name="'Title'">" + NewName + "</field>" + // Title is the internal name of Subject<br />"<field name="'Client'">" + _client + "</field>" +<br />"<field name="'List_x0020_type'">" + _listtype + "</field>" + //internal name of List type<br />"<field name="'Country'">" + _country + "</field>" +<br />"<field name="'Datext'">" + _datext + "</field>" +<br />"</method>";<br />XmlNode returnValue = WS.UpdateListItems("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", newFile);</span><br /><br />Hope this will help you!<br /><blockquote></blockquote><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5162588697988225514-8993660683908251113?l=www.cyberactiva.com%2Fdefault.htm'/></div>Claudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.com1tag:blogger.com,1999:blog-5162588697988225514.post-18871988326677340572008-02-24T10:05:00.000-08:002008-02-24T10:29:50.203-08:00NEW 2008 LAYOUT AND PLATFORMThis is the new layout of Cyberactiva.<br />At last I have decided to move towards a standard platform (Blogger), after many years spent to continuosly update my old selfmade platform. This is not a defeat, actually.<br />When I started publishing articles on the web, five years ago, I wasn't satisfied with any of the CMS on the open source market... and I didn't want to spend money to buy any. So I just extended a product I developed for a client.<br />I am not selling CMS anymore and so I had no time to update it with all the new features that everybody can find for free on Blogger or on Wordpress, just to mention the most known.<br />If you are interested in old articles, here you can find older messages about <a href="http://www.cyberactiva.com/web_marketing.asp">WEB MARKETING</a> and here about <a href="http://www.cyberactiva.com/programming_tips.asp">WEB PROGRAMMING.</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5162588697988225514-1887198832667734057?l=www.cyberactiva.com%2Fdefault.htm'/></div>Claudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.com0tag:blogger.com,1999:blog-5162588697988225514.post-80490438463780679122008-02-24T09:56:00.000-08:002008-02-24T10:00:06.606-08:00Visual web developer: compile and publish your web site<h3><span style="font-size:85%;"><span style="font-weight: normal;font-family:arial;" >Visual web developer is a very good free environment to develope web projects over the .NET 2.0 framework. </span><br /><span style="font-weight: normal;font-family:arial;" >Everything works fine, developing is great, debugging much better than in visual studio 2003.</span><br /><span style="font-weight: normal;font-family:arial;" >The problem comes when you need to publish the web site. This option is not available on visual web developer. It is available only in Visual Studio 2005.</span><br /><span style="font-weight: normal;font-family:arial;" >You could just copy all source files on the server, and they will be compiled run-time; anyway it is not recommendable to distribute source file, I mean for business reasons.</span><br /><span style="font-weight: normal;font-family:arial;" >The alternative is to open the command console and launch the following command:</span><br /><br /><span style="font-family:arial;">aspnet_compiler -p C:\MyWebSite -v / C:\Staging </span><br /><br /><span style="font-weight: normal;font-family:arial;" >This should produce the DLL to copy on the server.</span></span><br /></h3><!-- SiteSearch Google --><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5162588697988225514-8049043846378067912?l=www.cyberactiva.com%2Fdefault.htm'/></div>Claudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.com0tag:blogger.com,1999:blog-5162588697988225514.post-42959618752705090982008-02-24T09:27:00.000-08:002008-02-24T10:01:23.765-08:00SHAREPOINT:The list that is referenced here no longer existsAre you get this error while using the updatelistitems method in SHAREPOINT web service (list.asmx)?<br />Are you aiming to data stored in a subsite?<br />If so, the solution is to point the webservice of the subsite directly.<br />If your main site is http://cia, and your subsite is http://cia/coa, you should point to the webservice:<br /><br />http://cia/coa/_vti_bin/list.asmx<br /><br />Pay attention that, sometimes, when you update the webreference, in the app.config it remains the same. So change it there as well.<br /><br />Good luck!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5162588697988225514-4295961875270509098?l=www.cyberactiva.com%2Fdefault.htm'/></div>Claudio Barbahttp://www.blogger.com/profile/00947850690582728509noreply@blogger.com7