protected void btnDeleteMessage_Click(object sender, EventArgs e) { int id = int.Parse(Request["Message"]); PageInfo page = Pages.FindPage(Request["Page"]); Log.LogEntry("Message deletion requested for " + page.FullName + "." + id.ToString(), EntryType.General, SessionFacade.GetCurrentUsername()); bool done = Pages.RemoveMessage(page, id, chkDeleteMessageReplies.Checked); UrlTools.Redirect(UrlTools.BuildUrl(Request["Page"], Settings.PageExtension + "?Discuss=1")); }
/// <summary> /// Verifies the need for a page redirection, and performs it when appropriate. /// </summary> private void VerifyAndPerformPageRedirection() { if (currentPage == null) { return; } // Force formatting so that the destination can be detected Content.GetFormattedPageContent(currentPage, true); PageInfo dest = Redirections.GetDestination(currentPage, out var fragment); if (dest == null) { return; } if (dest != null) { if (Request["NoRedirect"] != "1") { var fullUrl = dest.FullName + Settings.PageExtension + "?From=" + currentPage.FullName; if (!string.IsNullOrEmpty(fragment)) { fullUrl += "#" + fragment; } UrlTools.Redirect(fullUrl, false); } else { // Write redirection hint var sb = new StringBuilder(); sb.Append(@"<div id=""RedirectionDiv"">"); sb.Append(Properties.Messages.ThisPageRedirectsTo); sb.Append(": "); sb.Append(@"<a href="""); var fullUrl = UrlTools.BuildUrl("++", Tools.UrlEncode(dest.FullName), Settings.PageExtension, "?From=", Tools.UrlEncode(currentPage.FullName)); if (!string.IsNullOrEmpty(fragment)) { fullUrl += "#" + fragment; } sb.Append(fullUrl); sb.Append(@""">"); PageContent k = Content.GetPageContent(dest, true); sb.Append(FormattingPipeline.PrepareTitle(k.Title, false, FormattingContext.PageContent, currentPage)); sb.Append("</a></div>"); var literal = new Literal(); literal.Text = sb.ToString(); plhContent.Controls.Add(literal); } } }
protected void Page_Load(object sender, EventArgs e) { currentWiki = DetectWiki(); Page.Title = Properties.Messages.UserTitle + " - " + Settings.GetWikiTitle(currentWiki); currentUsername = Request["User"]; if (string.IsNullOrEmpty(currentUsername)) { currentUsername = Request["Username"]; } if (string.IsNullOrEmpty(currentUsername)) { UrlTools.Redirect("Default.aspx"); } if (currentUsername == "admin") { currentUser = Users.GetGlobalAdministratorAccount(); } else { currentUser = Users.FindUser(currentWiki, currentUsername); } if (currentUser == null) { UrlTools.Redirect("Default.aspx"); } if (!Page.IsPostBack) { lblTitle.Text = lblTitle.Text.Replace("##NAME##", Users.GetDisplayName(currentUser)); txtSubject.Text = Request["Subject"]; if (txtSubject.Text != "" && SessionFacade.LoginKey == null) { UrlTools.Redirect("Login.aspx?Redirect=" + Tools.UrlEncode(Tools.GetCurrentUrlFixed())); } } if (SessionFacade.LoginKey == null) { pnlMessage.Visible = false; } else { pnlMessage.Visible = true; } DisplayGravatar(); DisplayRecentActivity(); }
/// <summary> /// Sets the navigation paths label. /// </summary> private void SetupNavigationPaths() { string[] paths = NavigationPaths.PathsPerPage(currentPage); string currentPath = Request["NavPath"]; if (!string.IsNullOrEmpty(currentPath)) { currentPath = currentPath.ToLowerInvariant(); } if (!discussMode && !viewCodeMode && paths.Length > 0) { StringBuilder sb = new StringBuilder(500); sb.Append(Properties.Messages.Paths); sb.Append(": "); for (int i = 0; i < paths.Length; i++) { NavigationPath path = NavigationPaths.Find(paths[i]); if (path != null) { if (currentPath != null && paths[i].ToLowerInvariant().Equals(currentPath)) { sb.Append("<b>"); } sb.Append(@"<a href="""); sb.Append(UrlTools.BuildUrl("Default.aspx?Page=", Tools.UrlEncode(currentPage.FullName), "&NavPath=", Tools.UrlEncode(paths[i]))); sb.Append(@""" title="""); sb.Append(NameTools.GetLocalName(path.FullName)); sb.Append(@""">"); sb.Append(NameTools.GetLocalName(path.FullName)); sb.Append("</a>"); if (currentPath != null && paths[i].ToLowerInvariant().Equals(currentPath)) { sb.Append("</b>"); } if (i != paths.Length - 1) { sb.Append(", "); } } } lblNavigationPaths.Text = sb.ToString(); } else { lblNavigationPaths.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); string currentWiki = DetectWiki(); if (!AdminMaster.CanManageGlobalConfiguration(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames(currentWiki))) { UrlTools.Redirect("AccessDenied.aspx"); } PrintSystemStatus(); }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageNamespaces(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames(DetectWiki()))) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { rptNamespaces.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { Page.Title = Properties.Messages.PageNotFoundTitle + " - " + Settings.WikiTitle; if (Request["Page"] != null) { lblDescription.Text = lblDescription.Text.Replace("##PAGENAME##", Request["Page"]); } else { UrlTools.Redirect(UrlTools.BuildUrl("Default.aspx")); } PrintSearchResults(); }
/// <summary> /// Rolls back the externally selected page to the previous version. /// </summary> private void AutoRollback() { List <int> backups = Pages.GetBackups(externallySelectedPage); if (backups.Count > 0) { int targetRevision = backups[backups.Count - 1]; Log.LogEntry("Page rollback requested for " + txtCurrentPage.Value + " to rev. " + targetRevision.ToString(), EntryType.General, SessionFacade.GetCurrentUsername()); Pages.Rollback(externallySelectedPage, targetRevision); UrlTools.Redirect(externallySelectedPage.FullName + Settings.PageExtension); } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageSnippetsAndTemplates(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { // Load snippets rptSnippetsTemplates.DataBind(); } }
/// <summary> /// Verifies the need for a redirect and performs it. /// </summary> private void VerifyAndPerformRedirects() { if (currentPage == null) { UrlTools.Redirect(UrlTools.BuildUrl("PageNotFound.aspx?Page=", Tools.UrlEncode(DetectFullName()))); } if (Request["Edit"] == "1") { UrlTools.Redirect(UrlTools.BuildUrl("Edit.aspx?Page=", Tools.UrlEncode(currentPage.FullName))); } if (Request["History"] == "1") { UrlTools.Redirect(UrlTools.BuildUrl("History.aspx?Page=", Tools.UrlEncode(currentPage.FullName))); } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageConfiguration(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { // Load log entries rptLog.DataBind(); } }
protected void btnSend_Click(object sender, EventArgs e) { string content = editor.GetContent(); Page.Validate(); if (!Page.IsValid || content.Replace(" ", "").Length == 0 || txtSubject.Text.Replace(" ", "").Length == 0) { lblResult.CssClass = "resulterror"; lblResult.Text = Properties.Messages.SubjectAndBodyNeeded; return; } Regex r = new Regex(@"\<script.*?\>", RegexOptions.Compiled | RegexOptions.IgnoreCase); if (r.Match(editor.GetContent()).Success) { lblResult.CssClass = "resulterror"; lblResult.Text = @"<span style=""color: #FF0000;"">" + Properties.Messages.ScriptDetected + "</span>"; return; } string username = Request.UserHostAddress; if (SessionFacade.LoginKey != null) { username = SessionFacade.CurrentUsername; } if (Request["Edit"] == null) { int parent = -1; try { parent = int.Parse(Request["Parent"]); } catch { } Pages.AddMessage(page, username, txtSubject.Text, DateTime.Now, content, parent); } else { var messages = Pages.GetPageMessages(page); Message msg = Pages.FindMessage(messages, int.Parse(Request["Edit"])); Pages.ModifyMessage(page, int.Parse(Request["Edit"]), msg.Username, txtSubject.Text, DateTime.Now, content); } UrlTools.Redirect(page.FullName + Settings.PageExtension + "?Discuss=1&NoRedirect=1"); }
/// <summary> /// Prints the results of the automatic search. /// </summary> public void PrintSearchResults() { StringBuilder sb = new StringBuilder(1000); PageInfo[] results = SearchTools.SearchSimilarPages(Request["Page"], DetectNamespace()); if (results.Length > 0) { sb.Append("<p>"); sb.Append(Properties.Messages.WereYouLookingFor); sb.Append("</p>"); sb.Append("<ul>"); PageContent c; for (int i = 0; i < results.Length; i++) { c = Content.GetPageContent(results[i], true); sb.Append(@"<li><a href="""); UrlTools.BuildUrl(sb, Tools.UrlEncode(results[i].FullName), Settings.PageExtension); sb.Append(@""">"); sb.Append(FormattingPipeline.PrepareTitle(c.Title, false, FormattingContext.PageContent, c.PageInfo)); sb.Append("</a></li>"); } sb.Append("</ul>"); } else { sb.Append("<p>"); sb.Append(Properties.Messages.NoSimilarPages); sb.Append("</p>"); } sb.Append(@"<br /><p>"); sb.Append(Properties.Messages.YouCanAlso); sb.Append(@" <a href="""); UrlTools.BuildUrl(sb, "Search.aspx?Query=", Tools.UrlEncode(Request["Page"])); sb.Append(@""">"); sb.Append(Properties.Messages.PerformASearch); sb.Append("</a> "); sb.Append(Properties.Messages.Or); sb.Append(@" <a href="""); UrlTools.BuildUrl(sb, "Edit.aspx?Page=", Tools.UrlEncode(Request["Page"])); sb.Append(@"""><b>"); sb.Append(Properties.Messages.CreateThePage); sb.Append("</b></a> ("); sb.Append(Properties.Messages.CouldRequireLogin); sb.Append(").</p>"); lblSearchResults.Text = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { currentWiki = DetectWiki(); Page.Title = Properties.Messages.ProfileTitle + " - " + Settings.GetWikiTitle(currentWiki); if (SessionFacade.LoginKey == null) { UrlTools.Redirect(UrlTools.BuildUrl(currentWiki, "Login.aspx?Redirect=Profile.aspx")); } currentUser = SessionFacade.GetCurrentUser(currentWiki); currentGroups = SessionFacade.GetCurrentGroupNames(currentWiki); if (currentUser.Username == "admin") { // Admin only has language preferences, stored in a cookie UrlTools.Redirect("Language.aspx"); return; } if (!Page.IsPostBack) { bool usersDataSupported = !currentUser.Provider.UsersDataReadOnly; bool accountDetailsSupported = !currentUser.Provider.UserAccountsReadOnly; pnlUserData.Visible = usersDataSupported; pnlAccount.Visible = accountDetailsSupported; pnlNoChanges.Visible = !usersDataSupported && !accountDetailsSupported; languageSelector.LoadLanguages(); languageSelector.LoadTimezones(); string name = string.IsNullOrEmpty(currentUser.DisplayName) ? currentUser.Username : currentUser.DisplayName; lblUsername.Text = name; txtDisplayName.Text = currentUser.DisplayName; txtEmail1.Text = currentUser.Email; lblGroupsList.Text = string.Join(", ", Array.ConvertAll(SessionFacade.GetCurrentGroups(currentWiki), delegate(UserGroup g) { return(g.Name); })); LoadNotificationsStatus(); LoadLanguageAndTimezoneSettings(); rxvDisplayName.ValidationExpression = GlobalSettings.DisplayNameRegex; rxvEmail1.ValidationExpression = GlobalSettings.EmailRegex; rxvPassword1.ValidationExpression = GlobalSettings.PasswordRegex; } }
protected void Page_Load(object sender, EventArgs e) { currentWiki = DetectWiki(); AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageGlobalConfiguration(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames(currentWiki))) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { LoadWikis(); LoadDestinationStorageProviders(); } }
/// <summary> /// Returns to the group list. /// </summary> private void ReturnToList() { LoadExternallySelectedPage(); if (externallySelectedPage != null) { // Return to page UrlTools.Redirect(externallySelectedPage.FullName + Settings.PageExtension); } else { // Return to list pnlEditPage.Visible = false; pnlPermissions.Visible = false; pnlBulkMigrate.Visible = false; pnlList.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); currentWiki = DetectWiki(); if (!AdminMaster.CanManageProviders(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames(currentWiki))) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { // Load themes and related data LoadThemes(); } }
public void PrintNavPaths() { StringBuilder sb = new StringBuilder(); sb.Append("<ul>"); List<NavigationPath> paths = NavigationPaths.GetNavigationPaths(DetectNamespaceInfo()); for(int i = 0; i < paths.Count; i++) { sb.Append(@"<li><a href="""); UrlTools.BuildUrl(sb, "Default.aspx?Page=", Tools.UrlEncode(paths[i].Pages[0]), "&NavPath=", Tools.UrlEncode(paths[i].FullName)); sb.Append(@""">"); sb.Append(paths[i].FullName); sb.Append("</a></li>"); } sb.Append("</ul>"); lblNavPathList.Text = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageProviders(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { lblResult.CssClass = ""; lblResult.Text = ""; // Load providers and related data rptProviders.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string currentWiki = DetectWiki(); PageSize = Settings.GetListSize(currentWiki); rangeEnd = PageSize - 1; LoginTools.VerifyReadPermissionsForCurrentNamespace(currentWiki); if (Request["Cat"] != null) { if (Request["Cat"].Equals("-")) { lblPages.Text = Properties.Messages.UncategorizedPages; } else { lblPages.Text = Properties.Messages.PagesOfCategory + " <i>" + Request["Cat"] + "</i>"; } } if (!Page.IsPostBack) { lnkCategories.NavigateUrl = UrlTools.BuildUrl(currentWiki, "Category.aspx"); lnkSearch.NavigateUrl = UrlTools.BuildUrl(currentWiki, "Search.aspx"); currentPages = GetAllPages(); pageSelector.ItemCount = currentPages.Count; pageSelector.PageSize = PageSize; string p = Request["Page"]; if (!int.TryParse(p, out selectedPage)) { selectedPage = 0; } pageSelector.SelectPage(selectedPage); } Page.Title = Properties.Messages.AllPagesTitle + " (" + (rangeBegin + 1).ToString() + "-" + (rangeEnd + 1).ToString() + ") - " + Settings.GetWikiTitle(currentWiki); // Important note // This page cannot use a repeater because the page list has particular elements used for grouping pages PrintPages(); }
/// <summary> /// Verifies for editing collisions, and if no collision is found, "locks" the page /// </summary> private void ManageEditingCollisions() { if (currentPage == null) { return; } lblRefreshLink.Text = @"<a href=""" + UrlTools.BuildUrl(currentWiki, "Edit.aspx?Page=", Tools.UrlEncode(currentPage.FullName), (Request["Section"] != null ? "&Section=" + currentSection.ToString() : "")) + @""">" + Properties.Messages.Refresh + " »</a>"; string username = Request.UserHostAddress; if (SessionFacade.LoginKey != null) { username = SessionFacade.CurrentUsername; } if (Collisions.IsPageBeingEdited(currentPage, username)) { pnlCollisions.Visible = true; lblConcurrentEditingUsername.Text = "(" + Users.UserLink(currentWiki, Collisions.WhosEditing(currentPage)) + ")"; if (Settings.GetDisableConcurrentEditing(currentWiki)) { lblSaveDisabled.Visible = true; lblSaveDangerous.Visible = false; btnSave.Enabled = false; btnSaveAndContinue.Enabled = false; } else { lblSaveDisabled.Visible = false; lblSaveDangerous.Visible = true; btnSave.Enabled = true; btnSaveAndContinue.Enabled = true; } } else { pnlCollisions.Visible = false; btnSave.Enabled = true; btnSaveAndContinue.Enabled = true; Collisions.RenewEditingSession(currentPage, username); } }
/// <summary> /// Tries to redirect the user to any specified URL. /// </summary> /// <param name="goHome">A value indicating whether to redirect to the home page if no explicit redirect URL is found.</param> public static void TryRedirect(string wiki, bool goHome) { if (HttpContext.Current.Request["Redirect"] != null) { string target = HttpContext.Current.Request["Redirect"]; if (target.StartsWith("http:") || target.StartsWith("https:")) { HttpContext.Current.Response.Redirect(target); } else { UrlTools.Redirect(UrlTools.BuildUrl(wiki, target)); } } else if (goHome) { UrlTools.Redirect(UrlTools.BuildUrl(wiki, "Default.aspx")); } }
protected void Page_Load(object sender, EventArgs e) { Page.Title = Properties.Messages.OperationTitle + " - " + Settings.WikiTitle; if (Request["Operation"] == null) { UrlTools.RedirectHome(); } op = Request["Operation"].ToLowerInvariant(); switch (op) { case "deletemessage": Page.Title = "Delete Message - " + Settings.WikiTitle; mlwOperation.ActiveViewIndex = 0; PrepareDeleteMessage(); break; } }
/// <summary> /// Verifies the need for a page redirection, and performs it when appropriate. /// </summary> private void VerifyAndPerformPageRedirection() { if (currentPage == null) { return; } // Force formatting so that the destination can be detected FormattedContent.GetFormattedPageContent(currentWiki, currentPage); PageContent dest = Redirections.GetDestination(currentPage.FullName); if (dest == null) { return; } if (dest != null) { if (Request["NoRedirect"] != "1") { UrlTools.Redirect(dest.FullName + GlobalSettings.PageExtension + "?From=" + currentPage.FullName, false); } else { // Write redirection hint StringBuilder sb = new StringBuilder(); sb.Append(@"<div id=""RedirectionDiv"">"); sb.Append(Properties.Messages.ThisPageRedirectsTo); sb.Append(": "); sb.Append(@"<a href="""); UrlTools.BuildUrl(currentWiki, sb, "++", Tools.UrlEncode(dest.FullName), GlobalSettings.PageExtension, "?From=", Tools.UrlEncode(currentPage.FullName)); sb.Append(@""">"); sb.Append(FormattingPipeline.PrepareTitle(currentWiki, dest.Title, false, FormattingContext.PageContent, currentPage.FullName)); sb.Append("</a></div>"); Literal literal = new Literal(); literal.Text = sb.ToString(); plhContent.Controls.Add(literal); } } }
/// <summary> /// Verifies read permissions for the current user, redirecting to the appropriate page if no valid permissions are found. /// </summary> public static void VerifyReadPermissionsForCurrentNamespace() { var currentUsername = SessionFacade.GetCurrentUsername(); var currentGroups = SessionFacade.GetCurrentGroupNames(); var canViewNamespace = AuthChecker.CheckActionForNamespace( Tools.DetectCurrentNamespaceInfo(), Actions.ForNamespaces.ReadPages, currentUsername, currentGroups); if (!canViewNamespace) { if (SessionFacade.CurrentUsername == null) { UrlTools.Redirect("Login.aspx?Redirect=" + Tools.UrlEncode(Tools.GetCurrentUrlFixed())); } else { UrlTools.Redirect("AccessDenied.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageNamespaces(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { rptNamespaces.DataBind(); // Populate themes string[] themes = Tools.AvailableThemes; foreach (string theme in themes) { lstTheme.Items.Add(new ListItem(theme, theme)); } } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); var currentUser = SessionFacade.GetCurrentUsername(); var currentGroups = SessionFacade.GetCurrentGroupNames(); if (!AdminMaster.CanManageGroups(currentUser, currentGroups)) { UrlTools.Redirect("AccessDenied.aspx"); } aclActionsSelector.Visible = AdminMaster.CanManagePermissions(currentUser, currentGroups); revName.ValidationExpression = Settings.UsernameRegex; if (!Page.IsPostBack) { rptGroups.DataBind(); providerSelector.Reload(); btnNewGroup.Enabled = providerSelector.HasProviders; } }
protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageMetaFiles(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) { UrlTools.Redirect("AccessDenied.aspx"); } if (!Page.IsPostBack) { // Load namespaces // Add root namespace lstNamespace.Items.Add(new ListItem("<root>", "")); List <NamespaceInfo> namespaces = Pages.GetNamespaces(); foreach (NamespaceInfo ns in namespaces) { lstNamespace.Items.Add(new ListItem(ns.Name, ns.Name)); } } }
protected void Page_Load(object sender, EventArgs e) { var context = this.Context; context.Response.ContentType = "text/plain"; AdminMaster.RedirectToLoginIfNeeded(); if (!AdminMaster.CanManageConfiguration(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) { UrlTools.Redirect("~/AccessDenied.aspx"); } var qs = context.Request.QueryString; var ns = qs["NS"]; var nspace = Pages.GetNamespaces().FirstOrDefault(x => x.Name == ns); if (nspace == null) { context.Response.Write(string.Format("Namespace \"{0}\" not found", ns)); return; } // Liste des pages orphelines var candidates = Pages.GetOrphanedPages(nspace) // récupération contenu .Select(p => new { PageInfo = p, PageContent = p.Provider.GetContent(p) }) // qui n'ont pas été modifées depuis plus d'un mois .Where(p => p.PageContent != null && p.PageContent.LastModified < DateTime.Today.AddMonths(-1)) .OrderBy(p => p.PageInfo.FullName); foreach (var candidate in candidates) { context.Response.Write(string.Format("[url=/Wiki/{0}.ashx]{0}[/url] \"{1}\"\r\n", candidate.PageInfo.FullName, candidate.PageContent.Title)); } }
/// <summary> /// Sets the JavaScript double-click editing handler. /// </summary> private void SetupDoubleClickHandler() { if (Settings.EnableDoubleClickEditing && !discussMode && !viewCodeMode) { StringBuilder sb = new StringBuilder(200); sb.Append(@"<script type=""text/javascript"">" + "\n"); sb.Append("<!--\n"); sb.Append("document.ondblclick = function() {\n"); sb.Append("document.location = '"); sb.Append(UrlTools.BuildUrl("Edit.aspx?Page=", Tools.UrlEncode(currentPage.FullName))); sb.Append("';\n"); sb.Append("}\n"); sb.Append("// -->\n"); sb.Append("</script>"); lblDoubleClickHandler.Text = sb.ToString(); } else { lblDoubleClickHandler.Visible = false; } }