<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Fundamental Provocation &#187; Visual Studio</title> <atom:link href="http://www.ajaymatharu.com/tag/visual-studio/feed/" rel="self" type="application/rss+xml" /><link>http://www.ajaymatharu.com</link> <description>Blog by Ajay Matharu</description> <lastBuildDate>Sun, 06 Nov 2011 15:09:39 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>SharePoint Error: &#8220;The language-neutral solution package was not found&#8221;</title><link>http://www.ajaymatharu.com/sharepoint-error-the-language-neutral-solution-package-was-not-found/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharepoint-error-the-language-neutral-solution-package-was-not-found</link> <comments>http://www.ajaymatharu.com/sharepoint-error-the-language-neutral-solution-package-was-not-found/#comments</comments> <pubDate>Fri, 27 Nov 2009 07:52:13 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[Sharepoint]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Language Neutral Package]]></category> <category><![CDATA[Sharepoint Error]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1765</guid> <description><![CDATA[Last night while developing an event listener custom list, I ran into this error, SharePoint Error: &#8220;The language-neutral solution package was not found&#8221; The solution to this problem is, Restart your visual studio. And it will be back to normal. Hope this helps]]></description> <content:encoded><![CDATA[<p>Last night while developing an event listener custom list, I ran into this error,</p><blockquote><div> SharePoint Error: &#8220;The language-neutral solution package was not found&#8221;</div></blockquote><p>The solution to this problem is, Restart your visual studio. And it will be back to normal.</p><p>Hope this helps <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/sharepoint-error-the-language-neutral-solution-package-was-not-found/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Export grid values in excel</title><link>http://www.ajaymatharu.com/export-grid-values-in-excel/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=export-grid-values-in-excel</link> <comments>http://www.ajaymatharu.com/export-grid-values-in-excel/#comments</comments> <pubDate>Wed, 07 Oct 2009 07:19:02 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[C#]]></category> <category><![CDATA[C#.Net]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Datatable]]></category> <category><![CDATA[Export]]></category> <category><![CDATA[export records to excel]]></category> <category><![CDATA[gridview]]></category> <category><![CDATA[gridview to excel]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1179</guid> <description><![CDATA[Following code helps you to import grid values to excel, //Import System.IO in your application for StreamWriter Object //note: excel_file represents the complete physical address of excel file eg C:/myexcel.xls public void export_datagridview_to_excel(DataGridView dgv, string excel_file) { int cols; //open file StreamWriter wr = new StreamWriter(excel_file); //determine the number of columns and write columns to [...]]]></description> <content:encoded><![CDATA[<p>Following code helps you to import grid values to excel,</p><pre class="c-sharp" name="code">
//Import System.IO in your application for StreamWriter Object

//note: excel_file represents the complete physical address of excel file eg  C:/myexcel.xls
public  void export_datagridview_to_excel(DataGridView dgv, string excel_file)
{
int cols;
//open file
StreamWriter wr = new StreamWriter(excel_file);

//determine the number of columns and write columns to file
cols = dgv.Columns.Count;
for (int i = 0; i &lt; cols; i++)
{
wr.Write(dgv.Columns[i].Name.ToString().ToUpper() + “\t”);
}

wr.WriteLine();

//write rows to excel file
for (int i = 0; i &lt; (dgv.Rows.Count - 1); i++)
{
for (int j = 0; j &lt; cols; j++)
{
if (dgv.RowsIdea.Cells[j].Value != null)
wr.Write(dgv.Rows[i].Cells[j].Value + “\t”);
else
{
wr.Write(”\t”);
}
}

wr.WriteLine();
}

//close file
wr.Close();
}</pre>]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/export-grid-values-in-excel/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Add another application as child of BlogEngine.net</title><link>http://www.ajaymatharu.com/add-another-application-as-child-of-blogengine-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-another-application-as-child-of-blogengine-net</link> <comments>http://www.ajaymatharu.com/add-another-application-as-child-of-blogengine-net/#comments</comments> <pubDate>Fri, 28 Aug 2009 17:48:52 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[BE]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[Blog Engine]]></category> <category><![CDATA[blogengine]]></category> <category><![CDATA[blogengine.net]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[VS]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1632</guid> <description><![CDATA[I have been getting good response for my post Integrating blog engine into existing site. One of the guy asked me this question on how can we do the opposite? He had a BlogEngine as parent site and needed some other site to be child of BlogEngine. So He posted on that and this is [...]]]></description> <content:encoded><![CDATA[<p>I have been getting good response for my post <a href="http://www.ajaymatharu.com/integrating-blogengine-into-an-existing-site/" target="_blank">Integrating blog engine into existing site</a>. One of the guy asked me this question on how can we do the opposite? He had a BlogEngine as parent site and needed some other site to be child of BlogEngine. So He posted on that and this is the answer he got for his question.</p><p>You need to make this change in your web.config file. If you want to have a website as child of BlogEngine</p><pre name="code" class="xml"><strong>&lt;location path="." inheritInChildApplications="false"&gt;</strong>
 &lt;system.web&gt;
 ..... existing content .....
 &lt;/system.web&gt;
<strong>&lt;/location&gt;</strong>

<strong>&lt;location path="." inheritInChildApplications="false"&gt;</strong>
 &lt;system.webServer&gt;
 ..... existing content .....
 &lt;/system.webServer&gt;
<strong>&lt;/location&gt;</strong></pre>]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/add-another-application-as-child-of-blogengine-net/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Visual Studio 2010 IDE Overview</title><link>http://www.ajaymatharu.com/visual-studio-2010-ide-overview/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=visual-studio-2010-ide-overview</link> <comments>http://www.ajaymatharu.com/visual-studio-2010-ide-overview/#comments</comments> <pubDate>Sat, 25 Jul 2009 06:03:37 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[.Net]]></category> <category><![CDATA[.Net Framework 4.0]]></category> <category><![CDATA[Visual Studio 2010]]></category> <category><![CDATA[Visual Studio 2010 IDE]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=509</guid> <description><![CDATA[Understanding existing, and writing new, code As the complexity of applications grows so does the challenge of understanding the code that you’re working on. With Visual Studio 2010 the IDE provides integrated support for understanding what is happening in the code section that you’re viewing. The editor in Visual Studio 2010 has been rebuilt using [...]]]></description> <content:encoded><![CDATA[<p><strong>Understanding existing, and writing new, code</strong></p><p>As the complexity of applications grows so does the<br /> challenge of understanding the code that you’re working<br /> on. With Visual Studio 2010 the IDE provides integrated<br /> support for understanding what is happening in the code<br /> section that you’re viewing.</p><p>The editor in Visual Studio 2010 has been rebuilt using the<br /> Windows Presentation Foundation (WPF) technology. WPF<br /> enables the editor to richly present information about the<br /> code in the context of presenting the actual source. This ability<br /> enables features such as the “Document Map Margin” to render<br /> a graphical view of the source file including information such as<br /> layout, code coverage, symbol highlights and comments.</p><p>This editor ability also enables 3rd parties to create add-ins<br /> that show custom views of the underlying source file such as<br /> taking the XML Doc Comments and converting them to a rich<br /> presentation formation with fonts, colors and highlighting. It<br /> enables Visual Studio to display different layers on the editor<br /> so an add-in could represent a code-based formula in its<br /> traditional mathematical representation.</p><p>While the representation of the underlying source code is<br /> important so is the ability to understand what the code is<br /> actually doing. In Visual Studio 2010, features such as “Inline<br /> Call Hierarchy” &#8211; a feature which enables a developer to select<br /> an entity or method and see how the code calls inwards or<br /> outwards or passes the entity in and out of the code section<br /> - provide developers with the ability to understand the<br /> interaction of the code without needing to juggle multiple<br /> files. Other features such as “Highlight References”, which<br /> provide a visual representation of the references to a selected<br /> entity in the code without needing to use the “Find In Files”<br /> feature, or “Quick Searching”, which delivers a ‘word wheel’<br /> based search tool integrated with “Highlight References”,<br /> enable developers to maintain the context of where they are<br /> but gain the understanding of other locations in the code.</p><p>Additionally the editor integrates with the project system to<br /> simplify the pattern of Test Driver Development (TDD). With<br /> TDD, developers build the tests that will exercise their application<br /> code before they actually write that code. In Visual Studio<br /> 2010 developers can create tests and the editor will provide<br /> functionality to automatically implement the tested classes and<br /> code in the file the developer chooses. This enables developers to<br /> quickly create the class they are consuming without needing to<br /> break out of the test development flow to declare the tested class.</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/visual-studio-2010-ide-overview/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Visual Studio 2010 &#8211; My Review</title><link>http://www.ajaymatharu.com/visual-studio-2010-my-review/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=visual-studio-2010-my-review</link> <comments>http://www.ajaymatharu.com/visual-studio-2010-my-review/#comments</comments> <pubDate>Sat, 25 Jul 2009 06:03:31 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[.Net Framework 4.0]]></category> <category><![CDATA[Visual Studio 2010]]></category> <category><![CDATA[Visual Studio 2010 Review]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=617</guid> <description><![CDATA[Hi Guys, Microsoft released Visual Studio 2010 CTP in October. You&#8217;ll be amazed with the download size its near about 7 GB. You can download it from here. After you download you&#8217;ll run the .exe file to extract the setup and the setup is of the .vhd format that is Virtual PC hard disk. So [...]]]></description> <content:encoded><![CDATA[<p>Hi Guys, Microsoft released Visual Studio 2010 CTP in October. You&#8217;ll be amazed with the download size its near about 7 GB. You can download it from <a href="http://www.microsoft.com/downloads/details.aspx?familyid=922b4655-93d0-4476-bda4-94cf5f8d4814&amp;displaylang=en" target="_blank">here</a>.</p><p>After you download you&#8217;ll run the .exe file to extract the setup and the setup is of the .vhd format that is Virtual PC hard disk. So you&#8217;ll need Virtual PC to run Visual Studio 2010.</p><p>But, but, but guys please check out the minimum requirement for this CTP to run. Hard disk space required is 75 GB, yes, its not 7.5 but 75 GB. Well that&#8217;s not true you can have this CTP run if you have upto 25 GB on one drive.</p><p>When you extract the .exe file the .vhd file extracted is of size 23 GB.  Also when you bind the .vhd file to the virtual pc, you need minimum 1GB ram allocated to the Virtual PC disk.</p><p>When I ran the Visual Studio for the first time the screen took around 10 mins to load and I just shut down the CTP and got back to work.</p><p>The reason for the extracted file to be of 23 GB is because that VHD when you map to Virtual PC will have Visual Studio 2010, Visual Studio 2008,  SQL  Server 2008, SQL Server 2005 + many more software installed.</p><p>When you execute the Virtual PC which is mapped to VHD, Virtual PC will load Windows Server 2008 and it takes lots of  burden it killed my laptop. Although I have fair enough configuration. My processor is Core 2 Duo, 1.83 GHZ and with 1 GB ram. Yet it just killed my PC performance.</p><p>I even tried to extract the file on an External Hard Disk and Even on my IPod classic. But I was able to extract only first rar file. I googled the reason and found it was because the External Hard Disk is of FAT32 format and they do not support data transfer of more than 4GB. So I had to clean up my Hard Disk and extract 23 GB .vhd file there.</p><p>I really did not understood why Microsoft shipped Visual Studio 2010 this way. With 7GB download size and 23 GB extracted file. I was really disappointed with such strategy. Microsoft must have shipped Visual Studio 2010 as a single file. What could be the reason for adopting this process?</p><p>Here is my Virtual PC screen shot with Visual Studio 2010</p><p style="text-align:center;"><img class="aligncenter size-full wp-image-616" title="vs2010" src="http://ajaymatharu.files.wordpress.com/2008/12/vs2010.jpg" alt="vs2010" width="650" height="406" /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/visual-studio-2010-my-review/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Text Template Transformation Toolkit (T4) &#8211; T4 Template</title><link>http://www.ajaymatharu.com/text-template-transformation-toolkit-t4-t4-template/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=text-template-transformation-toolkit-t4-t4-template</link> <comments>http://www.ajaymatharu.com/text-template-transformation-toolkit-t4-t4-template/#comments</comments> <pubDate>Fri, 24 Jul 2009 03:34:45 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[AutoCode]]></category> <category><![CDATA[Code Generator]]></category> <category><![CDATA[T4 Template]]></category> <category><![CDATA[Text Template Transformation Toolkit]]></category> <category><![CDATA[Visual Studio Code Generator]]></category> <category><![CDATA[Visual Studio Template]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=481</guid> <description><![CDATA[Text Template Transformation Toolkit (T4) is a template-based code generation engine. This is one of the best things I found out today, so just thought of sharing with you guys. This is awesome code generator template. This template is best used to generate your business logic code that will communicate with the database. You can [...]]]></description> <content:encoded><![CDATA[<p><span style="color:#bb6f02;">Text Template Transformation Toolkit</span> (T4) is a template-based code generation engine. This is one of the best things I found out today, so just thought of sharing with you guys.</p><p>This is awesome code generator template. This template is best used to generate your business logic code that will communicate with the database.</p><p>You can create a code page that will have all your database tables as Classes and their fields as its variables. So you will have your database tables as class and its columns as variables. You will have everything object oriented.</p><p>This template has an extension &#8220;.tt&#8221; and you can write code in any language C# or Vb and have the code file generated in any of these language you want. All you have to do is write the code in &#8220;.tt&#8221; file and its corresponding &#8220;.cs&#8221; or &#8220;.vb&#8221; file will be generated once you save your &#8220;.tt&#8221; file.</p><p>Its truly AMAZING!!!</p><p>Check this out.</p><p>[googlevideo=http://video.google.com/videoplay?docid=-3383108526856631845&amp;hl=en]</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/text-template-transformation-toolkit-t4-t4-template/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>control does not exists in current context</title><link>http://www.ajaymatharu.com/control-does-not-exists-in-current-context/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=control-does-not-exists-in-current-context</link> <comments>http://www.ajaymatharu.com/control-does-not-exists-in-current-context/#comments</comments> <pubDate>Wed, 22 Jul 2009 17:24:49 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[.net controls]]></category> <category><![CDATA[C#]]></category> <category><![CDATA[C#.Net]]></category> <category><![CDATA[context]]></category> <category><![CDATA[Dot Net]]></category> <category><![CDATA[VB]]></category> <category><![CDATA[vb.net]]></category> <category><![CDATA[visual studio.net]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=665</guid> <description><![CDATA[Another one of those problems that can stump you for a while. I often make backups of files as I progress and sometimes leave them in the website folder, this was fine with classic ASP but as I have found with ASP.Net can cause all sorts of problems.One issue I was having was trying to [...]]]></description> <content:encoded><![CDATA[<p><span style="font-size:85%;">Another one of those problems that can stump you for a while. I often make backups of files as I progress and sometimes leave them in the website folder, this was fine with classic ASP but as I have found with ASP.Net can cause all sorts of problems.</span><span style="font-size:85%;">One issue I was having was trying to reference a component in my aspx page from the codebehind page and seeing the following error when trying to reference a label control:</span></p><blockquote><p><span style="font-size:85%;">“Label2 does not exist in the current context”</span></p></blockquote><p><span style="font-size:85%;">So I found that the problem was even though I renamed one of my old files it still contained the class that my codebehind was referencing (i.e. the class names were still the same) &#8211; and therefore was not seeing the newly added Label control to my new code.</span><span style="font-size:85%;">Shame the compiler doesn’t realise the duplication and give some indication.</span></p><p>Lesson: Remove any backed up files from the web folder and/or build directory to avoid pain <img class="wp-smiley" src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/control-does-not-exists-in-current-context/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Zipping in asp.net</title><link>http://www.ajaymatharu.com/zipping-in-asp-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zipping-in-asp-net</link> <comments>http://www.ajaymatharu.com/zipping-in-asp-net/#comments</comments> <pubDate>Sat, 20 Jun 2009 07:42:44 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Tip of Week]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1363</guid> <description><![CDATA[Zipping was never so easy in .Net. Check out this project on codeplex, http://dotnetzip.codeplex.com/ Here are the features of the DotNetZip Library, DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Create and read zip files in VB, C#, or any .NET language, [...]]]></description> <content:encoded><![CDATA[<p>Zipping was never so easy in .Net. Check out this project on codeplex, http://dotnetzip.codeplex.com/</p><p>Here are the features of the DotNetZip Library,<br /> DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Create and read zip files in VB, C#, or any .NET language, or any scripting environment. DotNetZip supports these scenarios:<br /> - an ASP.NET app that dynamically creates ZIP files and allows a browser to download them<br /> - a Windows Service that periodically zips up a directory for backup and archival purposes<br /> - a WPF program that modifyies an existing archive &#8211; renaming entries, removing entries from an archive, or adding new entries to an archive<br /> - a Windows Forms app that creates AES-encrypted zip archives for privacy of archived content.<br /> - An administrative script in PowerShell or VBScript that performs backup and archival.<br /> - a WCF service that receives a zip file as an attachment, and dynamically unpacks the zip to a stream for analysis<br /> - creating zip files from stream content, saving to a stream, extracting to a stream, reading from a stream<br /> - creation of self-extracting archives.</p><p>Njoy coding <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/zipping-in-asp-net/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Impersonation in Sharepoint &#8211; MOSS/WSS</title><link>http://www.ajaymatharu.com/impersonation-in-sharepoint-mosswss/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=impersonation-in-sharepoint-mosswss</link> <comments>http://www.ajaymatharu.com/impersonation-in-sharepoint-mosswss/#comments</comments> <pubDate>Wed, 10 Jun 2009 04:42:12 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Sharepoint]]></category> <category><![CDATA[C#.Net]]></category> <category><![CDATA[Impersonation]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[MOSS]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[vs.net]]></category> <category><![CDATA[WSS]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1349</guid> <description><![CDATA[Here is the little code that you can use to impersonate any user in sharepoint. This will code will pretend that you are logged in as the user who is impersonated and will be allowed access to all the features and inherits all the rights for that person. This is mainly used to do something [...]]]></description> <content:encoded><![CDATA[<p>Here is the little code that you can use to impersonate any user in sharepoint. This will code will pretend that you are logged in as the user who is impersonated and will be allowed access to all the features and inherits all the rights for that person. This is mainly used to do something for which the impersonating person has rights and you other user do not have rights.</p><pre name="code" class="c-sharp">
SPWeb web = SPContext.Current.Web.Site.OpenWeb();
SPUser user = web.AllUsers[username];
SPUserToken userToken = user.UserToken;
SPSite site = new SPSite(SPContext.Current.Web.Site.Url.ToString(), userToken);
web = site.OpenWeb();
</pre><p>Here username is the name username of the user who you want to impersonate as.</p><p>Hope this helps <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/impersonation-in-sharepoint-mosswss/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>JQuery in Visual Studio</title><link>http://www.ajaymatharu.com/jquery-in-visual-studio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jquery-in-visual-studio</link> <comments>http://www.ajaymatharu.com/jquery-in-visual-studio/#comments</comments> <pubDate>Sun, 17 May 2009 18:00:45 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[.Net]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Developer]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Dot Net]]></category> <category><![CDATA[Jquery]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=279</guid> <description><![CDATA[A big part of the appeal of jQuery is that it allows you to elegantly (and efficiently) find and manipulate HTML elements with minimum lines of code.  jQuery supports this via a nice &#8220;selector&#8221; API that allows developers to query for HTML elements, and then apply &#8220;commands&#8221; to them.  One of the characteristics of jQuery [...]]]></description> <content:encoded><![CDATA[<p>A big part of the appeal of jQuery is that it allows you to elegantly (and efficiently) find and manipulate HTML elements with minimum lines of code.  jQuery supports this via a nice &#8220;selector&#8221; API that allows developers to query for HTML elements, and then apply &#8220;commands&#8221; to them.  One of the characteristics of jQuery commands is that they can be &#8220;chained&#8221; together &#8211; so that the result of one command can feed into another.  jQuery also includes a built-in set of animation APIs that can be used as commands.  The combination allows you to do some really cool things with only a few keystrokes.</p><p>For example, the below JavaScript uses jQuery to find all &lt;div&gt; elements within a page that have a CSS class of &#8220;product&#8221;, and then animate them to slowly disappear:</p><pre class="javascript">$("div.product").slideUp('slow').addClass("removed");</pre><p>As another example, the JavaScript below uses jQuery to find a specific &lt;table&gt; on the page with an id of &#8220;datagrid1&#8243;, then retrieves every other &lt;tr&gt; row within the datagrid, and sets those &lt;tr&gt; elements to have a CSS class of &#8220;even&#8221; &#8211; which could be used to alternate the background color of each row:</p><pre class="javascript">$("#datagrid1 tr:nth-child(even)").addClass("even");</pre><p>The jQuery library also works well on the same page with ASP.NET AJAX and the ASP.NET AJAX Control Toolkit.</p><p>Visual Studio figures out external script references, such as to JQuery, by following special reference comments it finds at the top of .js files:</p><pre>/// &lt;reference path="jquery-1.2.3.js" /&gt;</pre><p>You can download the JQuery from <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.js&amp;downloadBtn=%3CSPAN%3EDownload%3C%2FSPAN%3E" target="_blank">here</a>. You can get more details on JQuery from <a href="http://jquery.com/api/">http://jquery.com/</a> .</p><p>For intellisense support for JQuery you need to install this <a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826" target="_blank">Hotfix</a>.</p><p>Comment for javascript is written inside for intellisense support. JavaScript has the interesting feature that calling toString on a function returns the code of this function including the comments and thus the doc comments. Here&#8217;s a similar example in JavaScript where the documentation is written inside of a class constructor:</p><p><a href="http://ajaymatharu.files.wordpress.com/2008/10/jsintellisense.png"><img class="aligncenter size-full wp-image-280" title="jsintellisense" src="http://ajaymatharu.files.wordpress.com/2008/10/jsintellisense.png" alt="" width="450" height="59" /></a></p><p>Another difference with C# or VB.NET is that property and event accessors are two different entities in JavaScript. For this reason, to choose where the documentation should be for those members. Properties should be documented in the getter and events in the &#8220;adder&#8221; for this reason:</p><p><a href="http://ajaymatharu.files.wordpress.com/2008/10/js.png"><img class="aligncenter size-full wp-image-281" title="js" src="http://ajaymatharu.files.wordpress.com/2008/10/js.png" alt="" width="450" height="133" /></a></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/jquery-in-visual-studio/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
