Click here to Skip to main content

Hannes Foulds - Professional Profile

Summary

2,954
Author
50
Authority
23
Debator
1
Enquirer
8
Organiser
225
Participant
0
Editor
Member since Thursday, May 6, 2004 (9 years)

Contributions

Articles 3 (Writer)
Tech Blogs 0
Messages 29 (Lurker)
Q&A Questions 0
Q&A Answers 0
Tips/Tricks 0
Comments 0

Links

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an Articlesilversilversilversilver
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
You must Sign In to use this message board.
Search this forum  
GeneralSharePoint Tool Pane Pin
Thursday, November 13, 2008 1:04 AM by Hannes Foulds
Hi, ive had the same problem as you. I was trying to add the floating div pane to a minimal master page. But it didn't work.
Thats because you need to have the div that tells sharepoint where to place the ToolPane, without it sharepoint will just place it where it wants to.
 
Here is the div that will hold the ToolPane on your page:
 
<!-- This Div tells sharepoint where to place the ToolPane -->
<div id="MSO_ContentDiv" runat="server">

<!-- /ToolPane div -->
 
But now that i got the ToolPane floating, none of the Ok/Cancel/Apply buttons work.
Let me now if they work for you.
 

 
GeneralASP.NET and showModalDialog Pin
Wednesday, June 13, 2007 10:33 PM by Foulds.NET
You know how pesky it is when you have an ASP.NET page opened with window.showModalDialog or window.showModelessDialog and when you click on a postback button yet another page is opened?
 
The solution is simple, just stick the following in the head section of the page: <head runat="server" />

 

GeneralRe: ASP.NET and showModalDialog PinmemberHannes Foulds7 Aug '07 - 8:03 
 
GeneralSharePoint 2003 Ghosted pages Pin
Tuesday, August 22, 2006 8:50 PM by Foulds.NET
When you edit a SharePoint page with FrontPage the page will no longer be rendered from the file stored on disk, but instread a ghosted page will be stored in the database.
 
If you want to get rid of the ghost give ReGhost.NET[^] a try.
 
GeneralXML Serialization &amp; Deserialization Pin
Monday, August 14, 2006 1:25 AM by Foulds.NET
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
 
namespace Alexandria.Forums.Web.Navigation 
{
	/// <author>Hannes Foulds</author>
	/// <date>14 August 2006</date>
	/// <summary>
	/// The site map page object.
	/// </summary>
	[System.Xml.Serialization.XmlRootAttribute(ElementName="page", IsNullable=false)]
	public class Page 
	{
		#region Declarations
		private Page _parent;	// the parent page
		#endregion
 
		#region Properties
		/// <summary>
		/// The parent page.
		/// </summary>
		public Page Parent
		{
			get { return this._parent; }
			set { this._parent = value; }
		}
		#endregion
 
		#region Schema Properties
		/// <remarks/>
		[System.Xml.Serialization.XmlElementAttribute("page")]
		public Page[] Items;
        
		/// <remarks/>
		[System.Xml.Serialization.XmlAttributeAttribute(AttributeName="url", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
		public string Url;
        
		/// <remarks/>
		[System.Xml.Serialization.XmlAttributeAttribute(AttributeName="text", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
		public string Text;
        
		/// <remarks/>
		[System.Xml.Serialization.XmlAttributeAttribute(AttributeName="key", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
		public string Key;
        
		/// <remarks/>
		[System.Xml.Serialization.XmlAttributeAttribute(AttributeName="businessObject", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
		public string BusinessObject;
        
		/// <remarks/>
		[System.Xml.Serialization.XmlAttributeAttribute(AttributeName="businessKey", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
		public string BusinessKey;
        
		/// <remarks/>
		[System.Xml.Serialization.XmlAttributeAttribute(AttributeName="textKey", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
		public string TextKey;
		#endregion
	}
    
	/// <author>Hannes Foulds</author>
	/// <date>14 August 2006</date>
	/// <summary>
	/// The site map object for bread crumb navigation.
	/// </summary>
	[System.Xml.Serialization.XmlRootAttribute(ElementName="sitemap", IsNullable=false)]
	public class SiteMap 
	{
		/// <remarks/>
		[System.Xml.Serialization.XmlElementAttribute("page")]
		public Page[] Items;
 
		#region Serialize
		/// <summary>
		/// Serialize the object to a xml string.
		/// </summary>
		public string Serialize()
		{
			XmlSerializer serializer = new XmlSerializer(this.GetType());
			MemoryStream memoryStream = new MemoryStream();
			XmlTextWriter writer = new XmlTextWriter(memoryStream, Encoding.UTF8);
			writer.Formatting = Formatting.None;
			serializer.Serialize(writer, this);
 
			StreamReader reader = new StreamReader(memoryStream);
			memoryStream.Position = 0;
			string result = reader.ReadToEnd();
			writer.Close();
 
			return result;
		}
		#endregion
 
		#region Deserialize
		/// <summary>
		/// Deserialize the schema object from the XML string provided.
		/// </summary>
		/// <param name="xmlString">A string containing the XML for the schema object.</param>
		/// <returns>Returns the deserialized schema object.</returns>
		public static SiteMap Deserialize(string xmlString)
		{
			XmlSerializer serializer = new XmlSerializer(typeof(SiteMap));
			StringReader reader = new StringReader(xmlString);
			SiteMap siteMap = serializer.Deserialize(reader) as SiteMap;
			siteMap.SetParents(null, siteMap.Items);
 
			return siteMap;
		}
		#endregion
 
		#region Set Parents
		/// <summary>
		/// Recursively set the parent of page items.
		/// </summary>
		/// <param name="current">The parent page.</param>
		/// <param name="items">A collection of page items.</param>
		private void SetParents(Page current, Page[] items)
		{
			if (items != null)
			{
				foreach(Page page in items)
				{
					page.Parent = current;
					this.SetParents(page, page.Items);
				}
			}
		}
		#endregion
	}
}

 
GeneralSharePoint 2003 Dynamic Web Part Page Title Pin
Wednesday, August 9, 2006 11:59 PM by Foulds.NET
Ever wondered how to change the title displayed on a SharePoint page dynamically from a web part?
 
Stick the following in your web part:
 
#region Set Page Title
/// <summary>
/// Set the title of the page.
/// </summary>
/// <param name="pageTitle">The new title for the page.</param>
public void SetPageTitle(string pageTitle)
{
	TitleBarWebPart titleBar = this.FindTitleBar(this.Page);
	titleBar.HeaderTitle = pageTitle;
}
#endregion
 
#region Find Title Bar
/// <summary>
/// Find the title bar control of the page.
/// </summary>
/// <param name="control">The control to start the search at.</param>
/// <returns>Returns the first TitleBarWebPart control found.</returns>
private TitleBarWebPart FindTitleBar(Control control)
{
	TitleBarWebPart result = null;
	int counter = 0;
 
	while ( (counter < control.Controls.Count) && (result == null) )
	{
		Control currentControl = control.Controls[counter];
		if (currentControl.GetType() == typeof(Microsoft.SharePoint.WebPartPages.TitleBarWebPart))
		{
			return currentControl as TitleBarWebPart;
		}
 
		result = FindTitleBar(currentControl);
		counter++;
	}
	return result;
}
#endregion
 
Then call SetPageTitle from CreateChildControls
 
GeneralDecompile CHM Pin
Friday, July 28, 2006 1:20 AM by Foulds.NET
If you ever want to decompile a .CMH file to get the .HHP project file give Keytools[^] a try, it's free.
 
GeneralSQL Server 2000: Full-Text Indexing Pin
Thursday, July 13, 2006 12:32 AM by Foulds.NET
Today I have to work on full-text indexing to do a bit of searching, I found this usefull little Article[^] that shows you how to create the index with scripts.
 
Here is what I came up with:
 
-- create the full text index
sp_fulltext_database 'enable'
go
 
sp_fulltext_catalog 'search', 'create'
go
 
-- create index for the question table
sp_fulltext_table 'Question', 'create', 'search', 'PK_Question' 
go
 
sp_fulltext_column 'Question', 'Title', 'add'
go
 
sp_fulltext_column 'Question', 'Question', 'add'
go
 
sp_fulltext_table 'Question', 'activate'
go
 
-- perform a full index
sp_fulltext_catalog 'search', 'start_full'
go
 
This is my attempt to also script the scheduled full index:
 
use master
 
exec msdb..sp_delete_job @job_name = 'Start_Full on Alexandria.Search.'
 
declare @id BINARY(16)  
exec msdb..sp_add_job 	@job_name = 'Start_Full on Alexandria.Search.', 
			@description = 'Scheduled full-text full population for 
                                        full-text Catalog Search in database Alexandria. 
                                        This job was created by the full-text scheduling dialog or 
                                        full-text index wizard..',
			@enabled = 1, 
			@start_step_id = 1, 
			@notify_level_eventlog = 2, 
			@notify_level_email = 0, 
			@notify_level_netsend = 0, 
			@notify_level_page = 0, 
			@delete_level = 0, 
			@category_name = 'Full-Text', 
			@job_id = @id OUTPUT  select @id
 

exec msdb..sp_add_jobstep	@job_id = @id,
				@step_id = 1, 
				@cmdexec_success_code = 0, 
				@on_success_action = 1, 
				@on_success_step_id = 0, 
				@on_fail_action = 2, 
				@on_fail_step_id = 0, 
				@retry_attempts = 0, 
				@retry_interval = 0, 
				@os_run_priority = 0, 
				@flags = 0, 
				@step_name = 'Full-Text Indexing', 
				@subsystem = 'TSQL', 
				@command = 'use [Alexandria] exec sp_fulltext_catalog ''Search'', ''start_full''', 
				@database_name = 'master'
 
exec msdb..sp_add_jobserver	@job_id = @id, 
				@server_name = '(local)'
 
exec msdb..sp_add_jobschedule 	@job_id = @id, 
				@name = 'complete', 
				@enabled = 1, 
				@freq_type = 4, 
				@freq_interval = 1, 
				@freq_subday_type = 1, 
				@freq_subday_interval = 0, 
				@freq_relative_interval = 0, 
				@freq_recurrence_factor = 1, 
				@active_start_date = 20060713, 
				@active_end_date = 99991231, 
				@active_start_time = 120000, 
				@active_end_time = 235959
 
exec msdb.dbo.sp_update_job	@job_id = @id, 
				@automatic_post = 0 , 
				@owner_login_name = 'sa'
 
exec msdb..sp_help_job @job_id = @id, @job_aspect = N'job'
exec msdb..sp_help_jobstep @job_id = @id
exec msdb..sp_help_jobschedule @job_id = @id

 
GeneralAbsolute Path Pin
Tuesday, July 11, 2006 9:30 PM by Foulds.NET
When you compose emails for example you want your paths to be absolute, not relative, this little helper function will convert a relative path to an absolute path:
 
#region Get Absolute Path
/// <summary>
/// Convert a relative path to an absolute path.
/// </summary>
/// <param name="relativePath">The path that should be converted,</param>
/// <returns>Returns the absolute path.</returns>
public static string GetAbsolutePath(string relativePath)
{
	Uri baseUrl = HttpContext.Current.Request.Url; 
	Uri absoluteUri = new Uri(baseUrl, relativePath); 
 
	return absoluteUri.ToString(); 
}
#endregion

 
GeneralHello World Pin
Tuesday, July 11, 2006 9:24 PM by Foulds.NET
Today I have decided that it is time for my blog. In here I will write what I've been up to and post some usefull code samples.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 25 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid