<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>IT Mastering</title><link>http://code.msdn.microsoft.com/itmastering/Project/ProjectRss.aspx</link><description>A Place where you will find a lot of resources about programming languages and some Microsoft servers</description><item><title>NEW POST: .Net and DataGram</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=836</link><description>&lt;div class="wikidoc"&gt;
Hi All,&lt;br /&gt; &lt;br /&gt;I would like to know about DataGram and .Net.&lt;br /&gt;
&lt;/div&gt;</description><author>Jimmy_Ye</author><pubDate>Tue, 21 Oct 2008 05:49:27 GMT</pubDate><guid isPermaLink="false">NEW POST: .Net and DataGram 20081021A</guid></item><item><title>NEW POST: How to backup &amp; restore site collection using stsadm command tool</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=491</link><description>&lt;div class="wikidoc"&gt;
Using stsadm you can backup &amp;amp; restore a site collection &lt;br /&gt; &lt;br /&gt;To backup&lt;br /&gt;Stsadm –o backup –url &amp;lt;SiteURL&amp;gt; -filename &amp;lt;FileName&amp;gt;&lt;br /&gt; &lt;br /&gt;To restore&lt;br /&gt;Stsadm –o restore –url &amp;lt;restoretoURL&amp;gt; -filename &amp;lt;filetorestorefrom&amp;gt;&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Mon, 30 Jun 2008 21:28:09 GMT</pubDate><guid isPermaLink="false">NEW POST: How to backup &amp; restore site collection using stsadm command tool 20080630P</guid></item><item><title>NEW POST: How to know the requesting ip in asp.net and authenticate it</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=370</link><description>&lt;div class="wikidoc"&gt;
To know who is requesting your asp.net site you can know it from HttpRequest of current HttpContext&lt;br /&gt; &lt;br /&gt;if(HttpContext.Current.Request.UserHostAddress==&amp;quot;http://192.129.2.1&amp;quot;)&lt;br /&gt;{&lt;br /&gt;//Authenticated&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;//Not Authenticated&lt;br /&gt;}&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Tue, 20 May 2008 08:21:29 GMT</pubDate><guid isPermaLink="false">NEW POST: How to know the requesting ip in asp.net and authenticate it 20080520A</guid></item><item><title>NEW POST: How to change the current identity in asp.net</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=369</link><description>&lt;div class="wikidoc"&gt;
To change the current identity(user) in asp.net ,here is a sample of code&lt;br /&gt; &lt;br /&gt;	System.Security.Principal.GenericIdentity id = new System.Security.Principal.GenericIdentity(&amp;quot;Mustafa Refai&amp;quot;);&lt;br /&gt;	System.Security.Principal.GenericPrincipal p = new System.Security.Principal.GenericPrincipal(id, new string[]Mustafa Refai&amp;quot;, &amp;quot;MRefai);&lt;br /&gt;	HttpContext.Current.User = p;&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Tue, 20 May 2008 08:18:16 GMT</pubDate><guid isPermaLink="false">NEW POST: How to change the current identity in asp.net 20080520A</guid></item><item><title>NEW POST: How to Create Custom attribute</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=368</link><description>&lt;div class="wikidoc"&gt;
To create a custom attribute for classes , methods or properties you have to create a new class inheriting from System.Attribute&lt;br /&gt;This is a sample for a custom attribute class&lt;br /&gt; &lt;br /&gt;[AttributeUsageAttribute(AttributeTargets.All,AllowMultiple=true)]&lt;br /&gt;    public class Author:System.Attribute&lt;br /&gt;    {&lt;br /&gt;        public Author(string name)&lt;br /&gt;        {&lt;br /&gt;            this.Name = name;&lt;br /&gt;        }&lt;br /&gt;        public string Name { get; set; }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;and you can then use it like this&lt;br /&gt; &lt;br /&gt;public class ClassWithCustomAttribute&lt;br /&gt;    {&lt;br /&gt;        [Author(&amp;quot;Mustafa Refai&amp;quot;)]//here is the custom attribute&lt;br /&gt;        public string Property1&lt;br /&gt;        { get; set; }&lt;br /&gt;    }&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Tue, 20 May 2008 08:15:31 GMT</pubDate><guid isPermaLink="false">NEW POST: How to Create Custom attribute 20080520A</guid></item><item><title>NEW POST: Change assigned to for workflow task outside the workflow</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=335</link><description>&lt;div class="wikidoc"&gt;
Unfortunally, AssignedTo field is a read only field so if you want to change the value of this field you have to do this work around&lt;br /&gt; &lt;br /&gt;First, you have to update the task from the application and set a new field which will have the new value of assigned to like this&lt;br /&gt; &lt;br /&gt;SPListItem item = taskList.Items[0];//Item task&lt;br /&gt; &lt;br /&gt;//item[&amp;quot;AssignedTo&amp;quot;]=&amp;quot;Domain\UserName&amp;quot;;//Will not work&lt;br /&gt; &lt;br /&gt;Hashtable prop= new Hashtable();&lt;br /&gt; &lt;br /&gt;prop[&amp;quot;AssignedTo_UI&amp;quot;]=&amp;quot;Domain\UserName&amp;quot;;&lt;br /&gt; &lt;br /&gt;SPWorkFlowTask.AlterTask(item,prop,true);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Then inside you workflow the OnTaskChanged even will fire, in this even handler you will have to check the value of this new field in the ExtendedProperties collection then take this value and set it to AssingedTo field which will be accepted because it is being updated inside the workflow it slef.&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Sun, 04 May 2008 13:40:37 GMT</pubDate><guid isPermaLink="false">NEW POST: Change assigned to for workflow task outside the workflow 20080504P</guid></item><item><title>NEW POST: Simple Encryption and Decryption</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=334</link><description>&lt;div class="wikidoc"&gt;
protected string EncryptString(string eString) &lt;br /&gt;        {&lt;br /&gt;            Byte[] b = System.Text.ASCIIEncoding.ASCII.GetBytes(eString); &lt;br /&gt;            string es = Convert.ToBase64String(b); &lt;br /&gt;            return es; &lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        protected string DecryptString(string dString) &lt;br /&gt;        {&lt;br /&gt;            Byte[] b = Convert.FromBase64String(dString); &lt;br /&gt;            string ds = System.Text.ASCIIEncoding.ASCII.GetString(b); &lt;br /&gt;            return ds; &lt;br /&gt;        }&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Sun, 04 May 2008 13:32:59 GMT</pubDate><guid isPermaLink="false">NEW POST: Simple Encryption and Decryption 20080504P</guid></item><item><title>NEW POST: Get List and Item of workflow task</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=229</link><description>&lt;div class="wikidoc"&gt;
To get item id of a workflow task&lt;br /&gt; &lt;br /&gt;workflowItemID=(int)item[&amp;quot;ows_WorkflowItemId&amp;quot;];//item is the SPListItem that represents the task&lt;br /&gt; &lt;br /&gt;To get list guid of a workflow task&lt;br /&gt; &lt;br /&gt;listGuid=new Guid(item[&amp;quot;ows_WorkflowListId&amp;quot;].ToString());&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Sun, 30 Mar 2008 12:30:13 GMT</pubDate><guid isPermaLink="false">NEW POST: Get List and Item of workflow task 20080330P</guid></item><item><title>NEW POST: Update workflow task from UI or external code</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=228</link><description>&lt;div class="wikidoc"&gt;
When you are about to change workflow task properties or update it outside the event of UpdateTask inside the workflow it will through exception that &amp;quot;Can not update the task because it is locked by a workflow&amp;quot;, so to update a task from outside the workflow events you have to use AlterTask&lt;br /&gt; &lt;br /&gt;        &lt;i&gt;SPList list = site.RootWeb.Lists[&amp;quot;Workflow Tasks&amp;quot;];&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;        &lt;i&gt;SPListItem taskItem = list.GetItemById(int.Parse(Request.QueryString[&amp;quot;TaskID&amp;quot;]));&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;        &lt;i&gt;Hashtable taskHash = new Hashtable();&lt;/i&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;i&gt;taskHash[&amp;quot;% Complete&amp;quot;] = 1;//if the key is one of the predefined properties then it will be set otherwise it will be inserted into the extented properties&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;        &lt;i&gt;SPWorkflowTask.AlterTask(taskItem, taskHash, true);&lt;/i&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Sun, 30 Mar 2008 07:34:13 GMT</pubDate><guid isPermaLink="false">NEW POST: Update workflow task from UI or external code 20080330A</guid></item><item><title>NEW POST: Using chaching in class library</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=180</link><description>&lt;div class="wikidoc"&gt;
It is common to use caching in ASP.Net forms, but what if you want to use it in class library?&lt;br /&gt; &lt;br /&gt;You will have to add System.Web refrence and then use the caching like this&lt;br /&gt; &lt;br /&gt;System.Web.HttpRuntime.Cache[&amp;quot;ProductData&amp;quot;] = GetProductData();&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Mon, 17 Mar 2008 12:17:40 GMT</pubDate><guid isPermaLink="false">NEW POST: Using chaching in class library 20080317P</guid></item><item><title>NEW POST: Sharing data among controls using page context</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=179</link><description>&lt;div class="wikidoc"&gt;
It happens manytime that you have data fetched from the database from one control and you need to populate this data but on seperate controls on the same page, the most useful solution is to use Page.Context which is a collection shared between all controls on the same page&lt;br /&gt; &lt;br /&gt;In one of the control you may have this&lt;br /&gt; &lt;br /&gt;&lt;i&gt;Context.Items[&amp;quot;ProductData&amp;quot;] = GetProductData();&lt;/i&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;In other control you then get this value like this &lt;br /&gt; &lt;br /&gt;&lt;i&gt;DataSet ds = (DataSet)Context.Items[&amp;quot;ProductData&amp;quot;];&lt;/i&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Mon, 17 Mar 2008 11:51:49 GMT</pubDate><guid isPermaLink="false">NEW POST: Sharing data among controls using page context 20080317A</guid></item><item><title>CREATED RELEASE: Create a multi-language MOSS site (Mar 04, 2008)</title><link>http://code.msdn.microsoft.com/itmastering/Release/ProjectReleases.aspx?ReleaseId=598</link><description>It is becoming very common now to have site with more than one language, but it is little bit different in MOSS in the attached file a comprehensive explaining of how to create a multi - language  sites</description><author></author><pubDate>Tue, 04 Mar 2008 17:51:18 GMT</pubDate><guid isPermaLink="false">CREATED RELEASE: Create a multi-language MOSS site (Mar 04, 2008) 20080304P</guid></item><item><title>NEW POST: Get selected value from DropDownList using javascript</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=49</link><description>&lt;div class="wikidoc"&gt;
 &lt;br /&gt;document.getElementById('&amp;lt;%= drpStatus.ClientID %&amp;gt;').value; where &amp;quot;drpStatus&amp;quot; is the ID of Server DropDownList&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Wed, 06 Feb 2008 11:26:15 GMT</pubDate><guid isPermaLink="false">NEW POST: Get selected value from DropDownList using javascript 20080206A</guid></item><item><title>NEW POST: Access Local &amp; Global resource from javascript</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=48</link><description>&lt;div class="wikidoc"&gt;
You can access the local and global resources from java script&lt;br /&gt; &lt;br /&gt; alert('&amp;lt;%= GetLocalResourceObject(&amp;quot;ListItemResource3.Text&amp;quot;) %&amp;gt;');//&amp;quot;ListItemResource3.Text&amp;quot; is the key you want to get from the current local resource&lt;br /&gt; &lt;br /&gt;alert('&amp;lt;%= GetGlobalResourceObject(&amp;quot;westwindglobalization&amp;quot;,&amp;quot;Loading&amp;quot;) %&amp;gt;');//&amp;quot;westwindglobalization&amp;quot; is the resource file name and &amp;quot;Loading&amp;quot; is the key&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Wed, 06 Feb 2008 10:39:17 GMT</pubDate><guid isPermaLink="false">NEW POST: Access Local &amp; Global resource from javascript 20080206A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/itmastering/Wiki/View.aspx?title=Home&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;IT Mastering&lt;/b&gt;&lt;br /&gt;A place where you can find a lot of samples and solutions for common issues in dot net languages and famous Microsoft servers.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Wed, 06 Feb 2008 09:32:17 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080206A</guid></item><item><title>NEW POST: Change culture in aspx form</title><link>http://code.msdn.microsoft.com/itmastering/Thread/View.aspx?ThreadId=45</link><description>&lt;div class="wikidoc"&gt;
To change culture in aspx form you have to override InitializeCulture()&lt;br /&gt; &lt;br /&gt;protected override void InitializeCulture()&lt;br /&gt;        {&lt;br /&gt;                this.Culture = &amp;quot;ar-SA&amp;quot;;&lt;br /&gt;                this.UICulture = &amp;quot;ar-SA&amp;quot;;&lt;br /&gt;                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(&amp;quot;ar-SA&amp;quot;);&lt;br /&gt;                System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(&amp;quot;ar-SA&amp;quot;);&lt;br /&gt;                &lt;br /&gt;        }&lt;br /&gt;
&lt;/div&gt;</description><author>mostafa_alshimi</author><pubDate>Tue, 05 Feb 2008 13:40:21 GMT</pubDate><guid isPermaLink="false">NEW POST: Change culture in aspx form 20080205P</guid></item></channel></rss>