To access the mobile view of our SharePoint sites, we just need to do the following,
just append to the url _layouts/mobile
from
to
http://servername:port/_layouts/mobile
That’s it..
To access the mobile view of our SharePoint sites, we just need to do the following,
just append to the url _layouts/mobile
from
to
http://servername:port/_layouts/mobile
That’s it..
To user hyperlink in WPF application we could do something like this
<TextBlock>
<Hyperlink NavigateUri=”http://www.google.co.in”>
Click here
</Hyperlink>
</TextBlock>
However the NavigateUri works only if we are placing the hyperlink within a page. To use it within a windows-based application we need to hanlde the RequestNavigate event and write the code ourselves.
Something like this
<TextBlock>
<Hyperlink NavigateUri=”http://www.google.co.in” RequestNavigate=”Hyperlink_RequestNavigate”>
Click here
</Hyperlink>
</TextBlock>
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
While using hyperlink we could also provide handler for Application.NavigationFailed event in case if navigation fails.
That’s it ….
Suppose we want to create a custom config section in this following manner
<queryTypes>
<queryType name=“qt1“ value=“qt1 value“></queryType>
<queryType name=“qt2“ value=“qt2 value“></queryType>
</queryTypes>
For implementing the above custom section we need to first define a class inheriting from ConfigurationSection class
Add reference to System.Configuration dll.
Create a new config section class in the following manner
// implement ConfiguraionSection class
class QueryTypesSection : ConfigurationSection
{
public QueryTypesSection()
{
}
[ConfigurationProperty(“”, IsDefaultCollection = true)]
public QueryTypesCollection QueryTypes
{
get
{
return (QueryTypesCollection)base[“”];
}
}
}
// Represents a configuration element containing a collection of child elements
public sealed class QueryTypesCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
return new QueryTypeElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((QueryTypeElement)element).Name;
}
public override ConfigurationElementCollectionType CollectionType
{
get
{
return ConfigurationElementCollectionType.BasicMap;
}
}
protected override string ElementName
{
get
{
return “queryType”;
}
}
}
// Defining QueryTypeElement with name and value attribute
public sealed class QueryTypeElement : ConfigurationElement
{
// defining name attribute
[ConfigurationProperty(“name”, IsRequired = true)]
public string Name
{
get
{
return (string)this [“name”];
}
set
{
this[“name”] = value;
}
}
// defining value attribute
[ConfigurationProperty(“value”, IsRequired = true)]
public string Value
{
get
{
return (string)this[“value”];
}
set
{
this[“value”] = value;
}
}
}
Now to register your custom section do the following
<configSections>
<section name=“queryTypes“ type=“namespace.QueryTypesSection, namespace “ />
</configSections>
And to use it within the application
QueryTypesSection queryTypeSection = (QueryTypesSection)ConfigurationManager.GetSection(“queryTypes”);
QueryTypesCollection queryTypeCollection = queryTypeSection.QueryTypes;
foreach (QueryTypeElement se in queryTypeCollection)
{
string name=se.Name;
string value = se.Value;
}
That’s it…
At times instead of using appSettings section we would like to define our own custom section within configuration file.
Suppose we want to create a custom config section in this following manner
<SimplConfigSection id=“myID“ name=“myName“ />
For implementing the above custom section we need to first define a class inheriting from ConfigurationSection class
Add reference to System.Configuration dll.
Create a new config section class in the following manner
// inherit the class ConfigurationSection
class SimpleConfigSection : ConfigurationSection
{
public SimpleConfigSection()
{
}
// using ConfigurationProperty attribute to define the attribute
[ConfigurationProperty(“id”,IsRequired = true)]
public String ID
{
get
{ return (String)this[“id”]; }
set
{ this[“id”] = value; }
}
// using ConfigurationProperty attribute to define the attribute
[ConfigurationProperty(“name”, IsRequired = true)]
public String Name
{
get
{ return (String)this[“name”]; }
set
{ this[“name”] = value; }
}
}
Now to register your custom section do the following
<configSections>
<section name=“SimplConfigSection“ type=“Namespace.SimpleConfigSection, Namespace“ />
</configSections>
And to use it within the application
SimpleConfigSection simpleConfig = (SimpleConfigSection)ConfigurationManager.GetSection(“SimplConfigSection”);
string id = simpleConfig.ID;
string name = simpleConfig.Name;
That’s it …
There are two ways of logging off from an active session within CRM On Demand
// pass the url in that case no need to set the header
// only set sessionid
string logoffUrlString = “servername/Services/Integration;jsessionid=” + SessionID + “?command=logoff”;
HttpWebRequest req = HttpWebRequest)WebRequest.Create(logoffUrlString);
// make the HTTP call
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Or else
string logoffUrlString = “servername/Services/Integration?command=logoff”;
HttpWebRequest req = HttpWebRequest)WebRequest.Create(logoffUrlString);
// set the session id in header
req.Headers[“JSESSIONID”] = SessionID;
// make the HTTP call
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Within Web Services Utilization List of Admin Tab in the CRM On Demand application we can see the login and logout info.
That’s it ..
Normally within SharePoint if an error occurs we would be receiving quite an unhelpful error message i.e. “An unexpected error has occurred”. It is because by default the detailed error messages are turned off for security reasons.
Here are the steps for getting the full error messages
1) Go to the MOSS site for which you would like to enable it.
Most likely to be found at c:inetpubwwwrootwssVirtualDirectories and a sub directory with your web application’s port number.
2) Locate and open the web.config file for editing.
3) Find out the following entry
<SafeMode MaxControls=“200“ CallStack=“false“ DirectFileDependencies=“10“ TotalFileDependencies=“50“ AllowPageLevelTrace=“false“>
And make following changes to it
<SafeMode MaxControls=“200“ CallStack=“true“ DirectFileDependencies=“10“ TotalFileDependencies=“50“ AllowPageLevelTrace=“true“>
4) And
<customErrors mode=“On“ />
To
<customErrors mode=“Off“ />
5) Save and close web.config.
That’s it …