• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UI.LiteralControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.LiteralControl的典型用法代码示例。如果您正苦于以下问题:C# LiteralControl类的具体用法?C# LiteralControl怎么用?C# LiteralControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LiteralControl类属于System.Web.UI命名空间,在下文中一共展示了LiteralControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BindWeblogListContent

        protected void BindWeblogListContent(Control control, IDataItemContainer dataItemContainer)
        {

            WeblogData blogName = new WeblogData();
            blogName.Property = "Name";
            blogName.Tag = WrappedControlTag.B;
            blogName.LinkTo = WeblogLinkTo.HomePage;
            control.Controls.Add(blogName);

            control.Controls.Add(new LiteralControl("<br />"));

            WeblogData postCount = new WeblogData();
            postCount.Property = "PostCount";
            control.Controls.Add(postCount);

            LiteralControl postText = new LiteralControl(" Posts | ");
            control.Controls.Add(postText);

            WeblogData commentCount = new WeblogData();
            commentCount.Property = "CommentCount";
            control.Controls.Add(commentCount);

            LiteralControl commentText = new LiteralControl(" Comments");
            control.Controls.Add(commentText);

            control.Controls.Add(new LiteralControl("<br />"));
        }
开发者ID:diabluchanskyi,项目名称:pablo,代码行数:27,代码来源:BlogrollFragment.cs


示例2: Render

        protected override void Render(HtmlTextWriter writer)
        {
            var headControl = Page.Header;
            if (headControl == null)
            {
                base.Render(writer);
                return;
            }
            try
            {
                var hrefSchemeAndServerPart = PortalContext.Current.OriginalUri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped);
                var hrefPathPart = PortalContext.Current.OriginalUri.GetComponents(UriComponents.Path, UriFormat.SafeUnescaped);
                hrefSchemeAndServerPart = VirtualPathUtility.AppendTrailingSlash(hrefSchemeAndServerPart);

                var hrefString = String.Concat(hrefSchemeAndServerPart, hrefPathPart);

                //note that if the original URI already contains a trailing slash, we do not remove it
                if (AppendTrailingSlash)
                    hrefString = VirtualPathUtility.AppendTrailingSlash(hrefString);

                var baseTag = new LiteralControl
                {
                    ID = "baseTag",
                    Text = String.Format("<base href=\"{0}\" />", hrefString)
                };
                baseTag.RenderControl(writer);

            }
            catch (Exception exc) //logged
            {
                Logger.WriteException(exc);
            }

        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:34,代码来源:BaseTag.cs


示例3: Page_Init_InitialLoading

        protected void Page_Init_InitialLoading(object sender, ActiveEventArgs e)
        {
            Page page = HttpContext.Current.Handler as Page;

            // Injecting a CSS link reference if additional CSS files are to be included
            string custFiles = Settings.Instance["CustomCssFiles"];
            if (!string.IsNullOrEmpty(custFiles))
            {
                string[] files = custFiles.Split(
                    new char[] { ',' }, 
                    StringSplitOptions.RemoveEmptyEntries);
                foreach (string file in files)
                {
                    string fileName = file.Trim();
                    LiteralControl lit = new LiteralControl();
                    lit.Text = string.Format(@"
<link 
    href=""{0}"" 
    rel=""stylesheet""
    type=""text/css"" />",
                             fileName);
                    page.Header.Controls.Add(lit);
                }
            }
        }
开发者ID:greaterwinner,项目名称:ra-brix,代码行数:25,代码来源:IncludeCustomCss.cs


示例4: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            LiteralControl litcon01 = new LiteralControl();
            litcon01.Text += "<h1>nbl_WC_Close-Coupled</h1>";
            model01_title.Controls.Add(litcon01);

            LiteralControl litcon02 = new LiteralControl();
            litcon02.Text += "<h1>nbl_WashFountain</h1>";
            model02_title.Controls.Add(litcon02);

            LiteralControl litcon03 = new LiteralControl();
            litcon03.Text += "<h1>nbl_WashBasin_Pedestal</h1>";
            model03_title.Controls.Add(litcon03);

            LiteralControl litcon04 = new LiteralControl();
            litcon04.Text += "<h1>nbl_Sink_Belfast</h1>";
            model04_title.Controls.Add(litcon04);

            LiteralControl litcon05 = new LiteralControl();
            litcon05.Text += "<h1>nbl_Shower_Rctngl</h1>";
            model05_title.Controls.Add(litcon05);

            LiteralControl litcon06 = new LiteralControl();
            litcon06.Text += "<h1>nbl_SanitaryAccessory_Hand-Drier</h1>";
            model06_title.Controls.Add(litcon06);
        }
开发者ID:bnaand,项目名称:xBim-Toolkit,代码行数:26,代码来源:MultiFiles.aspx.cs


示例5: cbUpgrade_Callback

        private void cbUpgrade_Callback(object sender, Controls.CallBackEventArgs e)
        {
            string upFilePath = Server.MapPath("~/desktopmodules/activeforums/upgrade4x.txt");
            string err = "Success";
            try
            {
                if (System.IO.File.Exists(upFilePath))
                {
                    string s = Utilities.GetFileContent(upFilePath);
                    err = DotNetNuke.Entities.Portals.PortalSettings.ExecuteScript(s);
                    System.IO.File.Delete(upFilePath);
                }
            }
            catch (Exception ex)
            {
                if (ex is UnauthorizedAccessException && string.IsNullOrEmpty(err))
                {
                    err = "<span style=\"font-size:14px;font-weight:bold;\">The forum data was upgraded successfully, but you must manually delete the following file:<br /><br />" + upFilePath + "<br /><br />The upgrade is not complete until you delete the file indicated above.</span>";
                }
                else
                {
                    err = "<span style=\"font-size:14px;font-weight:bold;\">Upgrade Failed - Please go to the <a href=\"http://www.activemodules.com/community/helpdesk.aspx\">Active Modules Help Desk</a> to report the error indicated below:<br /><br />" + ex.Message + "</span>";
                }

            }
            LiteralControl lit = new LiteralControl();
            if (string.IsNullOrEmpty(err))
            {
                err = "<script type=\"text/javascript\">LoadView('home');</script>";
            }
            lit.Text = err;
            lit.RenderControl(e.Output);
        }
开发者ID:allanedk,项目名称:ActiveForums,代码行数:33,代码来源:admin_upgrade.ascx.cs


示例6: Alert

		public Alert()
			: base("div")
		{
			Closable = true;
			closeButton = new LiteralControl("<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>");
			textLiteral = new LiteralControl();
		}
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:7,代码来源:Alert.cs


示例7: SetupLinks

        private void SetupLinks()
        {
            Panel pnlContent = botnavcontent;
            HyperLink linkToAdd;
            LiteralControl space;

            for (Int32 i = 0; i < pageNames.Length; i++)
            {
                linkToAdd = new HyperLink();
                linkToAdd.NavigateUrl = pageLinks[i];
                linkToAdd.Text = linkText[i];
                if (Page.Request.Url.ToString().ToLower().Contains(pageNames[i]))
                {
                    linkToAdd.Attributes.Add("class", "unavon");
                }
                pnlContent.Controls.Add(linkToAdd);

                if (i < (pageNames.Length - 1))
                {
                    space = new LiteralControl();
                    space.Text = "&nbsp;|&nbsp;";
                    pnlContent.Controls.Add(space);
                }
            }
        }
开发者ID:reydavid47,项目名称:GITHUB,代码行数:25,代码来源:MasterPage.master.cs


示例8: magix_forms_controls_panel

		private void magix_forms_controls_panel(object sender, ActiveEventArgs e)
		{
            Node ip = Ip(e.Params);
			if (ShouldInspect(ip))
			{
				Inspect(ip);
				return;
			}

			LiteralControl ctrl = new LiteralControl();

            Node node = ip["_code"].Get<Node>();

            string idPrefix = "";
            if (ip.ContainsValue("id-prefix"))
                idPrefix = ip["id-prefix"].Get<string>();

            if (node.ContainsValue("id"))
                ctrl.ID = idPrefix + node["id"].Get<string>();
            else if (node.Value != null)
                ctrl.ID = idPrefix + node.Get<string>();

            if (node.ContainsValue("text"))
				ctrl.Text = node["text"].Get<string>();

            ip["_ctrl"].Value = ctrl;
		}
开发者ID:polterguy,项目名称:magix,代码行数:27,代码来源:LiteralController.cs


示例9: Show

 public static void Show(System.Web.UI.Page p, object mess)
 {
     //HttpContext.Current.Response.Write("<script>alert('"+mess.ToString()+"')</script>");
     System.Web.UI.LiteralControl lt = new System.Web.UI.LiteralControl();
     lt.Text=  "<script language=\"javascript\" type=\"text/javascript\"> alert(\"" + mess.ToString() + "\")</script>";
     p.Header.Controls.Add(lt);
 }
开发者ID:nmduy3984,项目名称:SanNhua,代码行数:7,代码来源:MessageBox.cs


示例10: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            NameValueCollection nvc = Request.Form;

            LiteralControl lt = new LiteralControl();
            this.Controls.Add(lt);

            if (string.IsNullOrEmpty(nvc[AzureContract.PushNotificationPost.TITLE]) ||
                string.IsNullOrEmpty(nvc[AzureContract.PushNotificationPost.CONTENT]) ||
                string.IsNullOrEmpty(nvc[AzureContract.PushNotificationPost.SUBSCRIPTION_URI]) ||
                string.IsNullOrEmpty(nvc[AzureContract.PushNotificationPost.NAVIGATION_URI]))
            {
                lt.Text = "Error, one of the required post fields is empty.\n"+nvc[AzureContract.PushNotificationPost.TITLE]+"\n"+nvc[AzureContract.PushNotificationPost.CONTENT]+"\n"+nvc[AzureContract.PushNotificationPost.SUBSCRIPTION_URI]+"\n"+nvc[AzureContract.PushNotificationPost.NAVIGATION_URI];
                return;
            }

            string title, content, subscriptionUri, navigationUri;

            title = nvc[AzureContract.PushNotificationPost.TITLE];
            content = nvc[AzureContract.PushNotificationPost.CONTENT];
            subscriptionUri = nvc[AzureContract.PushNotificationPost.SUBSCRIPTION_URI];
            navigationUri = nvc[AzureContract.PushNotificationPost.NAVIGATION_URI];
            lt.Text = "Toast title:" + title + "\ncontent:" + content + "\nnavigation uri:" + navigationUri + "\nphone uri:" + subscriptionUri;

            sendPushNotification(subscriptionUri, title, content, navigationUri);
        }
开发者ID:qtstc,项目名称:weassist,代码行数:26,代码来源:push.aspx.cs


示例11: Page_Load

        protected void Page_Load(object sender, EventArgs e) {

            lnkAddUpSell.Click += new EventHandler(lnkAddUpSell_Click);

            i = 1;
            while (i <= upSellProducts) {
                TextBox txt = new TextBox();
                txt.ID = "txtUpSellAddition" + i;
                plhUpSellAdditions.Controls.Add(txt);


                CustomValidator upCustomValidator = new CustomValidator();
                upCustomValidator.ControlToValidate = txt.ID;
                upCustomValidator.Enabled = true;
                upCustomValidator.EnableViewState = true;
                upCustomValidator.SetFocusOnError = true;
                upCustomValidator.Text = "This is not a valid product";
                upCustomValidator.ErrorMessage = "A upsell product you added is invlaid.";
                upCustomValidator.ServerValidate += RelatedProductValidation;

                plhUpSellAdditions.Controls.Add(upCustomValidator);

                LiteralControl l = new LiteralControl();
                l.Text = "<br/><br/>";
                plhUpSellAdditions.Controls.Add(l);
                i++;
            }

            if (product.UpSellList.Count > 0) {
                rptUpSell.DataSource = product.UpSellList;
                rptUpSell.DataBind();
            }
        }
开发者ID:xcrash,项目名称:cuyahogacontrib-Cuyahoga.Modules.ECommerce,代码行数:33,代码来源:UpSellEditor.ascx.cs


示例12: Page_Init

        protected static void Page_Init(object sender, ActiveEventArgs e)
        {
            Page page = HttpContext.Current.Handler as Page;
            if (page != null)
            {
                if(!page.IsPostBack)
                {
                    // Inject the Google Analytics tracking code...
                    string trackingID = Settings.Instance["GoogleAnalyticsTrackingID"];
                    if(!string.IsNullOrEmpty(trackingID))
                    {
                        string trackingCode = string.Format(@"
<script type=""text/javascript"">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{0}']);
_gaq.push(['_trackPageview']);
(function() {{
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
    'https://ssl' : 'http://www') +
    '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
}})();
</script>", trackingID);
                        LiteralControl ctrl = new LiteralControl();
                        ctrl.Text = trackingCode;
                        page.Form.Controls.Add(ctrl);
                    }
                }
            }
        }
开发者ID:greaterwinner,项目名称:ra-brix,代码行数:32,代码来源:GoogleAnalyticsController.cs


示例13: AddCustomCodeToHead

 protected virtual void AddCustomCodeToHead()
 {
     // Adds code in ThonSettings.Instance.HtmlHeader to the head of the page
     string code = string.Format("{0}<!-- Start custom code -->{0}{1}{0}<!-- End custom code -->{0}", Environment.NewLine, ThonSettings.Instance.HtmlHeader);
     LiteralControl control = new LiteralControl(code);
     Page.Header.Controls.Add(control);
 }
开发者ID:chandru9279,项目名称:StarBase,代码行数:7,代码来源:ThonBasePage.cs


示例14: InstantiateIn

 //must implement following method
 public void InstantiateIn(Control container)
 {
     LiteralControl l = new LiteralControl();
       l.DataBinding +=
     new EventHandler(this.OnDataBinding);
       container.Controls.Add(l);
 }
开发者ID:rags,项目名称:playground,代码行数:8,代码来源:frmGrid.aspx.cs


示例15: BindPageList

    private void BindPageList()
    {
        foreach (Page page in BlogEngine.Core.Page.Pages)
        {
            if (!page.HasParentPage)
            {
                HtmlGenericControl li = new HtmlGenericControl("li");
                HtmlAnchor a = new HtmlAnchor();
                a.HRef = "?id=" + page.Id.ToString();
                a.InnerHtml = page.Title;

                System.Web.UI.LiteralControl text = new System.Web.UI.LiteralControl
                (" (" + page.DateCreated.ToString("yyyy-dd-MM HH:mm") + ")");

                li.Controls.Add(a);
                li.Controls.Add(text);

                if (page.HasChildPages)
                {
                    li.Controls.Add(BuildChildPageList(page));
                }

                li.Attributes.CssStyle.Remove("font-weight");
                li.Attributes.CssStyle.Add("font-weight", "bold");

                ulPages.Controls.Add(li);
            }
        }

        divPages.Visible = true;
        aPages.InnerHtml = BlogEngine.Core.Page.Pages.Count + " " + Resources.labels.pages;
    }
开发者ID:bpanjavan,项目名称:Blog,代码行数:32,代码来源:Pages.aspx.cs


示例16: IncludeStringAtTop

 public static void IncludeStringAtTop(Page page, string str)
 {
     var child = new LiteralControl();
     child.ID = GetHeaderChildID(page);
     child.Text = str;
     page.Header.Controls.AddAt(0, child);
 }
开发者ID:huanlin,项目名称:YetAnotherLibrary,代码行数:7,代码来源:PageHeaderHelper.cs


示例17: ClearControls

        private static void ClearControls(Control control)
        {
            for (int index = control.Controls.Count - 1; index >= 0; index--)
            {
                ClearControls(control.Controls[index]);
            }

            if (!(control is TableCell))
            {
                if (control.GetType().GetProperty("SelectedItem") != null)
                {
                    LiteralControl m_Literal = new LiteralControl();
                    control.Parent.Controls.Add(m_Literal);

                    m_Literal.Text = (string)control.GetType().GetProperty("SelectedItem").GetValue(control, null);
                    control.Parent.Controls.Remove(control);
                }
                else
                {
                    if (control.GetType().GetProperty("Text") != null)
                    {
                        LiteralControl m_Literal = new LiteralControl();
                        control.Parent.Controls.Add(m_Literal);
                        m_Literal.Text = (string)control.GetType().GetProperty("Text").GetValue(control, null);
                        control.Parent.Controls.Remove(control);
                    }
                }
            }
        }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:29,代码来源:ExportHelper.cs


示例18: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     var projectFile = Server.MapPath("~/App_Data/Projects.txt");
     var lines = File.ReadAllLines(projectFile);
     LiteralControl projectGallery = new LiteralControl();
     string tableStart = "<table class=\"table table-striped table-hover \"><thead><tr><th>#</th><th>Name</th><th>Description</th><th>Type</th><th>Language</th><th>Code</th></tr></thead><tbody>";
     projectGallery.Text += tableStart;
     int count = 1;
     string projectHTML;
     foreach (var line in lines)
     {
         var splitLine = line.Split('$');
         if (splitLine[5] == "True")
         {
             if (count % 2 == 1)
             {
                 projectHTML = @"<tr><td>" + count.ToString() + @"</td><td>" + splitLine[0] + @"</td><td>" + splitLine[1] + @"</td><td>" + splitLine[2] + @"</td><td>" + splitLine[3] + @"</td><td><a href=""" + splitLine[4] + @"""class=""btn btn-success"">Source</a>";
             }
             else
             {
                 projectHTML = @"<tr class=""info""><td>" + count.ToString() + @"</td><td>" + splitLine[0] + @"</td><td>" + splitLine[1] + @"</td><td>" + splitLine[2] + @"</td><td>" + splitLine[3] + @"</td><td><a href=""" + splitLine[4] + @"""class=""btn btn-success"">Source</a>";
             }
             count++;
             projectGallery.Text += projectHTML;
         }
     }
     projectGallery.Text += @"</tbody></table>";
     finishedProjectsDiv.Controls.Add(projectGallery);
 }
开发者ID:brendenowens,项目名称:PersonalWebsite,代码行数:29,代码来源:Finished.aspx.cs


示例19: OnPreRender

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            ContentPlaceHolder contentPlaceHolder = (ContentPlaceHolder)Page.Master.FindControl("PlaceHolderPageTitle");
            contentPlaceHolder.Controls.Clear();
            LiteralControl control = new LiteralControl();
            control.Text = Constants.HomeTitle;
            var currentUrl = HttpContext.Current.Request.Url.AbsolutePath;
            if (!currentUrl.Contains(".aspx") || currentUrl.Contains("default.aspx"))
            {
                control.Text = Constants.HomeTitle;
            }
            else
            {
                var catID = Convert.ToString(Request.QueryString["CatId"]);
                if (!string.IsNullOrEmpty(catID))
                {
                    control.Text += " - " + Utilities.GetValueByField(CurrentWeb, ListsName.InternalName.CategoryList,
                                   FieldsName.CategoryList.InternalName.CategoryID, catID, "Text", "Title");
                    if (Request.QueryString["ID"] != null && Request.QueryString["ID"] != string.Empty)
                    {
                        var itemId = Convert.ToString(Request.QueryString["ID"]);
                        control.Text += " - " + Utilities.GetValueByField(CurrentWeb, ListsName.InternalName.NewsList, "ID", itemId, "Counter", "Title");
                    }
                }

            }
            contentPlaceHolder.Controls.Add(control);
        }
开发者ID:setsunafjava,项目名称:vpsp,代码行数:30,代码来源:HeaderUC.ascx.cs


示例20: OnInit

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //Editors in the control panel hack
            if (Page != null && Page.Master != null && Page.Master.Master != null)
            {
                ContentPlaceHolder placeholder = Page.Master.Master.FindControl("StyleRegion") as ContentPlaceHolder;
                if(placeholder == null && Page.Master.Master.Master != null)
                {
                    placeholder = Page.Master.Master.Master.FindControl("StyleRegion") as ContentPlaceHolder;
                }

                if (placeholder != null)
                {
                    placeholder.PreRender += (sender, b) =>
                    {
                        ICustomEditorPlugin plugin = PluginManager.GetSingleton<ICustomEditorPlugin>();

                        LiteralControl lit = new LiteralControl("<style type=\"text/css\">" + plugin.Css + "</style>");

                        ((Control)sender).Controls.Add(lit);

                    };
                }
            }
        }
开发者ID:4-Roads,项目名称:FourRoads.TelligentCommunity,代码行数:27,代码来源:EditorWrapper.cs



注:本文中的System.Web.UI.LiteralControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.LosFormatter类代码示例发布时间:2022-05-26
下一篇:
C# UI.ImageClickEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap