This observation can be used in other context.
Suppose you've have a .ASPX page in SharePoint 2007 that has Performance Point Dashboard web part. To uses the SharePoint site on a client machine that does not have PPS, remove
%@ Register TagPrefix="WpNS1" Namespace ="Microsoft.PerformancePoint.Scorecards.WebParts" ....
If Client machine has PPS installed, and when you add the PPS web part to your page this entry is automatically added.
Thursday, February 12, 2009
Tuesday, February 10, 2009
IIS 7: Resolving Anonymous Logon to SQL from ASP.NET Application deployed on IIS7
If you face an issue wherein your ASP.NET application deployed in IIS7 connects to SQL (SQL Server 2008 Analysis Server) as anonymous user then do the following:-
1. Create a new application pool "MyPool" with Managed Pipeline mode set to classic, Load userprofile set to False and Identity set to custom and using a domain user (and password) that has access to the database.
2. Under 'authorization' of the website itself (this website in now under "MyPool" application pool), have Anonymous set to enabled and ASP.NET impersonate set to disabled.
3. In Web.config, leave impersonation="false".
http://mvolo.com/blogs/serverside/archive/2007/12/08/IIS-7.0-Breaking-Changes-ASP.NET-2.0-applications-Integrated-mode.aspx
1. Create a new application pool "MyPool" with Managed Pipeline mode set to classic, Load userprofile set to False and Identity set to custom and using a domain user (and password) that has access to the database.
2. Under 'authorization' of the website itself (this website in now under "MyPool" application pool), have Anonymous set to enabled and ASP.NET impersonate set to disabled.
3. In Web.config, leave impersonation="false".
http://mvolo.com/blogs/serverside/archive/2007/12/08/IIS-7.0-Breaking-Changes-ASP.NET-2.0-applications-Integrated-mode.aspx
Thursday, February 5, 2009
SharePoint: Sharepoint connects as Anonymous User to SQL Analysis Server on a Remote Machine and fails to retrieve data from CUBE
If you are trying to connect to a Remote Analysis Server 2008 (64 Bit) it connects as Anonymous User for one of the reasons.
1) Make sure the Authorization is Windows
2) Try this
In web.config Set
identity impersonate=" false"
When it is “true”
For User's IE , User a/c has to connect/open SQL server It requires kerbero’s website (setting that you do while setup of WebSite:Portnumber)
When it is “false”
For User's IE, website Identity Account has to connect/open SQL server
It does not require kerbero’s website
1) Make sure the Authorization is Windows
2) Try this
In web.config Set
For User's IE , User a/c has to connect/open SQL server It requires kerbero’s website (setting that you do while setup of WebSite:Portnumber)
When it is “false”
For User's IE, website Identity Account has to connect/open SQL server
It does not require kerbero’s website
Monday, February 2, 2009
.NET: Reading Property Values using Reflection
class CA
{
private string _myProperty;
public string MyProperty
{
get
{
MyProperty = "Hello"; return MyProperty;
}
}
}
class ReadPropertyGeneric where T : class
{
Type myType;
T _objClass;
public void ReadAndSetProperty(T objClass)
{
myType = (typeof(T));
_objClass = objClass;
// Get the public properties.
PropertyInfo[] myPropertyInfo = myType.GetProperties(BindingFlags.Public BindingFlags.Instance);
Console.WriteLine("The mumber of public properties is {0}.", myPropertyInfo.Length);
// Display the public properties.
DisplayPropertyInfo(myPropertyInfo);
}
public void DisplayPropertyInfo(PropertyInfo[] myPropertyInfo)
{
// Display information for all properties.
for (int i = 0; i < myPropertyInfo.Length; i++)
{
PropertyInfo myPropInfo = (PropertyInfo)myPropertyInfo[i];
Console.WriteLine("The property name is {0}.", myPropInfo.Name);
Console.WriteLine("The property type is {0}.", myPropInfo.PropertyType);
Console.WriteLine("The property value is {0}.", myPropInfo.GetValue(_objClass, null));
object setValueString = myPropInfo.GetValue(_objClass, null) + "NewValue";
myPropInfo.SetValue(_objClass, setValueString, new object[0]);
}
}
{
private string _myProperty;
public string MyProperty
{
get
{
MyProperty = "Hello"; return MyProperty;
}
}
}
class ReadPropertyGeneric
{
Type myType;
T _objClass;
public void ReadAndSetProperty(T objClass)
{
myType = (typeof(T));
_objClass = objClass;
// Get the public properties.
PropertyInfo[] myPropertyInfo = myType.GetProperties(BindingFlags.Public BindingFlags.Instance);
Console.WriteLine("The mumber of public properties is {0}.", myPropertyInfo.Length);
// Display the public properties.
DisplayPropertyInfo(myPropertyInfo);
}
public void DisplayPropertyInfo(PropertyInfo[] myPropertyInfo)
{
// Display information for all properties.
for (int i = 0; i < myPropertyInfo.Length; i++)
{
PropertyInfo myPropInfo = (PropertyInfo)myPropertyInfo[i];
Console.WriteLine("The property name is {0}.", myPropInfo.Name);
Console.WriteLine("The property type is {0}.", myPropInfo.PropertyType);
Console.WriteLine("The property value is {0}.", myPropInfo.GetValue(_objClass, null));
object setValueString = myPropInfo.GetValue(_objClass, null) + "NewValue";
myPropInfo.SetValue(_objClass, setValueString, new object[0]);
}
}
Tuesday, January 20, 2009
SharePoint: Redirect Web Part to another Page
If you want to redirect from the Document Library's AllItems.aspx page to another page on "OnLoad Event", Create a Re direct Web Part which would re-direct to the desired page and add it to AllItems.aspx page
Monday, December 15, 2008
SharePoint: Adding Sub sites to the Top Navigation using SharePoint Object Model
Issue:
Add site S1 (http://localhost:30000/S1 ) to the sharepoint (http://localhost:30000), it appears in the top navigation, now add another site S2 (http://localhost:30000/S2 ) to the sharepoint, click on S1, S2 is not visible in the top navigation
Resolution:
// objSubWeb is the object of the SPWeb pointing to the sub site
objSubWeb.Navigation.UseShare = true;
Thursday, December 11, 2008
SharePoint: Resolving Web Parts Appearing as ErrorWebPart while enumerating them
Issue:
ErrorWebPart
"File not found"
Description:
After working on this issue for about One month, I found a wonderful Post by Sandeep SharePoint: All Webparts appear as ErrorWebParts when using SPLimitedWebPartManager.
Resolution:
So here is what is required to be done
1. Provide Context (see Sandeep Blog)
even if this doesn't work then
2. Make sure you custom webpart library (.dll) is either GAC'ed or you add it as reference to the application from which you are trying to read the web parts (note: if you are adding reference make sure it is the latest one).
Happy programming!
ErrorWebPart
"File not found"
Description:
After working on this issue for about One month, I found a wonderful Post by Sandeep SharePoint: All Webparts appear as ErrorWebParts when using SPLimitedWebPartManager.
Resolution:
So here is what is required to be done
1. Provide Context (see Sandeep Blog)
even if this doesn't work then
2. Make sure you custom webpart library (.dll) is either GAC'ed or you add it as reference to the application from which you are trying to read the web parts (note: if you are adding reference make sure it is the latest one).
Happy programming!
Subscribe to:
Comments (Atom)
