TreeView Checkbox Click on PostBack
Friday, May 7, 2010
The TreeView control admitted in ASP.Net 2.0 is lacking an option to cause a postback due to a user checking/unchecking a checkbox on a tree node.
It would of course be useful to add a bit more code so that the resulting event could specify which node was changed, etc. But as of now you can just look at the "checkednodes" property of the tree.
- using System;
- using System.Text;
- using System.Data;
- using ASP = System.Web.UI.WebControls;
- using System.Web.UI;
- using System.IO;
- namespace myNameSpace
- {
- class VerboseTreeView : ASP.TreeView, IPostBackEventHandler
- {
- public event EventHandler CheckClick;
- protected override void Render(HtmlTextWriter writer)
- {
- StringBuilder builder = new StringBuilder();
- using(StringWriter stringWriter = new StringWriter(builder))
- {
- HtmlTextWriter tempWriter = new HtmlTextWriter(stringWriter);
- base.Render(tempWriter);
- }
- string find = "<input type=\"checkbox\" ";
- string replace = "<input type=\"checkbox\\cf2 " onClick=\"" + getPostBack() + "\\cf2 " ";
- writer.Write(builder.ToString().Replace(find, replace));
- }
- protected string getPostBack()
- {
- return this.Page.GetPostBackEventReference(this, "@CheckPostBack");
- }
- protected virtual void OnCheckClick(EventArgs e)
- {
- if (CheckClick != null) CheckClick(this, e);
- }
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- OnCheckClick(new EventArgs());
- }
- }
- }
- Be the first to rate this post
- * Currently 0/5 Stars.
- * 1
- * 2
- * 3
- * 4
- * 5
- ShareThis
- Tags:
- }
Determining the Current User Context inside Sharepoint
Tuesday, May 4, 2010
What is the best way to determine the current user on a custom developed Web Part for MOSS 2007? I found four solutions so far, but I'm pretty sure there's more:
- Use System.Web.HttpContext.Current.User.Identity.Name, like in any ASP.Net web application
- Use System.Security.Principal.WindowsIdentity.GetCurrent().Name
- Have the Current User Filter send the current user to your web part, and (of course) make your web part a consumer of that value.
- SPWeb web = SPControl.GetContextWeb(Context); SPUser currentUser = web.CurrentUser;
Safe mode processing and Safe Controls
Friday, April 30, 2010
Any custom page is analyzed using the safe mode processing. This analysis puts security. processing in safe mode ensures that there is no script online personalized page. In other words insurance does not allow on-line processing mode script because a hacker attack can be mounted on the command line. If you try to run scripts online personalized page.
will get error ‘Code blocks are not allowed in this file’.
In case you still want to run in-line script in customized pages you need to specify ‘AllowServerSideScript=true’ in the ‘SafeMode’ tag section in web.config file.
<SharePoint>
<SafeMode ... >
<PageParserPaths>
<PageParserPath
VirtualPath="/sites/MySite/SitePages/*"
IncludeSubFolders="true"
CompilationMode="Always"
AllowServerSideScript="true" />
</PageParserPaths>
</SafeMode>
</SharePoint>
Insurance will help us determine the controls that will control customized pages. pages as controls can only be defined in the web.config file on the 'SafeControls. For example, in the following snippet of code that have defined custom pages can use the controls' Microsoft.SharePoint.WebControls.
<SafeControls>
<SafeControl
Assembly="Microsoft.SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
TypeName="*"
AllowRemoteDesigner="True" />
</SafeControls>
Concept of virtual path provider?
Friday, April 23, 2010
Any project has three parts three is the standard and common part and the other is the customized version. In ASP.NET they have three types of pages for any project three is common ASPX pages and the other is customized ASPX pages. Common pages are stored on file directories while customized versions of pages are stored in content database.
So in other words, we need an abstract mechanism by which we can make the content pages of SQL Server database and virtual directories. This is accomplished through virtual provider provided by SharePoint. So for every page reads custom virtual provider of database content and the same thing happens with the ASP.NET runtime. Common for all pages goes to the directory, parses it and passes it in the ASP.NET runtime.
virtual provider is an abstraction that loads the page from the bottom or the file system depending on whether or common custom pages and so with the ASP.NET runtime.
Installing the SharePoint Services
Saturday, April 17, 2010
Although SharePoint Services are designed to be easy to use, it is a bit of a task of installing and fixing the initial server configuration. Fortunately, this is a work at once. To begin, you must first download the Microsoft SharePoint Services. You can get http://www.microsoft.com/windowsserver2003/technologies/sharepoint/default.mspx SharePoint Services download is a 34 MB self extracting, executable file.
To install SharePoint Services, download the file STSV2.EXE to an empty folder and double click it. This will cause Windows to decompress the contents of the file and start the setup program. When the installation wizard starts, accept the license agreement and click Next to continue. The next screen prompts you to perform a typical installation or if you prefer to create a server farm. For demonstration purposes, select the Typical installation option and click Next. Setup will now confirm that you are about to install the SharePoint Services and the destination drive has enough free space. Click the Install button to begin installing the necessary files
As the installation progresses, you might notice a message indicating that Setup is the configuration of Microsoft SQL Desktop Engine. Windows SharePoint Services rely on SQL Server. As we all know, however, SQL Server can be expensive. To help make the services of SharePoint (and other applications) more affordable, Microsoft has included a watered down version of SQL Server in Windows Server 2003. It is called Microsoft SQL Desktop Engine or MSDE. If no SQL Server installed on the server before you install Windows SharePoint Services, the installation program automatically configures SharePoint Services to use MSDE. Although it works well enough MSDE, SQL Server provides much better performance in environments where more than five people will be using the Windows SharePoint Services at the same time.
Editing and Customizing Windows SharePoint Services Sites, versions 2.0 or prior
Saturday, April 10, 2010
Microsoft Office FrontPage 2003 is a web editor that is fully integrated with Windows SharePoint Services 2.0. FrontPage 2003 offers a variety of WYSIWYG tools you can use to customize and manage SharePoint sites, including a device improved table editing and a collection of dynamic templates for SharePoint sites. With FrontPage 2003, you can modify and control the components of SharePoint site (for example, team sites, Web Parts, or navigation) and customize the look and feel of a SharePoint site. You can also use FrontPage 2003 to prepare reports analyzing the use of SharePoint sites, so you can control who is using your site and how they are using. To edit Web pages in a SharePoint site, you must be a member of a site group with the Add and customize pages right on the SharePoint site.
With FrontPage 2003, you can use Windows SharePoint Services and Web Parts to create data-driven Web sites. Web Parts are reusable modular pieces of code that can easily be added to SharePoint sites. With some web development skills, you can use FrontPage 2003 to create Web Parts that connect to live data from a variety of sources. For example, to add the company's current sales data to your SharePoint site, you can use FrontPage 2003 to create a Web Part that is linked to your company's sales database.
Here are some key features of "Admin Report Kit for SharePoint 2003
Tuesday, March 30, 2010
Quick Reports: Provides several right out-of-the box reports based on SharePoint objects and its native hierarchy. Select a report, specify the URL and run the desired report. You can now export or print the report. It's that simple
Power Reports: A productivity tool for power administrators to generate reports about ever-changing information in SharePoint sites and lists. Requisite options to specify report criteria, entities to be reported, automatically export, print, and schedule the desired reports with minimum human intervention. You can now share the reports with the respective team members through e-mail or publish them to a SharePoint library
Custom Reports: Customize reports from the available built-in reports, select the properties you want to view and save them as report templates for repetitive use
Export Report: Flexible Export feature to export reports from ARKSP to MS-Access database / XML / HTML / Comma Separated Values (CSV) file format. Data exportable into MS-Access database for archival purposes or import into Microsoft Excel (from CSV) for further analysis
Publish Report: Publish reports to a document library and share the reports with the respective users
Preview and Print Report: Flexible print preview and print options to print the reports from ARKSP to any local/network printer
Filter data: Powerful Filter options to track and report only the desired information across different logical entities
Hierarchical View: Provides a coherent intuitive view of configuration information of Virtual Servers, Portal Sites, Site Collection, Webs, Portal Areas and Lists
Requirements:
- Processor: Intel Pentium processor
- Disk space & Memory: 512 MB RAM and minimum of 15 MB of free disk space
- oftware: Microsoft SharePoint Portal Server 2003 (or) Windows SharePoint Services v2.0 with latest Service Pack
- Microsoft Data Access Components (MDAC) v2.8 only
Limitations:
- 15 days trial period
- some features are disabled in the trial version
Website Updates
-
Software Testing : An Overview of Framework Engineering - [image: Software Testing : An Overview of Framework Engineering] Framework engineering is something which has been comprises of so many things in order t...2 months ago
-
Upload files to SharePoint Doc Library from ASP.NET - [image: Upload files to SharePoint Doc Library from ASP.NET] Here is the custom code to upload files to SharePoint doc library from ASP.NET. You could us...2 months ago
-
Calculate Maximum of two Int – Decimal - long Numbers in C# | Math.Max() - C# provide a math function to calculate max of two numbers, This function have overloaded functions for long, int, float, decimal, short etc. if you fac...6 months ago
-
Can we have Non Abstract Method in Abstract Class in C# - Yes, you can have non abstract methods in abstract class. Along with non abstract methods you can also have abstract methods in abstract class. You can ...7 months ago
-
How to Use CAML Query to get Data from SharePoint 2007 List - All I wanted was to get some information from a simple list of products in SharePoint 2007. The list was pretty simple with two colomns "Product" and "Co...1 year ago