SharePoint 2010: Create Alert Me Button

I hope this is not easy ...

I need to create a Notify Me button on my custom SharePoint home page, which when clicked will redirect the user to the pre-populated New Signal page for this particular site / list. The OOTB blog site template already has this same button at the bottom of the default.aspx page, its layout is as follows:

http://server/currentsite/_layouts/SubNew.aspx?List={00000000-0000-0000-0000-000000000000}&Source=http://server/currentsite/default.aspx 

Does anyone know if there is an OOTB control or a web part that I can just insert into my page layout to reproduce this?

Obviously, I could create the button dynamically in the encoding of the page layout, if necessary, but I would be surprised if there was no previously written control.

Thanks in advance...

+4
source share
1 answer

For those who failed, I ended my own usercontrol for this. The code is as follows:

HTML


 <asp:HyperLink ID="AlertHyperLink" runat="server"><img alt="Alert me" src="/_layouts/images/menualert.gif" title="Alert me to any changes that get made to this site." /></asp:HyperLink> 

WITH#


 protected void Page_PreRender(object sender, EventArgs e) { // If the current page is not associated with a list, then hide the list-sensitive tools. if (SPContext.Current.List != null) { this.AlertHyperLink.NavigateUrl = string.Format( "{0}/_layouts/SubNew.aspx?List={{{1}}}&Source={2}", SPContext.Current.Web.Url, SPContext.Current.List.ID.ToString(), this.Server.UrlEncode(this.Page.Request.Url.ToString())); } else { this.AlertHyperLink.Visible = false; } } 
+4
source

Source: https://habr.com/ru/post/1341166/


All Articles