Do you face any problem to the top navigation link where you have added a custom link but end up it return you node and however you click and it gonna redirect you back to your root site… irony?
Please check if you are using this format? This is no problem when you are in SP2007, but SP2010 you will understand what i mean.
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
Orientation="Horizontal"
StaticDisplayLevels="2"
StaticSelectedStyle-CssClass="xxxx"
MaximumDynamicDisplayLevels="1"
SkipLinkText=""
StaticEnableDefaultPopOutImage="False"
CssClass="atq-topnav">
<DynamicMenuStyle CssClass="xxx" />
<DynamicMenuItemStyle CssClass="xxx" />
<DynamicHoverStyle CssClass="xxx"/>
<StaticItemTemplate>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:HyperLink runat="Server" ID="LinkMenuItem" NavigateUrl='<%# Eval("DataPath")%>' Text='<%# Eval("Text")%>' /></td>
</tr>
</table>
</StaticItemTemplate>
</SharePoint:AspMenu>VS.
Change the syntax as follow and you will able to solve the “unreachable” link issue.
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
Orientation="Horizontal"
StaticDisplayLevels="2"
StaticSelectedStyle-CssClass="xxx"
MaximumDynamicDisplayLevels="1"
SkipLinkText=""
CssClass="s4-tn">
<StaticItemTemplate>
<table onclick="window.location=this.parentNode.href" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Label runat="server" id="a1" text='<%# Eval("Text")%>'></asp:Label>
</td>
</tr>
</table>
</StaticItemTemplate>
</SharePoint:AspMenu>
Search This Blog
Friday, December 17, 2010
[Troubleshooting] SharePoint 2010 MasterPage Custom Top Navigation Issue
[Tutorial] SharePoint DataView WebPart Recursive Item DataSource
Create a DataVIew WebPart page by following guide :
1. Go to the SharePoint Site using SharePoint Designer.
2. Create a ASPX page
a. File > New > ASPX > OK
3. Inherit the MasterPage
a. Format > MasterPage > Attach Master Page … > custom Masterpage > /_catalogs/masterpage/xxx.master
4. Create on the arrow on the maincontent placeholder > Create Custom Content
5. Add WebPart Zone
a. Insert > SharepointControl > WebpartZone
6. Add Data View Webpart
a. Insert > SharepointControl > DataView
7. Drag “ListName” List to the DataView WebPart
8. Do Styling and Filtering Accordingly.
b. These lists contain folder, in order achieve to see the file only, the scope need to be defined as Recursive. To do that, just click on the current Data Source: on the position top right, and then select Recursive from Item and folder scope. Please apply this for both history and history details page in this case.
c. For the first field please custom it as <a href="<DetailsPage>.aspx?ItemId={@ID}"><xsl:value-of select="@Title" /></a> in your code behind.
d. Set the filter to only Created by equal to [Current User].
9. Now repeat step 1 to step 8 to create history detail page, note that the layout and column display is different.
10. Add a parameter to the DataView Webpart.
11. Set Filter ID field equal to [ItemId]
12. Save it and test on it.
14. Happy Coding !
Tuesday, October 12, 2010
[Tip] Sometime is hard to say i’m sorry SharePoint 2010
Have you ever face any problem when trying out with no bugs for your SP 2010 master page top navigation? impossible right? The followings are some knowledge sharing from me, hope it helps you…Sp2010 is damn “good”~!
It’s auto generated width:3px td in table for each single menu item.
It’s auto generate margin-left: 16px for each single menu item.
Solution :
Look for the AspMenu and add few attributes to the control so that it won’t render the extra pixel on our design…
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="false" …
StaticSelectedStyle-ItemSpacing="0px"
StaticMenuItemStyle-ItemSpacing="0px"
StaticSubMenuIndent = "0px"
After that, you should get something like this screen
Thursday, August 26, 2010
[Tutorial] Hide "Site Actions" for the anonymous users (SPSecurityTrimmedControl)
It uses to hide the SiteActions button based on the permission set. I tried it with hide html table for that control, it’s work to me ! So no problem SiteAction is inside a styled table.
<SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb" >
……………
</SharePoint:SPSecurityTrimmedControl>
List Permissions
ManageLists
CancelCheckout
AddListItems
EditListItems
DeleteListItems
ViewListItems
ApproveItems
OpenItems
ViewVersions
DeleteVersions
CreateAlerts
ViewFormPages
Site Permissions
ManagePermissions
ViewUsageData
ManageSubwebs
ManageWeb
AddAndCustomizePages
ApplyThemeAndBorder
ApplyStyleSheets
CreateGroups
BrowseDirectories
CreateSSCSite
ViewPages
EnumeratePermissions
BrowseUserInfo
ManageAlerts
UseRemoteAPIs
UseClientIntegration
Open
EditMyUserInfo
Personal Permisions
ManagePersonalViews
AddDelPrivateWebParts
UpdatePersonalWebParts
reference : Hide "Site Actions" for the anonymous users (The easy way)
Thursday, July 22, 2010
[Tutorial] Enable Server Side Code in SharePoint Page Layout using SP Designer
If you use the Microsoft Office SharePoint Designer to add a new page to your site, you will see that it looks just like any other ASP.NET page. Open up your site with the SharePoint Designer, and then go to the Pages folder. Right-click the Pages folder and choose New / ASPX. That will generate a new ASP.NET page with the following default template:
1. Add following code-block to Web.Config, it should be locate in C:\Inetpub\wwwroot\wss\VirtualDirectories\<site>\Web.Config
<PageParserPaths>
<PageParserPath VirtualPath="/pages/test.aspx" CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>
2. Open the page layout that you going to add in server side code by using SharePoint designer. It does how you do scripting like other way… and put your coding such as c# into it. like following :
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(“Hello World !”);
}
</script>
3. Done. Happy Coding. ;-)
Wednesday, May 12, 2010
[Tip] SharePoint Unknown Error
i have been told about this on how to work out this error…Here again just a reminder to myself
- Locate this file … c:\inetpub\wwwroot\wss\virtualdirectories\<mysitename>\web.config
- Search for “CallStack” and toggle that element to “true”. Then, do a search for “customErrors” and toggle that element to “off”.
- Save the web.config file.
Friday, April 2, 2010
[Tutorial] Check Operation System Base Type (32bit / 64bit)
Method
- Click Start, then click on Run or Start Search.
- Type msinfo32.exe and then press Enter key.
- In “System Information”, review the value for the System Type item:
- For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
- For 64-bit editions of Windows, the value of the System Type item is x64-based PC.
reference : http://forums.techarena.in/tips-tweaks/962178.htm
Friday, March 19, 2010
[Tutorial] How to set Target Audience for control in Programmatically
Just research around and i have found an easy way to set target audience for my control…for example: target to an button so that only the user group of people able to see the button.
That’s the simplest that i found…do u have any other suggestion to achieve? please share it out,thank you.
reference : social.msdn.microsoft.com
Thursday, February 25, 2010
[Tip] Enable Hibernate in Windows Server 2008 with hyper-v enabled
I do believe that a lot user might wonder why there isn’t hibernate feature in your Windows Server 2008 machine…Anyway a new version of Windows Server 2008 R2 has make re-enable it back to user so that they can continue enjoying the freedom of power off cache memory..hehe...For those user who still user the previous version before R2, here are some tips / tricks which help you manually disable & enable your hyper-v so that hibernate can alive in such condition…
1st : run > regedit > HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > hvboot >
2nd : set the “Start” value to 3 instead of 1
3rd : Restart your PC
4rd : command prompt > powercfg.exe /hibernate on
*please ensure that your hard disk has sufficient memory to perform hibernation.
5rd : Control Panel > Power Options > set the way you want hibernate started.
Now, when start your laptop you can have full access to the power management functionality. Now note that your hyper-v is not able be activated at this moment because it has been disabled. To enable it back …
command prompt > net start hvboot
Power management is then disabled again until the next reboot. ;-)
Friday, January 8, 2010
[Tutorial] How to Make GAC Assembly a Copy
Open “Run” and type in “cmd” to open Command Prompt windows. After that, follow the following syntax to make copy your GAC Assembly (.dll).
Syntax
copy C:\windows\assembly\GAC_MSIL\AssemblyName\Version__PublickKeyToken\AssemblyName.dll TargetLocation
Example
copy C:\windows\assembly\GAC_MSIL\system.directoryservices.accountmanagement\3.5.0.0__b77a5c561934e089\system.directoryservices.accountmanagement.dll c:\
Credit goes to Richard Yu
Tuesday, January 5, 2010
[Troubleshooting] Error : The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)
Error:
While creating a new Web Application you got following error
The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)
or
When you try accessing IIS, it tells me that’s it’s not connected to any computer and prompts me to connect. When you type in the computer name it tells me that “The path specified cannot be used at this time.”
Solution:
1. Try IIS Reset.
2. Re-Start Windows SharePoint Services Timer
3. Re-Start Windows SharePoint Services Administration
The error should be solved until Step 3. otherwise do the final step - 4
4. Restart Server