tag:blogger.com,1999:blog-30511386655571085612024-03-13T19:25:45.259+04:00SharePoint In-depthI'm trying to represent Moss 2007 development in a simple way to get robust portal.
Hope this will helpAhmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-3051138665557108561.post-48746008816290172012009-05-09T10:24:00.002+04:002009-05-09T10:57:09.468+04:00SPGridview Grouping. Is it easy to apply??Well, have you ever tried to create new sharepoint webpart with SPGrdiview and tried to enable grouping??<br /><br />For the first time you call your grid it will work fine, but if you tried to use it in searching page(like you have textbox and submit button to bind the data to your grid based on entered text), it will come up with annoyed ASP.NET yellow error page saying:<br /><br /><span style="color:#ff0000;"><span style="color:#000000;">"</span> System.ArgumentNullException: Value canot be null</span> "<br /><br />the problem happened while rendering the rows again after the postback.<br />To solve this problem follow the steps below:<br /><ol><li>Create new class @ your webpart project calling "SPGridViewGrouping".</li><li>Let this class inherits from "SPGridview", your class should look like this:<br /><span style="color:#3333ff;"><br />class SPGridViewGrouping : SPGridView<br />{<br />protected override void LoadControlState(object savedState)<br />{<br />base.LoadControlState(savedState);<br />if (this.DataSource == null)<br />{<br />this.InvokeRequiresDataSource();<br />}<br />}<br />public event EventHandler RequiresDataSource;<br />private void InvokeRequiresDataSource()<br />{<br />//throw new NotImplementedException();<br />EventHandler handler = this.RequiresDataSource;<br />if (handler != null)<br />{<br />handler(this, new EventArgs());<br />}<br />}<br />}</span></li><li>At your webpart class create your grid object from "SPGridViewGrouping" <span style="color:#ff0000;">NOT</span> "SPGridview".<br /><span style="color:#3333ff;">SPGridViewGrouping oGrid = new SPGridViewGrouping();</span></li><li>Add handler calling your menthod created @ SPGridViewGrouping<br /><span style="color:#3333ff;">oGrid.RequiresDataSource += new EventHandler(oGrid_RequiresDataSource);</span></li><li><span style="color:#000000;">At this handler will look like:<br /></span><span style="color:#3333ff;">void oGrid_RequiresDataSource(object sender, EventArgs e)<br />{<br />//throw new NotImplementedException();<br />oGrid.DataBind();<br />}</span></li><li><span style="color:#000000;">Enjoy your grouping.</span></li></ol>Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com12tag:blogger.com,1999:blog-3051138665557108561.post-4652492715708756612009-03-11T10:04:00.002+04:002009-03-11T10:23:35.475+04:00Truncate MS SQL transaction Log file for SharePoint 2007 DBOne of the most painful issues to the SharePoint administrator is truncating the transaction log file for sharepoint DB.<br />If you tried to do shrinking thru:<br /><p>1-RightClick on DB --> tasks -->Shrink -->Files</p><p><span style="color:#ff6666;"><span style="color:#3333ff;">Result:</span> </span><span style="color:#ff0000;">NO CHANGES</span></p><p>2- Using T-SQL command:<br />DBCC SHRINKFILE('WSS_Content_WebApp_log',50);</p><p><span style="color:#3333ff;">Result:</span> <span style="color:#ff0000;">Error Message: Cannot shrink log file 2 (WSS_Content_WebApp_log) because all logical log files are in use</span>.</p>Now the steps to avoid popular problems u faced doing this task.<br /><br />– Truncate the log by changing the database recovery model to SIMPLE<br /><span style="color:#3333ff;">ALTER DATABASE WSS_Content_WebApp </span><br /><span style="color:#3333ff;">SET RECOVERY SIMPLE;</span><br />GO<br />– Shrink the truncated log file to 5 MB<br /><span style="color:#3333ff;">DBCC SHRINKFILE (WSS_Content_WebApp _Log, 5);</span><br />GO<br />– Reset the database recovery model.<br /><span style="color:#3333ff;">ALTER DATABASE WSS_Content_WebApp</span><br /><span style="color:#3333ff;">SET RECOVERY FULL;</span><br />GO<br /><br /><strong><span style="color:#ff0000;">NOTE:</span></strong> <span style="color:#990000;">Don't leave ur db Recovery in SIMPLE mode...this will cause some problems when u try to delete site collection from sharepoint central admin.</span><br /><span style="color:#990000;"><strong>ALWAYS</strong> keep it in <strong>FULL mode</strong>.</span>Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com5tag:blogger.com,1999:blog-3051138665557108561.post-56282297244438470662009-01-21T11:39:00.004+04:002009-02-07T10:04:49.095+04:00SmartTool for SharePoint 2007Long time.....<br />well let's go to the point. at CodePlex site sps geeks have been published a collection of awsome tools for Moss 2007 development.<br />It is <a href="http://www.codeplex.com/smarttools">SmartTools</a>.<br />Actually i dowonloaded "<a href="http://www.codeplex.com/smarttools/Release/ProjectReleases.aspx?ReleaseId=22111">What's New</a>" webpart for "jantielens" with the source code.<br /><br />- While testing it, i found a problem :<br />"List of content types" didn't work correctly.<br /><br />To fix this problem.....@ the source code itself:<br /><br />1- Inside this method " private string GetQueryContentTypePart(string contentTypes, ContentTypesOptions option) "<br />2- Replace the "Switch" statment with code mentioned <a href="http://www.codeplex.com/smarttools/Wiki/View.aspx?title=What%27s%20New%20Configuration&referringTitle=What%27s%20New">here</a>.<br /><br /><br />I hope this will help.Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com0tag:blogger.com,1999:blog-3051138665557108561.post-8062987358243640682008-08-20T13:17:00.014+04:002009-01-21T11:36:39.602+04:00SharePoint Form Based Authentication (FBA) Using LDAPMembership Provider-In the previous post i blogged "<a href="http://mossindepth.blogspot.com/2008/08/sharepoint-form-based-authentication.html">SharePoint Form Based Authentication (FBA) Using SQLMembership Provider</a>". I hope you did it smoothly.
<br />- Here we have a different type of sharepoint security Form Based Authentication "FBA".
<br />- In this case you want to enable your colleagues at your company active directory to login to your sharepoint site using login form.
<br />
<br />be carful while editing(parameters will be mentioned below).
<br />
<br /><strong><u>1- Configure SharePoint site which Form authentication will be applied to:</u></strong>
<br /><ul><li>Navigate to web site folder for targete sharepoint site and open “Web.config”. </li></ul><p align="center">C:\Inetpub\wwwroot\wss\VirtualDirectories\1214 </p><ul><li>Add text below (membership provider definition) between <span style="color:#3366ff;"></<span style="color:#ff0000;">authentication</span>></span> and <span style="color:#3366ff;"><</span><span style="color:#993300;">identity</span> <span style="color:#ff0000;">impersonate</span>="true" <span style="color:#3366ff;">/>:
<br /></li><li><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Site%201214.txt">-</a> <<span style="color:#993300;">membership</span> <strong>defaultProvider="LDAPMem"</strong>>
<br /><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Site%201214.txt">-</a> <<span style="color:#993300;">providers</span>>
<br /><<span style="color:#993300;">add</span> <strong><span style="color:#ff0000;">name</span>="LDAPMem"</strong> <span style="color:#ff0000;">type</span>="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, <span style="color:#3366ff;">PublicKeyToken</span>=71e9bce111e9429c" </span><span style="color:#3366ff;"><span style="color:#ff0000;"><strong>server</strong></span>="<span style="color:#000099;"><strong>ADServerName</strong></span>" <span style="color:#ff0000;">port</span>="389" <span style="color:#ff0000;">useSSL</span>="false" <span style="color:#ff0000;">userDNAttribute</span>="distinguishedName" <span style="color:#ff0000;">userNameAttribute</span>="sAMAccountName" <span style="color:#ff0000;"><strong>userContainer</strong></span>="DC=<span style="color:#000099;"><strong>Test</strong></span>,DC=<strong><span style="color:#000099;">com</span></strong>,DC=<span style="color:#000099;"><strong>AE</strong></span>" <span style="color:#ff0000;">userObjectClass</span>="person" <span style="color:#ff0000;">userFilter</span>="((ObjectCategory=group)(ObjectClass=person))" <span style="color:#ff0000;">scope</span>="Subtree" <span style="color:#ff0000;">otherRequiredUserAttributes</span>="sn,givenname,cn" /> </<><span style="color:#990000;">providers</span>> </< style="color:#993300;"><span style="color:#990000;">membership</span></span>>
<br /><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Site%201214.txt">-</a> <<span style="color:#993300;">roleManager</span> <strong><span style="color:#ff0000;">defaultProvider</span>="LDAPROLE"</strong> <span style="color:#ff0000;">enabled</span>="true" <span style="color:#ff0000;">cacheRolesInCookie</span>="true" <span style="color:#ff0000;">cookieName</span>=".PeopleDCRole">
<br /><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Site%201214.txt">-</a> <<span style="color:#993300;">providers</span>>
<br /><<span style="color:#993300;">add</span> <strong><span style="color:#ff0000;">name</span>="LDAPROLE"</strong> <span style="color:#ff0000;">type</span>="Microsoft.Office.Server.Security.LdapRoleProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" <span style="color:#ff0000;"><strong>server</strong></span>="<strong><span style="color:#000099;">ADServerName</span></strong>" <span style="color:#ff0000;">port</span>="389" <span style="color:#ff0000;">useSSL</span>="false" <span style="color:#ff0000;"><strong>groupContainer</strong></span>="DC=<strong><span style="color:#000099;">Test</span></strong>,DC=<span style="color:#000099;"><strong>com</strong></span>,DC=<span style="color:#000099;"><strong>AE</strong></span>" <span style="color:#ff0000;">groupNameAttribute</span>="cn" <span style="color:#ff0000;">groupMemberAttribute</span>="member" <span style="color:#ff0000;">userNameAttribute</span>="sAMAccountName" <span style="color:#ff0000;">dnAttribute</span>="distinguishedName" <span style="color:#ff0000;">groupFilter</span>="(ObjectClass=group)" <span style="color:#ff0000;">scope</span>="Subtree" /></<span style="color:#990000;">Providers</span>> </< color="#993300"></PROVIDERS<></provider></< style="COLOR: #993300"><span style="color:#990000;">roleManager</span></span>> </li>
<br /><li><span style="color:#3366ff;"><strong><u><span style="color:#ff0000;">NOTE:</span></u></strong>
<br />
<br /><blockquote></blockquote><span style="color:#ff0000;">*</span>server="ADServerName":</span><span style="color:#000000;"> active directory server name
<br /></span><span style="color:#33ccff;"><span style="color:#3366ff;"><span style="color:#ff0000;">*</span>userContainer="DC=Test,DC=com,DC=AE</span></span><span style="color:#000000;">": your domain name (Test.com.AE)
<br />
<br /><blockquote></blockquote>- theses only 2 parameter you will change according to your environment settings.</span></li></ul><strong><u>2- Configure Central Administration Web.Config file:</u></strong>
<br />
<br /><ul><li>Add text below (membership provider definition) between <span style="color:#3366ff;"></<><span style="color:#990000;">authentication</span><span style="color:#3366ff;">></span> and <span style="color:#3366ff;"><</span><span style="color:#993300;">identity</span> <span style="color:#ff0000;">impersonate</span>="true"<span style="color:#3366ff;"> />: </span>
<br /></li><li><span style="color:#3366ff;"><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Central%20Admin.txt">-</a> <<span style="color:#990000;">membership</span>>
<br /><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Central%20Admin.txt">-</a> <<span style="color:#990000;">providers</span>>
<br /><<span style="color:#990000;">add</span> <strong><span style="color:#ff0000;">name</span>="LDAPMem"</strong> <span style="color:#ff0000;">type</span>="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" <strong><span style="color:#ff0000;">server</span>="<span style="color:#000099;">ADServerName</span>"</strong> <span style="color:#ff0000;">port</span>="389" <span style="color:#ff0000;">useSSL</span>="false" <span style="color:#ff0000;">userDNAttribute</span>="distinguishedName" <span style="color:#ff0000;">userNameAttribute</span>="sAMAccountName" <strong><span style="color:#ff0000;">userContainer</span>="DC=<span style="color:#000099;">Test</span>,DC=<span style="color:#000099;">com</span>,DC=<span style="color:#000099;">AE</span>"</strong> <span style="color:#ff0000;">userObjectClass</span>="person" <span style="color:#ff0000;">userFilter</span>="((ObjectCategory=group)(ObjectClass=person))" <span style="color:#ff0000;">scope</span>="Subtree" <span style="color:#ff0000;">otherRequiredUserAttributes</span>="sn,givenname,cn" /> </<span style="color:#990000;">Providers</span>></<span style="color:#990000;">membership</span>>
<br /></<span color="#990000"></PROVIDERS<>
<br /><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Central%20Admin.txt">-</a> <<span style="color:#990000;">roleManager</span> <strong><span style="color:#ff0000;">defaultProvider</span>="AspNetWindowsTokenRoleProvider"</strong> <span style="color:#ff0000;">enabled</span>="true" <span style="color:#ff0000;">cacheRolesInCookie</span>="true" <span style="color:#ff0000;">cookieName</span>=".PeopleDCRole">
<br /><a href="https://myuos.sharjah.ac.ae/English/itc/Shared%20Documents/Academic%20Computing%20Services/Web/Form%20Based%20Authentication%20(MOSS%202007)/Web.Config%20Files%20for%20FBA%20reading%20from%20LDAP/web.config-Central%20Admin.txt">-</a> <<span style="color:#990000;">providers</span>>
<br /><<span style="COLOR: #990000">add</span> <span style="color:#ff0000;">name</span>="LDAPROLE" <span style="color:#ff0000;">type</span>="Microsoft.Office.Server.Security.LdapRoleProvider, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" <strong><span style="color:#ff0000;">server</span>="<span style="color:#000099;">ADServerName</span>"</strong> port="389" <span style="color:#ff0000;">useSSL</span>="false" <strong><span style="color:#ff0000;">groupContainer</span>="DC=<span style="color:#000099;">Test</span>,DC=<span style="color:#000099;">com</span>,DC=<span style="color:#000099;">AE</span>"</strong> <span style="color:#ff0000;">groupNameAttribute</span>="cn" <span style="color:#ff0000;">groupMemberAttribute</span>="member" <span style="color:#ff0000;">userNameAttribute</span>="sAMAccountName" <span style="color:#ff0000;">dnAttribute</span>="distinguishedName" <span style="color:#ff0000;">groupFilter</span>="(ObjectClass=group)" <span style="color:#ff0000;">scope</span>="Subtree" /></<span style="COLOR: #990000">provider</span>></<span color="#990000">roleManager</span>>
<br />
<br /></li>
<br /><li><span style="color:#3366ff;"><strong><span style="color:#ff0000;">NOTE:</span></strong> </span><span style="color:#006600;">At “roleManager” the “defaultProvider” value is set to “AspNetWindwosTokenProvider”</span></li></ul>
<br /><span style="color:#000000;"><strong><u>3- Configure Authentication for our site to be form based:</u></strong></span>
<br />
<br /><ul>
<br /><li>Open “SharePoint 3.0 central administration” ->”Application Management”->“Authentication providers”.</li>
<br />
<br /><li>Select your website “sharepoint 1214”.</li></ul>
<br /><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKv9irAIZ_I/AAAAAAAAAJg/dKulx1jSH_o/s1600-h/1.JPG"><img id="BLOGGER_PHOTO_ID_5236557763848988658" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKv9irAIZ_I/AAAAAAAAAJg/dKulx1jSH_o/s400/1.JPG" border="0" /></a></p>
<br /><ul>
<br /><li>Be sure “Web Application” to be targeted site and note that “Membership Provider Name” is “windows”. Now Click “Default”.</li></ul>
<br />
<br />
<br />
<br /><p align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKv92nBnEkI/AAAAAAAAAJo/zfsWH6ItWfA/s1600-h/2.JPG"><img id="BLOGGER_PHOTO_ID_5236558106378834498" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKv92nBnEkI/AAAAAAAAAJo/zfsWH6ItWfA/s400/2.JPG" border="0" /></a></p>
<br /><ul>
<br /><li>Select “Forms” as “Authentication type”.
<br />o <span style="color:#ff0000;">Membership provider name:</span> <span style="color:#3333ff;">LDAPMem</span>
<br />o <span style="color:#ff0000;">Role manager name:</span> <span style="color:#3333ff;">LDAPROLE</span></li></ul>
<br />
<br />
<br />
<br /><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKv-ST69eyI/AAAAAAAAAJw/vI7YY9jiOGg/s1600-h/3.JPG"><img id="BLOGGER_PHOTO_ID_5236558582287006498" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKv-ST69eyI/AAAAAAAAAJw/vI7YY9jiOGg/s400/3.JPG" border="0" /></a> </p>
<br /><ul>
<br /><li>Open “SharePoint 3.0 central administration” ->”Application Management”->“Site collection Administrators”.
<br />
<br />
<br /><blockquote></blockquote>
<br />
<br /><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKv-tL74E1I/AAAAAAAAAJ4/FuVRJcYjfpY/s1600-h/4.JPG"><img id="BLOGGER_PHOTO_ID_5236559043999830866" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKv-tL74E1I/AAAAAAAAAJ4/FuVRJcYjfpY/s400/4.JPG" border="0" /></a></p></li>
<br /><li>Be sure the selected site collection is your target site.</li>
<br />
<br /><li>At “Primary site collection administrator” type: Ahmed.</li>
<br />
<br /><li>“Ahmed” is my ID at my Active Directory.</li>
<br />
<br /><li>Now we grant our users located at active directory (MossFBA) to access to our site.</li></ul>
<br /><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKv_NS51q8I/AAAAAAAAAKA/Q8DI7_FRIz0/s1600-h/5.JPG"><img id="BLOGGER_PHOTO_ID_5236559595626146754" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKv_NS51q8I/AAAAAAAAAKA/Q8DI7_FRIz0/s400/5.JPG" border="0" /></a></p>
<br /><ul>
<br /><li>Open your browser and navigate to targeted site you will automatically redirected to login page ask for username and password.</li></ul><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKwA5FeR5nI/AAAAAAAAAKI/QP2gKwHqOGY/s1600-h/6.JPG"><img id="BLOGGER_PHOTO_ID_5236561447446767218" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKwA5FeR5nI/AAAAAAAAAKI/QP2gKwHqOGY/s400/6.JPG" border="0" /></a></p>
<br />
<br /></span></span>
<br />Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com1tag:blogger.com,1999:blog-3051138665557108561.post-22286650056566789632008-08-14T15:50:00.020+04:002008-08-20T22:07:57.560+04:00SharePoint Form Based Authentication (FBA) Using SQLMembership Provider- Here we have a very common sharepoint security issue is facing any Moss specialist, it is <strong>Form Based Authentication</strong> "<span class="blsp-spelling-error" id="SPELLING_ERROR_0">FBA</span>".
<br />- It is very powerful feature to your company.
<br />- In case you want your customer's company access your portal keeping them away of your active directory you should do what I'll mention below.
<br />- Before I start I'm very grateful to <a href="http://www.andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx">Andrew <span class="blsp-spelling-error" id="SPELLING_ERROR_1">Connel</span></a> for great post which helps me a lot.
<br />- What I write below is for simplicity, If you wanna more, please explore Andrew blog.
<br />
<br />Listen carefully(I mean read carefully) any step is effective, don't miss any.
<br />
<br /><ol><li><strong><u>Create Database to store external users accounts:</u></strong></li></ol><ul><li>Create <span class="blsp-spelling-error" id="SPELLING_ERROR_2">SQL</span> Server membership database to store external users (non Active Directory users) using VS tool called “<span class="blsp-spelling-error" id="SPELLING_ERROR_3">aspnet</span>_<span class="blsp-spelling-error" id="SPELLING_ERROR_4">regsql</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_5">exe</span>” located at:
<br />
<br /><blockquote></blockquote>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
<br /></li><li>It will launch wizard as below: </li></ul><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXNxZptUaI/AAAAAAAAAGg/RIlyA2F1IEw/s1600-h/1.JPG"><img id="BLOGGER_PHOTO_ID_5234816390471176610" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXNxZptUaI/AAAAAAAAAGg/RIlyA2F1IEw/s400/1.JPG" border="0" /></a></p><ul><li>Select “Configure <span class="blsp-spelling-error" id="SPELLING_ERROR_6">SQL</span> Server for application services” then click “NEXT”. </li></ul><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXNxlSc8PI/AAAAAAAAAGo/CdGf40euRO0/s1600-h/2.JPG"><img id="BLOGGER_PHOTO_ID_5234816393594859762" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXNxlSc8PI/AAAAAAAAAGo/CdGf40euRO0/s400/2.JPG" border="0" /></a>
<br />
<br /></p><ul><li>Enter your database Server name and Database name you will use for authentication then click “NEXT”. </li></ul><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKXNxkcqTRI/AAAAAAAAAGw/hVdHlk8vO_k/s1600-h/3.JPG"><img id="BLOGGER_PHOTO_ID_5234816393369242898" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKXNxkcqTRI/AAAAAAAAAGw/hVdHlk8vO_k/s400/3.JPG" border="0" /></a>
<br /></p><ul><li>Accept the Settings Summary page and click “NEXT”. </li></ul><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXNxwkzIhI/AAAAAAAAAG4/DPK_8-voZKc/s1600-h/4.JPG"><img id="BLOGGER_PHOTO_ID_5234816396624601618" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXNxwkzIhI/AAAAAAAAAG4/DPK_8-voZKc/s400/4.JPG" border="0" /></a>
<br /></p><ul><li>Last screen inform that the database has been created then click FINISH.
<br /></li></ul><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXNyGm5M3I/AAAAAAAAAHA/jEj5EpUT0x8/s1600-h/5.JPG"><img id="BLOGGER_PHOTO_ID_5234816402538967922" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXNyGm5M3I/AAAAAAAAAHA/jEj5EpUT0x8/s400/5.JPG" border="0" /></a></p><p><u><strong>2. Create connection to <span class="blsp-spelling-error" id="SPELLING_ERROR_7">SQL</span> membership and add new users:</strong></u> </p><ul><li>Here we want to add new users at “<span class="blsp-spelling-error" id="SPELLING_ERROR_8">MossFBA</span>” database to grant access to our <span class="blsp-spelling-error" id="SPELLING_ERROR_9">sharepoint</span> website. </li>
<br /><li>Open VS.NET (C# 2008 used here) and create new website (host it anywhere). </li>
<br /><li>At “web.<span class="blsp-spelling-error" id="SPELLING_ERROR_10">config</span>” replace <connectionstrings>with text below <strong><<span style="color:#3366ff;">connection string </span>/></strong> to <span class="blsp-spelling-error" id="SPELLING_ERROR_11">SqlMemebership</span> database between <strong><<span style="color:#3333ff;">appSettings </span>/></strong> <appsettings>and <strong><<span style="color:#3366ff;">system.web</span>></strong> <system.web>tags : </li></ul><p><<span style="color:#993300;">connectionStrings</span>>
<br /><<span style="color:#993300;">add</span> <strong><span style="color:#ff6600;">name</span>="<span style="color:#009900;">FBA_SqlConnectionString</span>"</strong> <span style="color:#ff6600;">connectionString</span>="<span style="color:#3333ff;">server= m11-214-04;database=MossFBA;Integrated Security=SSPI;</span>" <span style="color:#ff6600;">providerName</span>="<span style="color:#3333ff;">System.Data.SqlClient</span>"/>
<br /></ style="COLOR: #993300" <span>connectionStrings</span>></p>
<br />
<br /><p><add providername="System.Data.SqlClient" connectionstring="server= m11-214-04;database=MossFBA;Integrated Security=SSPI;" name="FBA_SqlConnectionString"><strong><span style="color:#3333ff;">m11-214-04</span></strong>: Is your database server name.
<br /><span style="color:#3333ff;">MossFBA</span>: Database name for Sqlmembership.
<br /></p><ul><li>We still at “<strong>web.config</strong>” of website, add text below (membership provider definition) between <span style="color:#3333ff;"></<><span color="#993300">compilation</span><span style="color:#3333ff;">></span> </compilation>and <span style="color:#3333ff;"><</span><span style="COLOR: #993300">authentication</span> <span style="color:#ff6600;">mode</span>="<span style="color:#3333ff;">Windows</span>" <span style="color:#3333ff;">/></span> <authentication mode="Windows">:
<br /><membership defaultprovider="FBA_AspNetSqlMembershipProvider">
<br /><providers><<span style="color:#993300;">membership</span> <span style="color:#ff6600;">defaultProvider</span>="FBA_AspNetSqlMembershipProvider">
<br /><<span style="color:#993300;">providers</span>>
<br /><<span style="color:#993300;">add</span> <span style="color:#ff6600;">connectionStringName</span>="FBA_SqlConnectionString" <span style="color:#ff6600;">passwordAttemptWindow</span>="10"
<br /><span style="color:#ff6600;">enablePasswordRetrieval</span>="false"
<br /><span style="color:#ff6600;">enablePasswordReset</span>="true" requiresQuestionAndAnswer="false"
<br /><span style="color:#ff6600;">applicationName</span>="/"
<br /><span style="color:#ff6600;">minRequiredPasswordLength</span>="1" <span style="color:#ff6600;">maxInvalidPasswordAttempts</span>="5"
<br /><span style="color:#ff6600;">minRequiredNonalphanumericCharacters</span>="0" <span style="color:#ff6600;">requiresUniqueEmail</span>="false"
<br /><span style="color:#ff6600;">passwordFormat</span>="Hashed"
<br /><span style="color:#ff6600;">description</span>="Stores and retrieves membership data from the Microsoft SQL Server database"
<br /><span style="color:#ff6600;">name</span>="FBA_AspNetSqlMembershipProvider" <span style="color:#ff6600;">type</span>="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<br /></<span style="color:#cc6600;">providers</span>>
<br /></<span style="color:#cc6600;">membership</span>>
<br />
<br /><!-- Role Provider-->
<br /><<span style="color:#cc6600;">roleManager</span> <span style="color:#ff6600;">enabled</span>="true"
<br /><span style="color:#ff6600;">defaultProvider</span>="FBA_AspNetSqlRoleProvider" >
<br /><<span style="color:#cc6600;">providers</span>>
<br /><<span style="color:#cc6600;">add</span> <span style="color:#ff6600;">name</span>="FBA_AspNetSqlRoleProvider"
<br /><span style="color:#ff6600;">type</span>="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
<br /><span style="color:#ff6600;">connectionStringName</span>="FBA_SqlConnectionString"
<br /><span style="color:#ff6600;">applicationName</span>="/"
<br />/>
<br /></<span style="color:#cc6600;">providers</span>>
<br /></<span style="color:#cc6600;">roleManager</span>></providers>
<br /></li><li><span style="color:#ff6600;"><span style="color:#333399;"><u>NOTE:</u></span> Connection string name should be the same as defined in first block “Connection string definition” (here <span class="blsp-spelling-error" id="SPELLING_ERROR_12">FBA</span>_<span class="blsp-spelling-error" id="SPELLING_ERROR_13">SqlConnectionString</span>).</span>
<br /></li><li>At VS.NET <span class="blsp-spelling-error" id="SPELLING_ERROR_14">IDE</span> (Integrated Development Environment) from “<strong><span class="blsp-spelling-error" id="SPELLING_ERROR_15">WebSite</span></strong>” menu select “<strong>ASP.NET Configuration</strong>” for adding new users and roles.
<br />
<br /><div align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXRQpv97VI/AAAAAAAAAHI/fZU4_xu0xLA/s1600-h/6.JPG"><img id="BLOGGER_PHOTO_ID_5234820225903226194" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXRQpv97VI/AAAAAAAAAHI/fZU4_xu0xLA/s400/6.JPG" border="0" /></a>
<br /></div></li><li>New window will open.
<br />
<br /><div align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXRQoGJgII/AAAAAAAAAHQ/fVZsJ9ax4fk/s1600-h/7.JPG"><img id="BLOGGER_PHOTO_ID_5234820225459388546" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXRQoGJgII/AAAAAAAAAHQ/fVZsJ9ax4fk/s400/7.JPG" border="0" /></a>
<br /></div></li><li>Select “<strong>Security</strong>” then “<strong>Select authentication type</strong>”.
<br />
<br /><div align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXRQ3J-NFI/AAAAAAAAAHY/sM7chzDHCpU/s1600-h/8.JPG"><img id="BLOGGER_PHOTO_ID_5234820229501957202" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXRQ3J-NFI/AAAAAAAAAHY/sM7chzDHCpU/s400/8.JPG" border="0" /></a>
<br /></div></li><li>Select “<strong>From The Internet</strong>” to enable Form authentication (default is windows) then “<strong>DONE</strong>”.
<br /><div align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXRRBlx5vI/AAAAAAAAAHg/QDYR_Mvy2a4/s1600-h/9.JPG"><img id="BLOGGER_PHOTO_ID_5234820232302946034" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXRRBlx5vI/AAAAAAAAAHg/QDYR_Mvy2a4/s400/9.JPG" border="0" /></a></div></li>
<br /><li>Select “<strong>Select a different provider for each feature (advanced)</strong>” to ensure that our Membership and Role providers are tested and selected.
<br />
<br /><div align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXRRFxC4tI/AAAAAAAAAHo/qY1PidolO0A/s1600-h/10.JPG"><img id="BLOGGER_PHOTO_ID_5234820233423938258" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SKXRRFxC4tI/AAAAAAAAAHo/qY1PidolO0A/s400/10.JPG" border="0" /></a></div></li>
<br /><li>Select “<strong><span class="blsp-spelling-error" id="SPELLING_ERROR_16">FBA</span>_<span class="blsp-spelling-error" id="SPELLING_ERROR_17">AspNetSqlMembershipProvider</span></strong>” then click “<strong>Test</strong>”.then select “<strong><span class="blsp-spelling-error" id="SPELLING_ERROR_18">FBA</span>_<span class="blsp-spelling-error" id="SPELLING_ERROR_19">AspNetSqlRoleProvider</span></strong>” then click “<strong>Test</strong>”.
<br />
<br /><div align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBCHBfWI/AAAAAAAAAHw/ebiGmQkOvw8/s1600-h/11.JPG"><img id="BLOGGER_PHOTO_ID_5234825455122611554" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBCHBfWI/AAAAAAAAAHw/ebiGmQkOvw8/s400/11.JPG" border="0" /></a>
<br /></div></li><li>Move to “<strong>Security</strong>” tab again and click “<strong>Add user</strong>”- test-, fill in the form and click “<strong>Create user</strong>”.
<br /><div align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBUk0liI/AAAAAAAAAH4/Wpe2SA6xnkY/s1600-h/12.JPG"><img id="BLOGGER_PHOTO_ID_5234825460079433250" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBUk0liI/AAAAAAAAAH4/Wpe2SA6xnkY/s400/12.JPG" border="0" /></a>
<br /></div></li><li>New we have Database “<strong><span class="blsp-spelling-error" id="SPELLING_ERROR_20">MossFBA</span></strong>” with connection string “<strong><span class="blsp-spelling-error" id="SPELLING_ERROR_21">FBA</span>_<span class="blsp-spelling-error" id="SPELLING_ERROR_22">SqlConnectionString</span></strong>” and user created “<strong>test</strong>” as external user to <span class="blsp-spelling-error" id="SPELLING_ERROR_23">login</span> to our <span class="blsp-spelling-error" id="SPELLING_ERROR_24">sharepoint</span> site. </li></ul><p>
<br /><u><strong>3- Configure <span class="blsp-spelling-error" id="SPELLING_ERROR_25">SharePoint</span> site which Form authentication will be applied to: </strong></u><u><strong>
<br />
<br /></p></strong></u><u><strong><ul><li></strong></u></li></ul>Navigate to web site folder for targeted <span class="blsp-spelling-error" id="SPELLING_ERROR_26">sharepoint</span> site and open “<strong>Web.<span class="blsp-spelling-error" id="SPELLING_ERROR_27">config</span></strong>”.
<br />
<br /><p align="center">C:\<span class="blsp-spelling-error" id="SPELLING_ERROR_28">Inetpub</span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_29">wwwroot</span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_30">wss</span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_31">VirtualDirectories</span>\1212
<br /></p><li><p align="left">At “<strong>web.<span class="blsp-spelling-error" id="SPELLING_ERROR_32">config</span></strong>” add text below(connection string) to <span class="blsp-spelling-error" id="SPELLING_ERROR_33">SqlMemebership</span> database between <appsettings><<span style="color:#cc6600;">appSettings</span>/> and <<span style="color:#cc6600;">system.web</span>> <system.web>tags : </p><p align="left"><<span style="color:#cc6600;">connectionStrings</span>>
<br /><<span style="color:#cc0000;">add</span> <span style="color:#ff6600;">name</span>="<span style="color:#3333ff;">FBA_SqlConnectionString</span>" <span style="color:#ff6600;">connectionString</span>="<span style="color:#3333ff;">server= m11-214-04;database=MossFBA;Integrated Security=SSPI;</span>" <span style="color:#ff6600;">providerName</span>="<span style="color:#3333ff;">System.Data.SqlClient</span>"/>
<br /></<span style="color:#cc6600;">connectionStrings</span>></p><p align="left"><span style="color:#3333ff;">m11-214-04:</span> Is your database server name.
<br /><span style="color:#3333ff;">MossFBA:</span> Database name for Sqlmembership.</p></li><li><p align="left">Add text below (membership provider definition) between </<span style="color:#3333ff;">authentication</span>> </authentication>and <<span style="color:#cc6600;">identity</span> <span style="color:#3333ff;">impersonate</span>="<span style="color:#ff6600;">true</span>" /><identity impersonate="true">: </p><p align="left"><<span style="color:#cc6600;">membership</span> <span style="color:#ff6600;">defaultProvider</span>="FBA_AspNetSqlMembershipProvider">
<br /><<span style="color:#cc6600;">providers</span>>
<br /><<span style="color:#cc6600;">add</span> <span style="color:#ff6600;">connectionStringName</span>="FBA_SqlConnectionString" <span style="color:#ff6600;">passwordAttemptWindow</span>="10"
<br /><span style="color:#ff6600;">enablePasswordRetrieval</span>="false"
<br /><span style="color:#ff6600;">enablePasswordReset</span>="true" <span style="color:#ff6600;">requiresQuestionAndAnswer</span>="false"
<br /><span style="color:#ff6600;">applicationName</span>="/"
<br /><span style="color:#ff6600;">minRequiredPasswordLength</span>="1" <span style="color:#ff6600;">maxInvalidPasswordAttempts</span>="5"
<br /><span style="color:#ff6600;">minRequiredNonalphanumericCharacters</span>="0" <span style="color:#ff6600;">requiresUniqueEmail</span>="false"
<br /><span style="color:#ff6600;">passwordFormat</span>="Hashed"
<br /><span style="color:#ff6600;">description</span>="Stores and retrieves membership data from the Microsoft SQL Server database"
<br /><span style="color:#ff6600;">name</span>="FBA_AspNetSqlMembershipProvider" <span style="color:#ff6600;">type</span>="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<br /></<span style="color:#cc6600;">providers</span>>
<br /></<span style="color:#cc6600;">membership</span>>
<br />
<br /><!-- Role Provider-->
<br /><<span style="color:#cc6600;">roleManager</span> <span style="color:#ff6600;">enabled</span>="true"
<br /><span style="color:#ff6600;">defaultProvider</span>="FBA_AspNetSqlRoleProvider" >
<br /><<span style="color:#cc6600;">providers</span>>
<br /><<span style="color:#cc6600;">add</span> <span style="color:#ff6600;">name</span>="FBA_AspNetSqlRoleProvider"
<br /><span style="color:#ff6600;">type</span>="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
<br /><span style="color:#ff6600;">connectionStringName</span>="FBA_SqlConnectionString"
<br /><span style="color:#ff6600;">applicationName</span>="/"
<br />/>
<br /></<span style="color:#cc6600;">providers</span>></<span style="color:#cc0000;">roleManager</span>></providers>
<br /></providers>
<br /></rolemanager>
<br /><u><strong>4- Configure Central Administration Web.<span class="blsp-spelling-error" id="SPELLING_ERROR_34">Config</span> file: </strong></u>
<br /></p></li><li><u><strong><p align="left"></strong></u>At “<strong>web.<span class="blsp-spelling-error" id="SPELLING_ERROR_35">config</span></strong>” add text below(connection string) to <span class="blsp-spelling-error" id="SPELLING_ERROR_36">SqlMemebership</span> database between <appsettings><<span style="color:#3333ff;">appSettings</span>/> and <<span style="color:#3333ff;">system.web</span>> tags :</p><p align="left"><connectionstrings><<span style="color:#cc6600;">connectionStrings</span>>
<br /><<span style="color:#cc6600;">add</span> <span style="color:#ff6600;">name</span>="<span style="color:#3333ff;">FBA_SqlConnectionString</span>" <span style="color:#ff6600;">connectionString</span>="<span style="color:#3333ff;">server= m11-214-04;database=MossFBA;Integrated Security=SSPI;</span>" <span style="color:#ff6600;">providerName</span>="<span style="color:#3333ff;">System.Data.SqlClient</span>"/></<span style="color:#cc6600;">connectionStrings</span>>
<br /><add providername="System.Data.SqlClient" connectionstring="server= m11-214-04;database=MossFBA;Integrated Security=SSPI;" name="FBA_SqlConnectionString"></connectionstrings>
<br /><span style="color:#3333ff;">m11-214-04:</span> Is your database server name.
<br /><span style="color:#3333ff;">MossFBA:</span> Database name for Sqlmembership. </p></li><li><p align="left">Add text below (membership provider definition) between </<span style="color:#cc6600;">authentication</span>> and <<span style="color:#cc6600;">identity</span> <span style="color:#ff6600;">impersonate</span>="<span style="color:#3333ff;">true</span>" />: </p>
<br /><blockquote></blockquote><p align="left"><<span style="color:#cc6600;">membership</span> <span style="color:#ff6600;">defaultProvider</span>="FBA_AspNetSqlMembershipProvider">
<br /><<span style="color:#cc6600;">providers</span>>
<br /><<span style="color:#cc0000;">add</span> <span style="color:#ff6600;">connectionStringName</span>="FBA_SqlConnectionString" <span style="color:#ff6600;">passwordAttemptWindow</span>="10"
<br /><span style="color:#ff6600;">enablePasswordRetrieval</span>="false"
<br /><span style="color:#ff6600;">enablePasswordReset</span>="true" <span style="color:#ff6600;">requiresQuestionAndAnswer</span>="false"
<br /><span style="color:#ff6600;">applicationName</span>="/"
<br /><span style="color:#ff6600;">minRequiredPasswordLength</span>="1" <span style="color:#ff6600;">maxInvalidPasswordAttempts</span>="5"
<br /><span style="color:#ff6600;">minRequiredNonalphanumericCharacters</span>="0" <span style="color:#ff6600;">requiresUniqueEmail</span>="false"
<br /><span style="color:#ff6600;">passwordFormat</span>="Hashed"
<br /><span style="color:#ff6600;">description</span>="Stores and retrieves membership data from the Microsoft SQL Server database"
<br /><span style="color:#ff6600;">name</span>="FBA_AspNetSqlMembershipProvider" <span style="color:#ff6600;">type</span>="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<br /></<span style="color:#cc6600;">providers</span>>
<br /></<span style="color:#cc6600;">membership</span>>
<br />
<br /><!-- Role Provider-->
<br /><<span style="color:#cc6600;">roleManager</span> <span style="color:#ff6600;">enabled</span>="true"
<br /><span style="color:#ff6600;">defaultProvider</span>="<strong><span style="color:#cc66cc;">AspNetWindowsTokenRoleProvider</span></strong>" >
<br /><<span style="color:#cc6600;">providers</span>>
<br /><<span style="color:#cc6600;">add</span> <span style="color:#ff6600;">name</span>="FBA_AspNetSqlRoleProvider"
<br /><span style="color:#ff6600;">type</span>="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
<br /><span style="color:#ff6600;">connectionStringName</span>="FBA_SqlConnectionString"
<br /><span style="color:#ff6600;">applicationName</span>="/"
<br />/>
<br /></<span style="color:#cc6600;">providers</span>></<span style="color:#cc6600;">roleManager</span>>
<br /><membership defaultprovider="FBA_AspNetSqlMembershipProvider">
<br /></providers></membership><!-- Role Provider--><rolemanager defaultprovider="AspNetWindowsTokenRoleProvider" enabled="true"><providers><add name="FBA_AspNetSqlRoleProvider" applicationname="/" connectionstringname="FBA_SqlConnectionString" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"></providers><strong><u><span style="color:#ff6600;">NOTE:</span></u></strong><span style="color:#33cc00;">At “<strong>roleManager</strong>” the “<strong>defaultProvider</strong>” value is set to “<strong>AspNetWindwosTokenProvider</strong>”</span> </p><blockquote></blockquote><p align="left">
<br /><u><strong>5- Configure Authentication for our site to be form based: </strong></u>
<br /></p></li><li><u><strong><p align="left"></strong></u>Open IIS which host “Moss2007” then check for user account which has access to your site.from “<strong>Application Pools</strong>”->“<strong>SharePoint 1212</strong>” -> RightClick -> <strong>Properties</strong>-><strong>Identity</strong>. </p><p align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXWBdhSqUI/AAAAAAAAAIA/jpFO5lmWQKE/s1600-h/13.JPG"><img id="BLOGGER_PHOTO_ID_5234825462480546114" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXWBdhSqUI/AAAAAAAAAIA/jpFO5lmWQKE/s400/13.JPG" border="0" /></a> </p></li><li><p align="left">Now you have got the “<strong>User Name</strong>” then go to you your database server “<strong>host MossFBA database</strong>”. </p></li><li><p align="left">Open “<strong>MossFBA</strong>” database -> expand “<strong>Security</strong>”->expand “<strong>Users</strong>”--rightClick--> “<strong>New User</strong>”.
<br />o At “<strong>UserName</strong>” type “<strong>FBAUser</strong>” it is alias name.
<br />o At “<strong>Login</strong> <strong>name</strong>” type user name you picked from previous step (previous image).
<br />o Here we grant access for Sql database contains our user’s name we created in step no.2.
<br />o Check “<strong>db_owner</strong>” as database role membership (you should select appropriate permission for your users, I did this for demo only). </p></li><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBlLTBNI/AAAAAAAAAII/97rZp2QogFI/s1600-h/14.JPG"><img id="BLOGGER_PHOTO_ID_5234825464535778514" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBlLTBNI/AAAAAAAAAII/97rZp2QogFI/s400/14.JPG" border="0" /></a>
<br /></p><ul><li><p align="left">Open “<strong>SharePoint 3.0 central administration</strong>” -> ”<strong>Application Management</strong>”-> “<strong>Authentication providers</strong>”. </p></li><li><p align="left">Select your website “<strong>sharepoint 1212</strong>”. </p><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBuAzKQI/AAAAAAAAAIQ/T8vlZAp8vkc/s1600-h/15.JPG"><img id="BLOGGER_PHOTO_ID_5234825466907666690" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXWBuAzKQI/AAAAAAAAAIQ/T8vlZAp8vkc/s400/15.JPG" border="0" /></a></p></li><li><p align="left">Be sure “<strong>Web Application</strong>” is your targeted site and note that “<strong>Membership Provider Name</strong>” is “<strong>windows</strong>”. Now Click “<strong>Default</strong>”. </p><div align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXgBqGDCLI/AAAAAAAAAIY/tX8fvA1dvwM/s1600-h/16.JPG"><img id="BLOGGER_PHOTO_ID_5234836460972214450" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXgBqGDCLI/AAAAAAAAAIY/tX8fvA1dvwM/s400/16.JPG" border="0" /></a>
<br /></div></li><li><p align="left">Select “<strong>Forms</strong>” as “<strong>Authentication type</strong>”.
<br />o <strong><span style="color:#ff6600;">Membership provider name:</span></strong> <span style="color:#3333ff;">FBA_AspNetSqlMembershipProvider</span>
<br />o <strong><span style="color:#ff6600;">Role manager name:</span></strong> <span style="color:#3333ff;">FBA_AspNetSqlRoleProvider</span>
<br /></p><p align="center"><img id="BLOGGER_PHOTO_ID_5234836459984449890" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKXgBmai8WI/AAAAAAAAAIg/BTmA8n4NtGk/s400/17.JPG" border="0" />
<br /></p></li><li><p align="left">Open “<strong>SharePoint 3.0 central administration</strong>” -> ”<strong>Application Management</strong>” -> “<strong>Site collection Administrators</strong>”.</p><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXgB_VWXQI/AAAAAAAAAIo/di-CF4X7zZE/s1600-h/18.JPG"><img id="BLOGGER_PHOTO_ID_5234836466673540354" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXgB_VWXQI/AAAAAAAAAIo/di-CF4X7zZE/s400/18.JPG" border="0" /></a>
<br /></p></li><li><p align="left">Be sure the selected site collection is your targeted site.
<br />o At “<strong>Primary site collection administrator</strong>” type: <strong>test</strong>.
<br />“test” is the username we created in “MossFBA”. </p></li><li><p align="left">Now we grant our users from SQL Server membership database (MossFBA) access to our site and our site is <strong>not accessible</strong> for local windows accounts or active directory users. </p></li></ul><p align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXgB-Fcq-I/AAAAAAAAAIw/3ffA8zjN82E/s1600-h/19.JPG"><img id="BLOGGER_PHOTO_ID_5234836466338409442" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKXgB-Fcq-I/AAAAAAAAAIw/3ffA8zjN82E/s400/19.JPG" border="0" /></a></p><ul><li><p align="left">Open your browser and navigate to targeted site you will automatically redirected to login page ask for username and password.</p><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKXgCKjEbEI/AAAAAAAAAI4/dx4N3x0G9t8/s1600-h/20.JPG"><img id="BLOGGER_PHOTO_ID_5234836469683874882" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SKXgCKjEbEI/AAAAAAAAAI4/dx4N3x0G9t8/s400/20.JPG" border="0" /></a></p></li><li><p align="left">Congratulations….you logged in…welcome home.</p><blockquote></blockquote><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXismEDhgI/AAAAAAAAAJA/cM2sNvLf0j4/s1600-h/21.JPG"><img id="BLOGGER_PHOTO_ID_5234839397647746562" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKXismEDhgI/AAAAAAAAAJA/cM2sNvLf0j4/s400/21.JPG" border="0" /></a></p></li></ul>
<br />Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com2tag:blogger.com,1999:blog-3051138665557108561.post-15621206874714632882008-08-11T08:29:00.011+04:002008-08-11T18:43:47.293+04:00Debugging SharePoint Web Part-IIn my earlier post I touched how to develop SharePoint web part using VS.NET. Now we'll walk through debugging our web part, can you imagine? you are developing .NET project so all facilities you used to be found in programming websites are available in sharepoint webpart development.<br /><br /><p>There are 2 cases right here:</p><ol><li>Debugging Web Part has been developed on your sharepoint site server.</li><br /><li>Debugging <strong>Remotely</strong> Web Part has been developed on your local machine. </li></ol><strong>*<u>First :Debugging Web Part has been developed on your sharepoint site server:</u></strong><br /><ol><li>To be able to debug your code(web part) you need to verify that your webpart DLL located at website BIN directory(in our case"C:\Inetpub\wwwroot\wss\VirtualDirectories\1234\Bin"). </li><li><blockquote></blockquote>Verify your assebly is registered as safe control at <strong>web.config</strong> file - If you want to deploy your webpart to "<a href="http://sp:1234/">http://sp:1234/</a>" you should modify <strong>web.config</strong> file of this site "C:\Inetpub\wwwroot\wss\VirtualDirectories\1234\web.config"- to know how to do this kindly <a href="http://mossindepth.blogspot.com/2008/08/moss-2007-custom-webparts-part-ii.html">open up this link.</a> </li><br /><li>Open up your Webpart project in VS.NET.<br /></li><li>Set breakPoint wherever you want in your code.<br /><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKBJ_T8FQqI/AAAAAAAAADw/ywfjj3cxEkQ/s1600-h/1.JPG"><img id="BLOGGER_PHOTO_ID_5233264119037379234" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SKBJ_T8FQqI/AAAAAAAAADw/ywfjj3cxEkQ/s400/1.JPG" border="0" /></a></p></li><li>Select from <strong>Debug</strong> menu --> <strong>Attache to Process.</strong><br /><blockquote><img id="BLOGGER_PHOTO_ID_5233265884569275730" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKBLmFDsDVI/AAAAAAAAAEQ/oJRgW8AA_WU/s400/2.JPG" border="0" /></blockquote></li><li>Pop up box will appear listing all current running processes, select Process "<strong>w3wp.exe</strong>". may be you will see more than one from this process, select the one running with your username appear in <strong>User Name</strong> column.<br /><blockquote><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKBLSkp2D-I/AAAAAAAAAEI/kY7BvhGkoKU/s1600-h/3.JPG"><img id="BLOGGER_PHOTO_ID_5233265549453430754" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SKBLSkp2D-I/AAAAAAAAAEI/kY7BvhGkoKU/s400/3.JPG" border="0" /></a></blockquote></li><li>Now you are ready to debug your application.</li><li>Get back to your page you deploy this webpart.</li><li>As soon as you open the page contains the wepart, your cursor automatically goes to VS.NET project (webpart project) and will stop at your code line you set break point at.</li><li>Effortless and useful.</li></ol><p>wait for second case...it will be soon.</p>Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com0tag:blogger.com,1999:blog-3051138665557108561.post-3029962468132586002008-08-10T08:14:00.005+04:002008-08-10T10:02:53.717+04:00Breaking News - Microsoft Hands On Lab for WWS 3.0Guys..<br />Breaking <span class="blsp-spelling-error" id="SPELLING_ERROR_0"><span class="blsp-spelling-error" id="SPELLING_ERROR_0"><span class="blsp-spelling-error" id="SPELLING_ERROR_0">NEWs</span></span></span>....<br />while exploring the <span class="blsp-spelling-corrected" id="SPELLING_ERROR_1">Internet</span> I found this great <span class="blsp-spelling-error" id="SPELLING_ERROR_2"><span class="blsp-spelling-error" id="SPELLING_ERROR_1"><span class="blsp-spelling-error" id="SPELLING_ERROR_1">HOLs</span></span></span> for <span class="blsp-spelling-error" id="SPELLING_ERROR_3"><span class="blsp-spelling-error" id="SPELLING_ERROR_2"><span class="blsp-spelling-error" id="SPELLING_ERROR_2">WWS</span></span></span> 3.0 development and part of it <span class="blsp-spelling-error" id="SPELLING_ERROR_3">webpart</span> development using <strong><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7bf65b28-06e2-4e87-9bad-086e32185e68&DisplayLang=en"><span class="blsp-spelling-error" id="SPELLING_ERROR_4">VSeWSSv</span>12</a> </strong>(Extension for VS.<span class="blsp-spelling-error" id="SPELLING_ERROR_5">NEt</span> 2008) which I intended to blog it(Microsoft always has step ahead).<br />My previous 2 posts (<a href="http://mossindepth.blogspot.com/2008/08/moss-2007-custom-webparts-part-i.html">Part-1</a> - <a href="http://mossindepth.blogspot.com/2008/08/moss-2007-custom-webparts-part-ii.html">Part-II</a>) were enough to create <span class="blsp-spelling-error" id="SPELLING_ERROR_6">webparts</span> manually and understand what goes on <span class="blsp-spelling-corrected" id="SPELLING_ERROR_7">behind</span> the scene. But I'll blog some issues related like (Security permissions - ToolPane...........etc) .<br /><br />The <span class="blsp-spelling-error" id="SPELLING_ERROR_3"><span class="blsp-spelling-error" id="SPELLING_ERROR_8">HOLs</span></span> included are:<br />1. Web Parts<br />2. Data Lists<br />3. Event Handlers<br />4. <span class="blsp-spelling-error" id="SPELLING_ERROR_4"><span class="blsp-spelling-error" id="SPELLING_ERROR_4"><span class="blsp-spelling-error" id="SPELLING_ERROR_9">Workflow</span></span></span><br />5. <span class="blsp-spelling-error" id="SPELLING_ERROR_5"><span class="blsp-spelling-error" id="SPELLING_ERROR_5"><span class="blsp-spelling-error" id="SPELLING_ERROR_10">Silverlight</span></span></span><br />6. Page Navigation<br />7. Page Branding<br />8. Web Services<br />9. Content Types<br />10. User Authentication<br /><br /><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b885dce8-c93f-48aa-b798-4422febcc200&DisplayLang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=b885dce8-c93f-48aa-b798-4422febcc200&<span class="blsp-spelling-error" id="SPELLING_ERROR_6"><span class="blsp-spelling-error" id="SPELLING_ERROR_11">DisplayLang</span></span>=en</a><br /><br />don't miss it.Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com2tag:blogger.com,1999:blog-3051138665557108561.post-59271432328643763552008-08-08T18:51:00.023+04:002008-08-10T08:10:37.945+04:00Moss 2007 Custom webparts (Part II-Development.)<div align="left">Well, after we setup our world(VS.NET project) to start coding MOSS custom webpart <a href="http://mossindepth.blogspot.com/2008/08/moss-2007-custom-webparts-part-i.html">PART I</a> here we will go into development phase(cheer up developers).</div><br />Below i'll talk about webpart life cycel to know (when!! we can do what!!).<br /><br /><ol><li><strong>OnInit():</strong> This event handler is called immediately before the OnInit() method of the pagethat hosts the web part. This method can be used to initialize values required within the web part.<br /></li><li><strong>OnLoad():</strong> This event is called immediately before the OnLoad() method of the page that hosts the web part. This method is typically used to interact with the controls that are part of the web part.<br /></li><li><strong>CreateChildControls():</strong> This method can be used to add child controls to a web part and define event handlers for those child controls.<br /></li><li><strong>PreRender():</strong> This is the last event that occurs before the web part output is rendered to the page.<br /></li><li><strong>Render():</strong> This method sends the web part to its HTML writer. This method calls the following methods: RenderBeginTag(), RenderContents(), and RenderEndTag().<br /></li><li><strong>RenderContents():</strong> This method is responsible for adding content to the web part’s<br />HTML writer.</li><li><strong>UnLoad():</strong> This event occurs when the instance of the web part is discarded; at that time, the response is already sent back to the client. This is a good place to release any handles to resources that are still left open.</li></ol>I think these events are clear and understandable.<br /><ol><li>Now Open our solution <strong>FirstWebPart</strong> and we will override method from WebPart class called <strong>RenderContents (</strong>defined above<strong>).</strong></li><p align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJ2czv-5Q-I/AAAAAAAAABw/_VvrvBoA7eA/s1600-h/1.JPG"><img id="BLOGGER_PHOTO_ID_5232510754941912034" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJ2czv-5Q-I/AAAAAAAAABw/_VvrvBoA7eA/s400/1.JPG" border="0" /></a></p><li><strong></strong>We need to modify file called "<strong>Assemblyinfo.cs</strong>" with adding 2 lines "Using System.Security" as directive and Code line "[assembly: AllowPartiallyTrustedCallers()]".</li><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2lJ-fPRsI/AAAAAAAAACQ/qIN26mhfBC8/s1600-h/1-1.JPG"><img id="BLOGGER_PHOTO_ID_5232519932885812930" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2lJ-fPRsI/AAAAAAAAACQ/qIN26mhfBC8/s400/1-1.JPG" border="0" /></a></p><li>This will write message at your page as webpart output .<br /></li><li>To add your wepart to sharepoint, your DLL should be strongly signed(i.e. should has strong name <strong>key file</strong> this file grant we have only one PublicTokenKey across rebuilding your webpart project).<br /></li><li>To get this key file <strong>right click</strong> on your peoject name -->Properties -->sign -->check sign the assembly --> select "New" from combobox "choose strong name key file"/"Browse if you will use already exist key file-not recommended-" -->enter key file name "key" --> <span class="blsp-spelling-corrected" id="SPELLING_ERROR_0">unchecked</span> "protect my key file...." </li><p align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJ2ej3_AC_I/AAAAAAAAAB4/hlMRpWNCZDo/s1600-h/2.JPG"><img id="BLOGGER_PHOTO_ID_5232512681235188722" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJ2ej3_AC_I/AAAAAAAAAB4/hlMRpWNCZDo/s400/2.JPG" border="0" /></a></p><li>At <strong>Solution Explorer</strong> note that new file has been added to the solution "<strong>key</strong>". <div align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2frLZeP5I/AAAAAAAAACA/djoKDAemJCE/s1600-h/3.JPG"><img id="BLOGGER_PHOTO_ID_5232513906217205650" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2frLZeP5I/AAAAAAAAACA/djoKDAemJCE/s400/3.JPG" border="0" /></a></div><br /></li><li>Now Build your project and be sure you don't have any errors.<br /></li><li>try yo drag your <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_1"><span class="blsp-spelling-error" id="SPELLING_ERROR_0">Firstwebpart</span></span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_2"><span class="blsp-spelling-error" id="SPELLING_ERROR_1">dll</span></span></strong> from your project directory (Ex.:<strong>C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\<span class="blsp-spelling-error" id="SPELLING_ERROR_3"><span class="blsp-spelling-error" id="SPELLING_ERROR_2">FirstWebPart</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_4"><span class="blsp-spelling-error" id="SPELLING_ERROR_3">FirstWebPart</span></span>\bin\Debug</strong>) and drop it at (<strong>C:\WINDOWS\assembly</strong>) to get <span class="blsp-spelling-error" id="SPELLING_ERROR_5"><span class="blsp-spelling-error" id="SPELLING_ERROR_4">ProductTokenKey</span></span> and other information needed to register the <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_6"><span class="blsp-spelling-error" id="SPELLING_ERROR_5">Firstwebpart</span></span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_7"><span class="blsp-spelling-error" id="SPELLING_ERROR_6">dll</span></span></strong> into <span class="blsp-spelling-error" id="SPELLING_ERROR_8"><span class="blsp-spelling-error" id="SPELLING_ERROR_7">Sharepoint</span></span>. (you can use any <span class="blsp-spelling-error" id="SPELLING_ERROR_9"><span class="blsp-spelling-error" id="SPELLING_ERROR_8">refactor</span></span> tool to extract these information).<br /><div align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SJ2g-TbATRI/AAAAAAAAACI/JrtZISP7cyg/s1600-h/4.JPG"><img id="BLOGGER_PHOTO_ID_5232515334300257554" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SJ2g-TbATRI/AAAAAAAAACI/JrtZISP7cyg/s400/4.JPG" border="0" /></a></div><br /></li><li>Keep Marked information from previous image for later use and delete the file from (<strong>C:\WINDOWS\assembly</strong>)-I'll tell you why!! later -<br /></li><li>Now it's the time to deploy our <span class="blsp-spelling-error" id="SPELLING_ERROR_10"><span class="blsp-spelling-error" id="SPELLING_ERROR_9">webpart</span></span> to <span class="blsp-spelling-error" id="SPELLING_ERROR_11"><span class="blsp-spelling-error" id="SPELLING_ERROR_10">sharepoint</span></span> as every thing is ready and we have many ways to deploy it and we will discuss all in coming series but here I'll use <strong>manual deployment</strong> and we have 2 ways here (Deploy your <span class="blsp-spelling-error" id="SPELLING_ERROR_12"><span class="blsp-spelling-error" id="SPELLING_ERROR_11">DLL</span></span> to <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_13"><span class="blsp-spelling-error" id="SPELLING_ERROR_12">GAC</span></span>:Not recommended as your <span class="blsp-spelling-error" id="SPELLING_ERROR_14"><span class="blsp-spelling-error" id="SPELLING_ERROR_13">dll</span></span> will be available to be used in range wider than desired</strong> or to your portal <strong>Bin directory: Recommended for this reason we modify "<span class="blsp-spelling-error" id="SPELLING_ERROR_15"><span class="blsp-spelling-error" id="SPELLING_ERROR_14">Assemblyinfo</span></span>.cs" file in Point "2"</strong>)<br /></li><li>Define your <span class="blsp-spelling-error" id="SPELLING_ERROR_16"><span class="blsp-spelling-error" id="SPELLING_ERROR_15">DLL</span></span> as <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_17"><span class="blsp-spelling-error" id="SPELLING_ERROR_16">safecontrol</span></span></strong> to tell <span class="blsp-spelling-error" id="SPELLING_ERROR_18"><span class="blsp-spelling-error" id="SPELLING_ERROR_17">sharepoint</span></span> this new control is <span class="blsp-spelling-corrected" id="SPELLING_ERROR_19">completely</span> safe to deal with by open your <span class="blsp-spelling-error" id="SPELLING_ERROR_20"><span class="blsp-spelling-error" id="SPELLING_ERROR_18">webapplication</span></span> <strong>BIN</strong> directory (Ex.:C:\<span class="blsp-spelling-error" id="SPELLING_ERROR_21"><span class="blsp-spelling-error" id="SPELLING_ERROR_19">Inetpub</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_22"><span class="blsp-spelling-error" id="SPELLING_ERROR_20">wwwroot</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_23"><span class="blsp-spelling-error" id="SPELLING_ERROR_21">wss</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_24"><span class="blsp-spelling-error" id="SPELLING_ERROR_22">VirtualDirectories</span></span>\1234\bin) and paste <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_25"><span class="blsp-spelling-error" id="SPELLING_ERROR_23">FirstWebPart</span></span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_26"><span class="blsp-spelling-error" id="SPELLING_ERROR_24">DLL</span></span></strong> into it.<br /></li><li>Open Web.<span class="blsp-spelling-error" id="SPELLING_ERROR_27"><span class="blsp-spelling-error" id="SPELLING_ERROR_25">Config</span></span> file (Ex.:C:\<span class="blsp-spelling-error" id="SPELLING_ERROR_28"><span class="blsp-spelling-error" id="SPELLING_ERROR_26">Inetpub</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_29"><span class="blsp-spelling-error" id="SPELLING_ERROR_27">wwwroot</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_30"><span class="blsp-spelling-error" id="SPELLING_ERROR_28">wss</span></span>\<span class="blsp-spelling-error" id="SPELLING_ERROR_31"><span class="blsp-spelling-error" id="SPELLING_ERROR_29">VirtualDirectories</span></span>\1234)<br /></li><li>Add new line at <strong><safecontrols></strong>node as shown below.</li><br />< assembly="FirstWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7dea06abe781fd42" namespace="FirstWebPart" typename="*" safe="True"><br /><safecontrol safe="True" typename="*" namespace="FirstWebPart" assembly="FirstWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7dea06abe781fd42"><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SJ2mhS3jj1I/AAAAAAAAACY/mnJwcrus0_g/s1600-h/5.JPG"><img id="BLOGGER_PHOTO_ID_5232521433005133650" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SJ2mhS3jj1I/AAAAAAAAACY/mnJwcrus0_g/s400/5.JPG" border="0" /></a></p><br /><br /><li>Now it is time to know how we can deploy our <span class="blsp-spelling-error" id="SPELLING_ERROR_32"><span class="blsp-spelling-error" id="SPELLING_ERROR_30">webpart</span></span> from my <span class="blsp-spelling-error" id="SPELLING_ERROR_33"><span class="blsp-spelling-error" id="SPELLING_ERROR_31">SharePoint</span></span> site itself.<br /></li><li>Follow images below.</li></ol><div align="center"><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJ2no18MP9I/AAAAAAAAACg/lfnhw0IKU_U/s1600-h/6.JPG"><img id="BLOGGER_PHOTO_ID_5232522662190530514" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJ2no18MP9I/AAAAAAAAACg/lfnhw0IKU_U/s400/6.JPG" border="0" /></a><br /><br /><br /></div><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2oLEwSygI/AAAAAAAAACo/9_tHnNluk5Q/s1600-h/7.JPG"><img id="BLOGGER_PHOTO_ID_5232523250282711554" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2oLEwSygI/AAAAAAAAACo/9_tHnNluk5Q/s400/7.JPG" border="0" /></a> </p><p align="center"><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SJ2olZTUTHI/AAAAAAAAACw/z8NP5OQS1Jc/s1600-h/8.JPG"><img id="BLOGGER_PHOTO_ID_5232523702474919026" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SJ2olZTUTHI/AAAAAAAAACw/z8NP5OQS1Jc/s400/8.JPG" border="0" /></a><br /></p><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2p22NrLJI/AAAAAAAAAC4/DoUsBVRV8Mo/s1600-h/9.JPG"><img id="BLOGGER_PHOTO_ID_5232525101805284498" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2p22NrLJI/AAAAAAAAAC4/DoUsBVRV8Mo/s400/9.JPG" border="0" /></a></p><p align="center"><br /><a href="http://1.bp.blogspot.com/_TaG8MdCjQeY/SJ2qDuf_sZI/AAAAAAAAADA/eKq_D5VmM3k/s1600-h/10.JPG"><img id="BLOGGER_PHOTO_ID_5232525323072942482" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_TaG8MdCjQeY/SJ2qDuf_sZI/AAAAAAAAADA/eKq_D5VmM3k/s400/10.JPG" border="0" /></a><br /></p><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2qZIBKaXI/AAAAAAAAADQ/4-8ESlgZyFo/s1600-h/11.JPG"><img id="BLOGGER_PHOTO_ID_5232525690700196210" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2qZIBKaXI/AAAAAAAAADQ/4-8ESlgZyFo/s400/11.JPG" border="0" /></a></p><p align="center"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2qgMzaVEI/AAAAAAAAADY/3WnuC0v8elQ/s1600-h/12.JPG"><img id="BLOGGER_PHOTO_ID_5232525812243780674" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJ2qgMzaVEI/AAAAAAAAADY/3WnuC0v8elQ/s400/12.JPG" border="0" /></a><br /></p><p align="center"><a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SJ2qoA-UufI/AAAAAAAAADg/A9APJQsyEqc/s1600-h/13.JPG"><img id="BLOGGER_PHOTO_ID_5232525946507278834" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SJ2qoA-UufI/AAAAAAAAADg/A9APJQsyEqc/s400/13.JPG" border="0" /></a></p><p align="left">Here we did all required steps for moss <span class="blsp-spelling-error" id="SPELLING_ERROR_34"><span class="blsp-spelling-error" id="SPELLING_ERROR_32">webpart</span></span> development and deployment.</p><p align="left"></p>Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com0tag:blogger.com,1999:blog-3051138665557108561.post-66933482347499047112008-08-08T13:20:00.018+04:002008-08-08T15:59:30.137+04:00Moss 2007 Custom webparts (Part I-Environment Setup.)<strong>T</strong>he first thing any Moss2007 developer think about is how to create custom webpart and see how it will enhance his website functionality even if this start is the most famous Microsoft starting application "Hello World".<br /><br /><br /><strong>B</strong>ut here i'll go directly to the point which is "Start with environment setup, some concepts, developing simple webpart does something useful and walk through some enhancements to get robust one".<br /><br /><br /><strong>S</strong>o with this series whatever your proficiency level you will find your start-point for doing this stuff.<br /><br /><br />Sorry for long intro. But i see it is nice to explain the strategy i'll follow at any issue i'll blog.<br /><br /><br />let's have some fun.....<br /><br /><br />Tools i use:<br /><ul><li>VS.NET 2008.</li><li>SharePoint Object Model(<a href="http://en.wikipedia.org/wiki/API">API</a>s-Application programming interface- for programmers).</li></ul><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJwZIbUvhII/AAAAAAAAAAg/eamkdvX670U/s1600-h/1.JPG"></a><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJwZIbUvhII/AAAAAAAAAAg/eamkdvX670U/s1600-h/1.JPG"></a><ol><li>Open VS.NET 2008, from menu <strong>File</strong> --> <strong>New</strong> --><strong>Projects.</strong></li><li>From left pane"Project types" select <strong>Visual C#</strong>--> <strong>Windows</strong>.</li><li>At right pane"Templates" select <strong>Class Library</strong>.</li><li>At text boxes down type your project "webpart" name "<strong>FirstWebPart</strong>".<br /><br /><div align="left"><a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJwZ5I53toI/AAAAAAAAAAw/JmKzOAVqQgM/s1600-h/1.JPG"><img id="BLOGGER_PHOTO_ID_5232085336531121794" style="WIDTH: 496px; CURSOR: hand; HEIGHT: 325px" height="272" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJwZ5I53toI/AAAAAAAAAAw/JmKzOAVqQgM/s400/1.JPG" width="496" border="0" /></a></div></li><br /><li>Let Visual Studio create the necessary project components for you.</li><li>From <strong>Solution Explorer</strong> rename <strong>Class1.cs</strong> to <strong>FirstWebPart.cs</strong>.</li><li><strong><em><span style="color:#ff0000;">NOTE:</span> </em></strong>At code editor, text after <strong>namespace</strong> and <strong>class</strong> are changed automatically(save seconds to rename it manually-thanks Microsoft). </li><br /> <a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJwd6lOdRZI/AAAAAAAAAA4/IBheKBWfx74/s1600-h/2.JPG"><img id="BLOGGER_PHOTO_ID_5232089759360042386" style="WIDTH: 238px; CURSOR: hand; HEIGHT: 217px" height="242" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJwd6lOdRZI/AAAAAAAAAA4/IBheKBWfx74/s400/2.JPG" width="287" border="0" /></a> <a href="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJwfSeFyj5I/AAAAAAAAABI/fwqroZdX02g/s1600-h/2-1.JPG"><img id="BLOGGER_PHOTO_ID_5232091269273128850" style="WIDTH: 271px; CURSOR: hand; HEIGHT: 217px" height="272" alt="" src="http://2.bp.blogspot.com/_TaG8MdCjQeY/SJwfSeFyj5I/AAAAAAAAABI/fwqroZdX02g/s400/2-1.JPG" width="308" border="0" /></a><br /><br /><li>It's time to add some "DLLs" to help us to do our job.</li><li>From <strong>Solution Explorer</strong>, right click on <strong>References</strong> --> <strong>Add Reference.</strong> <a href="http://4.bp.blogspot.com/_TaG8MdCjQeY/SJwiF3AyC1I/AAAAAAAAABQ/SUivQHs5oHc/s1600-h/3.JPG"><img id="BLOGGER_PHOTO_ID_5232094351159593810" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_TaG8MdCjQeY/SJwiF3AyC1I/AAAAAAAAABQ/SUivQHs5oHc/s400/3.JPG" border="0" /></a></li><br /><li>Dialog <strong>Add Reference</strong> will appear and from <strong>.NET</strong> tab select tow references(System.Security - System.Web).</li><br /><li>To finish this step we missed only one important reference..Guess what? YES, it's SharePoint reference</li><br /><li>To get SharePoint DLL to be referenced at your project it depends on where you develop your webpart now, is it on machine with MOSS 2007 installed? or your own winXP machine(sharepoint not installed locally).</li><br /><li><strong><em>CASE 1</em> "Machine with MOSS 2007 installed":</strong> Dialog <strong>Add Reference</strong> go to <strong>Browse </strong>tab and go to this URL(assuming your moss installed on c: drive)<br /><span style="color:#3333ff;">C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI</span><br /></li><br /><li><strong><em>CASE 2</em> "Local winXP machine":</strong> Ask your system administrator to locate this DLL on MOSS 2007 server and send it for you from mentioned <strong>ISAPI</strong> hive and save it at your local machine and locate it using previous step.<br /><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJwo9vzeH5I/AAAAAAAAABY/Ksk9iNeFjJE/s1600-h/4.JPG"><img id="BLOGGER_PHOTO_ID_5232101908367155090" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJwo9vzeH5I/AAAAAAAAABY/Ksk9iNeFjJE/s400/4.JPG" border="0" /></a></li><br /><li>At <strong>Solution Explorer</strong> the <strong>References</strong> node will look like the image below.</li><li>Add <strong>directives</strong> to get access to different class inside references added earlier as <strong>Step1</strong> shown in image below.</li><li>Let your class inherits from <strong>WebPart</strong> class "That's why we add SharePoint reference-POINTS 12, 13 and 14"as <strong>Step2</strong> shown in image below..<br /></li><a href="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJwsPpPCukI/AAAAAAAAABo/_ayjcfbFcVs/s1600-h/5.JPG"><img id="BLOGGER_PHOTO_ID_5232105514376280642" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_TaG8MdCjQeY/SJwsPpPCukI/AAAAAAAAABo/_ayjcfbFcVs/s400/5.JPG" border="0" /></a><br /><li>After all these steps we have readymade environment for our development.<br /></li></ol><p>Now we have space to start our development.</p><p>Wait me next article and it will be soon...</p>Ahmed Azizhttp://www.blogger.com/profile/14765170507905453259noreply@blogger.com0