using System; using System.ComponentModel; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; namespace MyWebpart { [ToolboxItemAttribute(false)] public class ConsentsApprover : WebPart { protected override void CreateChildControls() { Controls.Add(new Literal() { Text = @"<script type=""text/javascript"">location='your_redirect_url';</script>" }); } } }