Friday, July 18, 2008

Cancel Button in MOSS ASPX , ASCX forms

Hi All,

One time i came across to a very good thing that we can have default cancel button that with without writing a code you can redirect to any source. (if not provided, default source)

This button is functional. By functional means it will handle redirection automatically.

Let's say, you would like to have a button Cancel (Sharepoint standard) and want that button to behave in same fashion as standard sharepoint cancel button does, then go for the below code :

<wssuc:ButtonSection runat="server">
<asp:PlaceHolder ID="PlaceHolder1" runat="server">

No code on cancel button. it redirects automatically to source.

That's it. your job is done.


Anonymous said...

Hi Vijaya,

Where do i write the code part specified,

You are saying to edit it in Sharepoint Designer,

Waiting for your response.

Malay Vasavada said...


You need to place this code in ASPX Or ASCX files of your page or webpart

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to