-
Recently we had a requirement in my project a Internet facing portal which is Architected and Designed on Microsoft Office Sharepoint Services 2007 (MOSS) to have a warm up script for Forms based authentication (FBA). We looked around the web and did not find any single solution stating how to implement this requirement hence this blog post.
Warm up scripts hit each page in a site collection thus forcing MOSS or application to cache these pages in OOB MOSS Cache or your custom cache which improves the overall performance of the site when real time users hit each page.
In a internet/intranet portal we have content enabled for authenticated users which won't be cached until those users log in to the site which will make the initial response time for those pages slow hence we need to warm up those pages as well.
This Script uses the MOSS OOB authentication web service to first authenticate the user and then hits the authenticated pages using the WebRequest and WebResponse object.
Code Snippet:
Note:Works only for MOSS Publising portal and not for other site defination however the overall concept still remians the same.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Publishing;
using System.Net;
using System.Web.Security;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
//args[0]: This is the Site Collection url, e.g.: http://pub-staging.ABCD.com
//args[1]: This is web service URL for Authentication, e.g: http://pub-staging.ABCD.com/_vti_bin/Authentication.asmx
//args[2]: This is the username
//args[3]: This is the password
//string strSiteURL = "http://pub-staging.ABCD.com";
string strSiteURL = args[0];
//
System.Net.CookieContainer cookie;
bool blnStatus = FBAAuthenticate(out cookie,args[1],args[2],args[3]);
//
using (SPSite site = new SPSite(strSiteURL))
{
foreach (SPWeb web in site.AllWebs)
{
Console.WriteLine("***********************************************************");
Console.WriteLine(web.Url.ToString());
Console.WriteLine("***********************************************************");
if (PublishingWeb.IsPublishingWeb(web))
{
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
PublishingPageCollection pageColl = publishingWeb.GetPublishingPages();
//Call the web service Authentication
foreach (SPListItem listItem in publishingWeb.PagesList.Items)
{
if (PublishingPage.IsPublishingPage(listItem))
{
PublishingPage page = PublishingPage.GetPublishingPage(listItem);
try
{
System.Net.HttpWebRequest req =
(System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(page.Uri.ToString());
req.CookieContainer = cookie;
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
using (System.IO.Stream str = res.GetResponseStream())
{
using (System.IO.StreamReader strReader = new System.IO.StreamReader(str))
{
Console.WriteLine(strReader.ReadToEnd());
strReader.Dispose();
}
}
}
catch (Exception ex)
{
//Handle the exception
}
}
}
}
}
}
}
/// <summary>
/// Sharepoint forms based authentication (FBA) web method call.
/// </summary>
/// <param name="cookieContainer">CookieContainer</param>
/// <param name="strSiteId">String</param>
/// <returns>Boolean</returns>
private static bool FBAAuthenticate(out System.Net.CookieContainer cookieContainer, string webServiceURL, string userName, string pwd)
{
bool blnStatus;
FBAPORTAL.Authentication auth = new FBAPORTAL.Authentication();
//auth.Url = "http://pub-staging.ABCD.com/_vti_bin/Authentication.asmx";
auth.Url = webServiceURL;
auth.CookieContainer = new System.Net.CookieContainer();
auth.AllowAutoRedirect = true;
FBAPORTAL.LoginResult loginResult = auth.Login(userName,pwd );
if (loginResult.ErrorCode == FBAPORTAL.LoginErrorCode.NoError)
{
blnStatus = true;
cookieContainer = auth.CookieContainer;
}
else
{
blnStatus = false;
cookieContainer = null;
}
return blnStatus;
}
}
}
-
|
This custom datagrid webcontrol will provide out of the box functionalities with full state management by just setting AlladinDataGrid custom properties at designtime, runtime or web config file and extended properties of a datacolumn by adding the custom datatype or enum properties of alladindatagridcelltype for achieving following features:
- Expliciltly fire an edit, delete or pagerediect events.
- Captions for Edit, Update, Cancel & Delete buttons can be either text or graphic.
- On double click of any row, editcommand or pageredirect event of the row will be performed.
- On single click of any row, selectcommand will be performed on the client end, thus saving the roundtrip to server.
- Sorting of the columns ASC/DESC on corresponding clicks on the column header.
- Paging of the datagrid.
- Maintaining State Across Pages Or A Page For Checked Records.
- Complete Inline Edit & Fully Editable Support based on the datatype of the datacolumn i.e. Add Textboxs with their Maxlength, date control, dropdownlist, elipse button i.e. textbox with a button control control mostly used for fetching information from a popup windiw , requiredfieldvalidator if not null column, rangevalidators for numeric columns and must more....
- Makes A Particular Row or Column ReadOnly conditionally & unconditionaly.
- Making A Particular Cell As ServerSide Link Button or An Email link button.
- etc....
|
| AlladinDataGrid Source Code
Click Here To View AlladinDataGrid Control Source Code |
-
The Office Migration Planning Manager (OMPM) is a collection of tools that enables preparation and conversion for migration to the Microsoft 2007 Office system. OMPM checks for, and reports on, file properties to help analyse an environment.
The OMPM File Scanner (offscan) a command-line tool was used, that scans files for conversion.
The OMPM File Scanner was used to perform two types of scans:
§ A light scan that quickly identifies the Office documents on a user’s computer or network file system.
§ A deep scan that you can perform on Office documents to gather document properties that provide indicators of potential conversion issues.
SQL Server 2005 database creation tool enables to create the OMPM database, import scanned logs, and import action logs of converted files for further analysis.
Note: While executing the command line utility (ImportActions.bat) for importing action logs on desktops which are a part of work stations a folder hierarchy needs to be created. Change Folder hierarchy from C:\OFCLogs\MACHINENAME to C:\OFCLogs\YOURDOMAIN\MACHINENAME
ACCESS 2007 reporting is used to analysis scanned & converted results and export the scanned records to a text file for conversion.
The OMPM Office File Converter (OFC) a command-line tool allows for conversion of Word, Excel and PowerPoint files to the 2007 Office file formats in bulk.
There are two approaches by which you can perform file conversions with OFC tool
1. FordersToConvert: This approach is not recommended as it only performs the conversion without creating action logs and thus prohibiting the scanned files to be analysed by the Access reporting tool after conversion.
2. FileList: This approach is the recommended one as it performs the conversion and also creates the action logs which can be imported into the SQL Server database for analysis of the converted files by the Access reporting tool.
OMPM Migration Flow of Office File Conversion

REFERENCES
Official online documentation:
http://technet2.microsoft.com/Office/en-us/library/d0373697-31f5-4fc5-8dd1-1b9d7f35842f1033.mspx
OMPM Wiki
http://channel9.msdn.com/wiki/default.aspx/OfficeDeployment.OMPMv1
Document Migration considerations:
http://technet2.microsoft.com/Office/en-us/library/1db55715-df10-428d-ad42-4ce3c58a8edf1033.mspx
http://technet2.microsoft.com/Office/en-us/library/8bbdb70b-ddbc-412b-a525-3a0ca3ec0b691033.mspx
Office File Converter (OFC)
http://technet2.microsoft.com/Office/en-us/library/42a75e09-a6e1-4c0f-b77a-dcfa5b6f11c51033.mspx
Open XML Overview
http://technet2.microsoft.com/Office/en-us/library/cce79538-711f-4686-9a31-2bdc7dd999d51033.mspx
Troubleshooting
http://channel9.msdn.com/wiki/default.aspx/OfficeDeployment.Troubleshooting
-
OCS 2007 / LCS 2005 Presence on web application can easily enable collaboration between co-workers or peers.
Enclosed is an example for the same. To test it on your enviroment you can change the email Ids and take your mouse over the images.
<!--Sample.html-->
<HTML>
<HEAD>
<title>OCS 2007 / LCS 2005 Presence On Web Application</title>
<script src="NameControl.js" type="text/javascript"></script>
</HEAD>
<BODY>
<table>
<tr>
<td>
<span>
<img src="namecontrol_images/unknown.gif" id="personid1" style=""border-width:0px;""/>
<script>PresenceControl(document.all.personid1, 'yasinm@microsoft.com');</script>
</span>
<a class="link1" href="http://blogs.msdn.com/people/person_info.aspx">Yasin Mukadam</a>
</td>
</tr>
</table>
</BODY>
</HTML>
<!--NameControl.js-->
var PresenceControlbrowseris = new PresenceControlBrowseris();
var PresenceControlObject = null;
var bPresenceControlInited = false;
var PresenceControlURIDictionaryObj = null;
var PresenceControlStatesDictionaryObj = null;
var PresenceControlOrigScrollFunc = null;
var bPresenceControlInScrollFunc = false;
//Added By Yasin Mukadam: MCS
//var namectrl = new ActiveXObject("Name.NameCtrl");
function EnsurePresenceControl()
{
if (!bPresenceControlInited)
{
if (PresenceControlbrowseris.ie5up && PresenceControlbrowseris.win32)
{
//@cc_on
//@if (@_jscript_version >= 5)
//@ try
//@ {
//@ PresenceControlObject = new ActiveXObject("Name.NameCtrl.1");
//@ } catch(e)
//@ {
//@
//@ };
//@else
//@end
}
bPresenceControlInited = true;
if (PresenceControlObject)
{
PresenceControlObject.OnStatusChange = PresenceControlOnStatusChange;
}
}
return PresenceControlObject;
}
function PresenceControlOnStatusChange(name, state, id)
{
if (PresenceControlStatesDictionaryObj)
{
var img = PresenceControlGetStatusImage(state);
if (PresenceControlStatesDictionaryObj[id] != state)
{
PresenceControlUpdateImage(id, img);
PresenceControlStatesDictionaryObj[id] = state;
}
}
}
function PresenceControlShowOOUIMouse()
{
PresenceControlShowOOUI(0);
}
function PresenceControlShowOOUIFocus()
{
PresenceControlShowOOUI(1);
}
function PresenceControlShowOOUI(inputType)
{
if (PresenceControlbrowseris.ie5up && PresenceControlbrowseris.win32)
{
var obj = window.event.srcElement;
var objSpan = obj;
var objOOUI = obj;
var oouiX = 0, oouiY = 0;
if (EnsurePresenceControl() && PresenceControlURIDictionaryObj)
{
var objRet = PresenceControlGetOOUILocation(obj, false);
objSpan = objRet.objSpan;
objOOUI = objRet.objOOUI;
oouiX = objRet.oouiX;
oouiY = objRet.oouiY;
var name = PresenceControlURIDictionaryObj[objOOUI.id];
if (objSpan)
objSpan.onkeydown = PresenceControlHandleAccelerator;
PresenceControlObject.ShowOOUI(name, inputType, oouiX, oouiY);
}
}
}
function PresenceControlHideOOUI()
{
PresenceControlObject.HideOOUI();
}
function PresenceControlGetStatusImage(state)
{
var img = "PresenceControlBLANK.GIF";
switch (state)
{
case 0:
img = "PresenceControlON.GIF";
break;
case 1:
img = "PresenceControlOFF.GIF";
break;
case 2:
img = "PresenceControlAWAY.GIF";
break;
case 3:
img = "PresenceControlBUSY.GIF";
break;
case 4:
img = "PresenceControlAWAY.GIF";
break;
case 5:
img = "PresenceControlBUSY.GIF";
break;
case 6:
img = "PresenceControlAWAY.GIF";
break;
}
return img;
}
function PresenceControlUpdateImage(id, img)
{
var obj = document.images(id);
if (obj)
{
var oldImg = obj.src;
var index = oldImg.lastIndexOf("/");
var newImg = oldImg.slice(0, index + 1);
newImg += img;
if (oldImg != newImg)
obj.src = newImg;
if (obj.altbase)
{
obj.alt = obj.altbase;
}
}
}
function PresenceControlScroll()
{
if (!bPresenceControlInScrollFunc)
{
bPresenceControlInScrollFunc = true;
PresenceControlHideOOUI();
}
bPresenceControlInScrollFunc = false;
return PresenceControlOrigScrollFunc ? PresenceControlOrigScrollFunc() : true;
}
function PresenceControl(imgobj, uri)
{
if (uri == null || uri == '')
return;
if(imgobj == null || imgobj == '')
{
return;
}
if (PresenceControlbrowseris.ie5up && PresenceControlbrowseris.win32)
{
//var obj = window.event.srcElement;
var obj = imgobj
var objSpan = obj;
var id = obj.id;
var fFirst = false;
if (!PresenceControlStatesDictionaryObj)
{
PresenceControlStatesDictionaryObj = new Object();
PresenceControlURIDictionaryObj = new Object();
if (!PresenceControlOrigScrollFunc )
{
PresenceControlOrigScrollFunc = window.onscroll;
window.onscroll = PresenceControlScroll;
}
}
if (PresenceControlStatesDictionaryObj)
{
if (!PresenceControlURIDictionaryObj[id])
{
PresenceControlURIDictionaryObj[id] = uri;
fFirst = true;
}
if (typeof(PresenceControlStatesDictionaryObj[id]) == "undefined")
{
PresenceControlStatesDictionaryObj[id] = 1;
}
if (fFirst && EnsurePresenceControl() && PresenceControlObject.PresenceEnabled)
{
var state = 1, img;
state = PresenceControlObject.GetStatus(uri, id);
img = PresenceControlGetStatusImage(state);
PresenceControlUpdateImage(id, img);
PresenceControlStatesDictionaryObj[id] = state;
}
}
if (fFirst)
{
var objRet = PresenceControlGetOOUILocation(obj,false);
objSpan = objRet.objSpan;
if (objSpan)
{
objSpan.onmouseover = PresenceControlShowOOUIMouse;
objSpan.onfocusin = PresenceControlShowOOUIFocus;
objSpan.onmouseout = PresenceControlHideOOUI;
objSpan.onfocusout = PresenceControlHideOOUI;
}
}
}
}
function PresenceControlHandleAccelerator()
{
if (PresenceControlObject)
{
if (event.altKey && event.shiftKey &&
event.keyCode==121)
{
PresenceControlObject.DoAccelerator();
}
}
}
function PresenceControlGetOOUILocation(obj, fprint)
{
var objRet = new Object;
var objSpan = obj;
var objOOUI = obj;
var oouiX = 0, oouiY = 0, objDX = 0;
var fRtl = document.dir == "rtl";
while (objSpan && objSpan.tagName != "SPAN" && objSpan.tagName != "TABLE")
{
objSpan = objSpan.parentNode;
}
if (objSpan)
{
var collNodes = objSpan.tagName == "TABLE" ?
objSpan.rows(0).cells(0).childNodes :
objSpan.childNodes;
var i;
for (i = 0; i < collNodes.length; ++i)
{
if (collNodes.item(i).tagName == "IMG" && collNodes.item(i).id)
{
objOOUI = collNodes.item(i);
break;
}
}
}
obj = objOOUI;
while (obj)
{
if (fRtl)
{
if (obj.scrollWidth >= obj.clientWidth + obj.scrollLeft)
objDX = obj.scrollWidth - obj.clientWidth - obj.scrollLeft;
else
objDX = obj.clientWidth + obj.scrollLeft - obj.scrollWidth;
oouiX += obj.offsetLeft + objDX;
}
else
{
oouiX += obj.offsetLeft;
oouiY += obj.offsetTop;
}
if (fprint)
{
alert(obj.scrollTop);
}
obj = obj.offsetParent;
}
try
{
obj = window.frameElement;
while (obj)
{
if (fRtl)
{
if (obj.scrollWidth >= obj.clientWidth + obj.scrollLeft)
objDX = obj.scrollWidth - obj.clientWidth - obj.scrollLeft;
else
objDX = obj.clientWidth + obj.scrollLeft - obj.scrollWidth;
oouiX += obj.offsetLeft + objDX;
}
else
oouiX += obj.offsetLeft - obj.scrollLeft;
oouiY += obj.offsetTop - obj.scrollTop;
if (fprint)
{
alert(obj.scrollTop);
}
obj = obj.offsetParent;
}
} catch(e)
{
};
var scrOfX = 0, scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' ) {
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;
} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;
} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
}
objRet.objSpan = objSpan;
objRet.objOOUI = objOOUI;
objRet.oouiX = oouiX;
objRet.oouiY = oouiY - scrOfY;
if (fRtl)
objRet.oouiX += objOOUI.offsetWidth;
if (fprint)
{
alert(oouiY);
}
return objRet;
}
function PresenceControlBrowseris () {
var agt = navigator.userAgent.toLowerCase();
this.osver = 1.0;
if (agt)
{
var stOSVer = agt.substring(agt.indexOf("windows ") + 11);
this.osver = parseFloat(stOSVer);
}
this.major = parseInt(navigator.appVersion);
this.nav = ((agt.indexOf('mozilla')!=-1)&&((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1)));
this.nav2 = (this.nav && (this.major == 2));
this.nav3 = (this.nav && (this.major == 3));
this.nav4 = (this.nav && (this.major == 4));
this.nav6 = this.nav && (this.major == 5);
this.nav6up = this.nav && (this.major >= 5);
this.nav7up = false;
if (this.nav6up)
{
var navIdx = agt.indexOf("netscape/");
if (navIdx >=0 )
this.nav7up = parseInt(agt.substring(navIdx+9)) >= 7;
}
this.ie = (agt.indexOf("msie")!=-1);
this.aol = this.ie && agt.indexOf(" aol ")!=-1;
if (this.ie)
{
var stIEVer = agt.substring(agt.indexOf("msie ") + 5);
this.iever = parseInt(stIEVer);
this.verIEFull = parseFloat(stIEVer);
}
else
this.iever = 0;
this.ie3 = ( this.ie && (this.major == 2));
this.ie4 = ( this.ie && (this.major == 4));
this.ie4up = this.ie && (this.major >=4);
this.ie5up = this.ie && (this.iever >= 5);
this.ie55up = this.ie && (this.verIEFull >= 5.5);
this.ie6up = this.ie && (this.iever >= 6);
this.win16 = ((agt.indexOf("win16")!=-1)
|| (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1)
|| (agt.indexOf("windows 16-bit")!=-1) );
this.win31 = (agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1);
this.win98 = ((agt.indexOf("win98")!=-1)||(agt.indexOf("windows 98")!=-1));
this.win95 = ((agt.indexOf("win95")!=-1)||(agt.indexOf("windows 95")!=-1));
this.winnt = ((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1));
this.win32 = this.win95 || this.winnt || this.win98 ||
((this.major >= 4) && (navigator.platform == "Win32")) ||
(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1);
this.os2 = (agt.indexOf("os/2")!=-1)
|| (navigator.appVersion.indexOf("OS/2")!=-1)
|| (agt.indexOf("ibm-webexplorer")!=-1);
this.mac = (agt.indexOf("mac")!=-1);
this.mac68k = this.mac && ((agt.indexOf("68k")!=-1) ||
(agt.indexOf("68000")!=-1));
this.macppc = this.mac && ((agt.indexOf("ppc")!=-1) ||
(agt.indexOf("powerpc")!=-1));
this.w3c = this.nav6up;
}
<!--Images-->
PresenceControlON: 
Unknown: 
PresenceControlOFF:
PresenceControlBUSY:
PresenceControlBLANK:
PresenceControlAWAY: 
-
WSSDW.exe is a Open source tool for testing MOSS performance & capacity planning can be downloaded from http://www.codeplex.com/sptdatapop.
-
The Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System programmatically collects settings and values from data repositories such as MS SQL, registry, metabase and performance monitor. Once collected, a set of comprehensive ‘best practice’ rules are applied to the topology.
Administrators running this tool will get a detailed report listing the recommendations that can be made to the environment to achieve greater performance, scalability and uptime.
-
If your application is working with the registry frequently mostly while creating installer and you need to dynamically monitor your registry then you can use a tool called RegMon for Windows v7.04. This tool is very helpful for viewing the registery dynamically.
-
If you are developing .net applications such as managed windows services, managed Add-Ins for MS Office or Interope application such Deskbar search etc.. and want to debug output without attching debugger or in production enviroment remotely you can use the DebugView for Windows v4.64.
Following is the step by step example of the same
1) Create a sample concole application in c#
2) Write following line of code
using System;
using System.Collections.Generic;
using
System.Text;
namespace
ExampleDebugView
{
class Program
{
static void Main(string[] args)
{
System.Diagnostics.
Trace.WriteLine("Sample Debug View Output");
System.Diagnostics.
Trace.WriteLine("Enters The Main Method");
Console.WriteLine("DebugViewer Outputs");
System.Diagnostics.
Trace.WriteLine("Exits The Main Method");
Console.ReadLine();
}
}
}
3) Write a app.config file with the following settings
<?
xml version="1.0" encoding="utf-8" ?>
<
configuration>
<
system.diagnostics>
<
switches>
<!--
This switch controls general messages. In order to
receive general trace messages change the value to the
appropriate level. "1" gives error messages, "2" gives errors
and warnings, "3" gives more detailed error information, and
"4" gives verbose trace information
-->
<
add name="TraceLevelSwitch" value="4" />
</
switches>
</
system.diagnostics>
</
configuration>
4) Run DebugViewer .exe and then exccute your application
5) You should see the trace output on your DebugViewer.exe grid.
This tool is very helpful in troubleshooting errors when developing Managed or Interop applications. There are other tools as well which can be used for debugging .net application or windows application at runtime such as Cordbg.exe (Managed Code only) and Windbg
-
extend ASP.NET by providing virtual access to content and files for compilation in ASP.NET 2.0. This feature can be used to create applications similar to Microsoft SharePoint Portal Server, where the content is stored in a database instead of on the physical file system.
refer to this article with sample code for details http://support.microsoft.com/kb/910441.
-
When you are considering deploying your ASP.Net application in a Web Farm via Windows Network Load Balancing Serivice in Win 2003 you can use affinity option Single or Class C in your NLB to route the request back to the same server. This option can provide you with the following benefits
Single affinity is the most common selection when applications require that information about the user state be maintained across TCP/Http connections. Examples of these types of applications include applications that use SSL or applications that retain user information, such as e-commerce shopping cart applications.Applications that use SSL with Single affinity are efficient because the SSL session IDs are reused. Negotiating a new SSL session ID requires five times the amount of overhead as reusing a SSL session ID. Although negotiating the SSL session ID is transparent to the client, the cumulative increase in overhead could degrade the performance of the cluster.
Applications that retain user information can resolve the affinity requirement by using Network Load Balancing affinity or by using a common session state database or server. Applications that have a common session state database or server are combined with cookie-based affinity to allow any cluster host to restore the appropriate session state. If an application has a common session state database or server, you can select a port rule affinity of None if SSL is not part of the solution.
-
This class creates Http Get & Http Post request for uploading, downloading text and binary data of form fields & file to any web server on any platform with HTTP standards i.e. post or get form method
from any kind of application windows forms, console app or web forms.
Few Features Supported By This Class on any web server on any platform:
1) Downloads raw HTML or XML data from.
2) Saves the Downloaded HTML/XML/Binary data to the local file system e.g. c:\download.
3) Creates dynamic post form method header which can post form data thus enabling one to process Request.Form method on the calling web page e.g. default.asp.
4) Creates dynamic HTTP post form method header which can upload files i.e. (text/binary) along with form data from the local machine to the any web server on any platform with HTTP standards.
5) Creates & retrives dynamic HTTP headers which can enable one to process Request.Header method on the calling web page e.g. default.asp.
6) Creates & retrives dynamic HTTP cookies which can enable one to process Request.Cookies method on the calling web page e.g. default.asp.
7) Retrives Http Status Code after sending the http request.
8) Retrives Http Status Description after sending the http request.
9) Retrives Http Character Set after sending the http request.
10) Retrives Http Content Encoding after sending the http request.
11) Retrives Http Content Last Modified after sending the http request.
12) Retrives Http Content Length after sending the http request.
13) Retrives Http Content Type after sending the http request.
14) Retrives Http Method after sending the http request.
15) Retrives Http ProtocolVersion after sending the http request.
16) Retrives Http Server Name after sending the http request.
you can download the source code from http://blogs.msdn.com/yasinalladin/pages/creating-an-http-get-post-request-at-runtime-to-process-web-pages-and-transfer-files.aspx
-
Windows Sharepoint Services (WSS) 3.0 is built on top of ASP.NET 2.0, All WSS 3.0 incoming request routes through the ASP.NET runtime before WSS. This changed forced to remove the ISAPI filter which was used in previous version of WSS2.0 and adding HTTPModules and HTTPHandlers that are registered with ASP.NET using standard web entries.
Following is a high-level overview of the obvious integration point between ASP.NET 2.0 and WSS3.0:
1. When you register an IIS web application to become WSS3.0 web app, WSS3.0 adds a wildcard application map to IIS metabase. This wildcard application map serves to route all incoming http request to ASP.NET runtime regardless of their extension e.g. .doc etc.
2. ASP.NET 2.0 introduced a new pluggable component type known as Virtual Path Provider.
WSS 3.0 has its own virtual path provider called SPVirtualPathProvider which is able to retrieve an .aspx page from SQL Server and hand it off to .aspx page parser supplied by ASP.NET 2.0.
3. ASP.NET 2.0 introduced a new powerful feature of page templates known as master pages. WSS3.0 sites have a special catalog known as a master page gallery containing a master page default.master.
4. WSS3.0 WebPartManager is a sealed class called SPWebPartManager it inherits from System.Web.UI.WebControls.WebParts.WebPartManager.
5. WSS3.0 WebPartZone is a public sealed class called Microsoft.SharePoint.WebPartPages.WebPartZone, which inherits from System.Web.UI.WebControls.WebParts.WebPartZone.
6. WSS3.0 WebPart inherits from an abstract base class called Microsoft.SharePoint.WebPartPages.WebPart, which inherits from System.Web.UI.WebParts.WebPart.
Note: WSS3.0 still supports web parts developed in WSS2.0 for backward compatibility.
Build, Deploy and Use Your WebPart in WSS3.0
For demonstration, put the following WebPart code in a class library:
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
public class MyWebPart : WebPart
{
private string myText = "Hello World";
[WebBrowsable(true), Personalizable(true)]
public string MyText
{
get { return myText; }
set { myText = value; }
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
writer.Write(myText);
}
}
Next, use the following code snippet to add the AllowPartiallyTrustedCallers attribute
(located under the System.Security namespace) to the code's AssemblyInfo.cs file:
[assembly: AllowPartiallyTrustedCallers()]
Next, give you assembly a strong name, just go into the project properties and then
go to the Signing tab or you can also use the sn.exe command line tool to generate strong names.
Your WebPart is now ready to use. The following steps will enable you to Deploy and Use your webpart:
1. Find the public key token for your assembly with a standard tool such as Reflector
by draging and droping it in Reflector. It should show you the public key token.
2. Locate the SharePoint Web application in which you want to deploy this WebPart.
You can do this via the IIS Manager under administrative tools. The default ones would be
virtual directories that look like GUIDs under C:\Inetpub\wwroot\wss\<<GUID>>.
3. Drop the DLL in the C:\Inetpub\wwroot\wss\<<GUID>>\_app_bin directory in the virtual directory.
By doing this, you effectively allow ASP.NET to access the DLL.
4. Under the same virtual directory, find Web.Config and add the following to the
SafeControls section:
<SafeControl Assembly="MyWebPart,Version=1.0.0.0,
Culture=neutral, PublicKeyToken=yourpublickeytoken"
Namespace="MyWebPart" TypeName="SimpleWebPart" Safe="True"/>
5. add the WebPart to the gallery. go to the Web application whose virtual directory
you have been using. Once on that site, go to
Site Actions -> Site Settings -> Modify All Site Settings.
Under that, click on "Web Parts" under Galleries.
Click on "New" in the toolbar, and find the MyWebPart.MyWebPart.
6. Check the checkbox, and click on "Populate Gallery".
You should see the MyWebPart.MyWebpart file ready to use in your site.
7. Go to the site of your choice and click on Site Actions --> Edit Page.
Your page will prompt you to “add new WebParts dialog” which simply shows
you a list of possible WebParts you could add to your page.
Under Miscellaneous, you should see the MyWebPart.
Check the checkbox, and click "Add".
You now should see the WebPart you wrote running under SharePoint.
Note: You can also use this same webpart in your ASP.NET 2.0 web
application without any modification or change.
-
The ASP.NET Compilation tool (Aspnet_compiler.exe) enables you to compile an ASP.NET Web application, either in place or for deployment to a target location such as a production server. In-place compilation helps application performance because end users do not encounter a delay on the first request to the application while the application is compiled. Aspnet_compiler.exe can be found in %Windows%\Microsoft.Net\Framework\v2.0.50727.
The ASP.NET Compilation tool is not available with versions of ASP.NET earlier than ASP.NET version 2.0.
-
VS2005 does not run or debug web project using IIS instead it uses ASP.NET Development Server. This web host environment dynamically selects a port and begins hosting the web site in a manner that is only accessible to the local host.
ASP.Net Development Server i.e. WebDev.WebServer.EXE can be found in %WINDIR%\Microsoft.NET\Framework\v2.0.XXXXX. but you need to install VS2005.
you can use the following command to execute this server
WebDev.WebServer [/port:<port number>] /path:<physical path> [/vpath:<virtual path>]
-
Recently I had a requirement in which I wanted to fire a ASP.NET validator control from my custom javascript code on the client side.
ASP.NET 2.0 validator control render a javascript file in which there is a function ValidatorValidate(validatorcontrolid). It is this function that actualy gets fired for each validator control on the clientside.