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">
<Template_Buttons>
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
</asp:PlaceHolder>
</Template_Buttons>
</wssuc:ButtonSection>
No code on cancel button. it redirects automatically to source.
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="/_controltemplates/ButtonSection.ascx" %>
There are also a number of attributes you can set on the ButtonSection control:
That's it. your job is done.
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">
<Template_Buttons>
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
</asp:PlaceHolder>
</Template_Buttons>
</wssuc:ButtonSection>
No code on cancel button. it redirects automatically to source.
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="/_controltemplates/ButtonSection.ascx" %>
There are also a number of attributes you can set on the ButtonSection control:
- ShowStandardCancelButton: if you set this property to true, a Cancel button is automatically added to the ButtonSection control. This cancel button will redirect the user to the previous page in the browser history.
ShowSectionLine: set this property to false if you don’t want a section line to be added above the buttons. The default value is true. - BottomSpacing: in case of long pages it is possible you want to add a button section at the top of the page and one at the bottom of the page. If you put a button section at the top of the page, you can set this property to a value higher than zero to add extra blank spacing between the button section and the controls that follow.
- SmallSectionLine: if you set this boolean value to true, the section line will be 1px high; if set to false, the section line will be 2px high. The default is false.
That's it. your job is done.
Comments
Post a Comment