当前位置: 首页>>代码示例>>C#>>正文


C# WebPage类代码示例

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


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

示例1: PiranhaHelper

 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="html"></param>
 public PiranhaHelper(WebPage parent, HtmlHelper html)
 {
     Parent = parent ;
     Html = html ;
     Gravatar = new GravatarHelper() ;
     Culture = new CultureHelper() ;
 }
开发者ID:NJepop,项目名称:Piranha,代码行数:11,代码来源:PiranhaHelper.cs

示例2: TestWebPage

 public void TestWebPage()
 {
     var page = new WebPage<MyPage>("http://ya.ru", "<html><html>")
     {
         FuncParse = () => new MyPage {Id = 1, Title = "Test page"}
     };
     Assert.AreEqual(new MyPage {Id = 1, Title = "Test page"}, page.Model);
 }
开发者ID:ibavca1,项目名称:bavc.ru,代码行数:8,代码来源:UnitTestPage.cs

示例3: Search

 public void Search(string website, string regexPattern)
 {
     List<string> output = new List<string>();
     _regexPattern = regexPattern;
     webpage = new WebPage();
     webpage.WebPageLoaded += WebPageLoadedSearchCalled;
     webpage.Load(website);
 }
开发者ID:conradkoh,项目名称:Buddy,代码行数:8,代码来源:TorrentSearcher.cs

示例4: ExtractList

 /// <summary>
 /// Extract from the web page and return the results as a list.
 /// </summary>
 /// <param name="page">The web page to extract from.</param>
 /// <returns>The results of the extraction as a List.</returns>
 public IList<Object> ExtractList(WebPage page)
 {
     Listeners.Clear();
     var listener = new ListExtractListener();
     AddListener(listener);
     Extract(page);
     return listener.List;
 }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:13,代码来源:BasicExtract.cs

示例5: WebPageDecorator

 /// <summary>
 /// Initializes a new instance of the WebPageDecorator class
 /// </summary>
 /// <param name="webPage">The web page model.</param>
 /// <param name="context">The data context.</param>
 public WebPageDecorator(WebPage webPage, IDataContext context)
 {
     if (webPage is WebPageDecorator)
         Model = ((WebPageDecorator)webPage).Model;
     else
         Model = webPage;
     this.Context = context;
     Model.CopyTo(this, new string[] { "Widgets", "Roles", "Scripts", "StyleSheets" });
 }
开发者ID:howej,项目名称:dotnetage,代码行数:14,代码来源:WebPageDecorator.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            webPage = this.Page as WebPage;

            if (!IsPostBack)
            {
                ltlMenu.Text = webPage.SideMenus;
            }
        }
开发者ID:plz821,项目名称:entCMS,代码行数:9,代码来源:Inside.master.cs

示例7: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Page is WebPage)
     {
         webPage = (this.Page as WebPage);
     }
     else
     {
         webPage = new WebPage(1);
     }
 }
开发者ID:plz821,项目名称:entCMS,代码行数:11,代码来源:NestedSite.master.cs

示例8: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        var page = new WebPage();

        if (IsLoaded)
            page.CopyPropertiesFrom(OriginalPage);

        page.ParentPageId = null;
        if (!String.IsNullOrEmpty(cboParentPages.SelectedValue))
            page.ParentPageId = Convert.ToInt32(cboParentPages.SelectedValue);

        page.Name = txtName.Text;
        page.CompanyId = Company.CompanyId;
        page.Description = txtDescription.Value.Replace("$0", "<br/>");
        page.IsInMenu = chkIsInMenu.Checked;

        page.IsPublished = chkIsPublished.Checked;
        page.CanComment = chkCanComment.Checked;
        page.MasterPage = cboMasterPage.Text;

        if (page.IsPublished)
        {
            if (!page.PublishedDate.HasValue)
                page.PublishedDate = DateTime.Now;
        }
        else
            page.PublishedDate = null;

        page.RedirectUrl = null;
        if (!String.IsNullOrEmpty(txtRedirectUrl.Text))
            page.RedirectUrl = txtRedirectUrl.Text;

        page.ModifiedDate = DateTime.Now;

        if (!page.UserId.HasValue)
            page.UserId = User.Identity.UserId;

        SiteManager.Save(page, txtTags.Text);

        if (((WebControl)sender).ID == "btnSaveAndNew")
        {
            Response.Redirect("WebPage.aspx");
            return;
        }
        //
        //Close the modal popup and redirect for WebPages.aspx
        //
        ClientScript.RegisterStartupScript(this.GetType(), "close", "top.$.LightboxObject.close();", true);

        //Response.Redirect("WebPages.aspx");

    }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:52,代码来源:WebPage.aspx.cs

示例9: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Page is WebPage)
     {
         webPage = (this.Page as WebPage);
     }
     else
     {
         webPage = new WebPage(1);
     }
     Page.Title = webPage.WebName;
     ltlKeyword.Text = "<meta name=\"keywords\" content=\"" + webPage.Keywords + "\"/>";
     ltlDescription.Text = "<meta name=\"description\" content=\"" + webPage.Description + "\"/>";
 }
开发者ID:plz821,项目名称:entCMS,代码行数:14,代码来源:Site.Master.cs

示例10: Main

        static void Main(string[] args)
        {
            WebPage webInfo = new WebPage("http://zhan.renren.com/flipped2012/more?page=1&count=20");
            //"http://zhan.renren.com/ranzhi12/more?page=1&count=20"

            string context = webInfo.Context;
            string html = webInfo.M_html;

            List<Link> result = webInfo.Links;
            IEnumerable<IGrouping<string,Link>> tmp = result.GroupBy(o => o.Tag);
            //var tmp2 = result.Where(o => o.Tag == "img" & (o.Src.IndexOf("xlarge") > -1 || o.Src.IndexOf("original") > -1)).ToList();

            var imgs = result.Where(o => o.Tag == "img").ToList();
        }
开发者ID:priceLiu,项目名称:GetWebPage,代码行数:14,代码来源:Program.cs

示例11: RenderWebPage

        public static string RenderWebPage(WebPage page, StartPage startPage = null) {
            var writer = new StringWriter();

            // Create an actual dummy HttpContext that has a request object
            var filename = "default.aspx";
            var url = "http://localhost/default.aspx";
            var request = new HttpRequest(filename, url, null);
            var httpContext = new HttpContext(request, new HttpResponse(new StringWriter(new StringBuilder())));

            var pageContext = Util.CreatePageContext(httpContext);

            page.ExecutePageHierarchy(pageContext, writer, startPage);

            return writer.ToString();
        }
开发者ID:jesshaw,项目名称:ASP.NET-Mvc-3,代码行数:15,代码来源:Utils.cs

示例12: RenderWebPage

        public static string RenderWebPage(WebPage page, StartPage startPage = null, HttpRequestBase request = null)
        {
            var writer = new StringWriter();

            // Create an actual dummy HttpContext that has a request object
            var filename = "default.aspx";
            var url = "http://localhost/default.aspx";

            request = request ?? CreateTestRequest(filename, url).Object;
            var httpContext = CreateTestContext(request);

            var pageContext = new WebPageContext { HttpContext = httpContext.Object };
            page.ExecutePageHierarchy(pageContext, writer, startPage);
            return writer.ToString();
        }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:15,代码来源:Utils.cs

示例13: WebPageHttpHandler

        public WebPageHttpHandler(string virtualPath)
        {
            // create a new WebPage instance for use when processing the request
            this.Page = (WebPage)WebPageBase.CreateInstanceFromVirtualPath(virtualPath);

            Func<WebPageRenderingBase> func = null;
            if (func == null)
            {
                func = delegate
                {
                    return StartPage.GetStartPage(this.Page, "_PageStart", System.Web.WebPages.WebPageHttpHandler.GetRegisteredExtensions());
                };
            }
            this._startPage = new Lazy<WebPageRenderingBase>(func);
        }
开发者ID:perezdecolosia,项目名称:Northwind.Web.WebPages,代码行数:15,代码来源:WebPageHttpHandler.cs

示例14: WebPageLoadedSearchCalled

        private void WebPageLoadedSearchCalled(object sender, WebPage.WebPageArguments args)
        {
            string htmlData = webpage.htmlData;
            if (htmlData != null)
            {
                System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(_regexPattern);
                results = regex.Matches(htmlData);

            }
            if(InfoReady != null)
            {
                InfoReady(this, new InfoReadyEventArgs("info ready"));
            }

               // webpage.WebPageLoaded -= WebPageLoadedSearchCalled;
        }
开发者ID:conradkoh,项目名称:Buddy,代码行数:16,代码来源:TorrentSearcher.cs

示例15: InjectContext

        public static void InjectContext(WebPage razorWebPage, MacroModel macro, INode currentPage) {
            var context = HttpContext.Current;
            var contextWrapper = new HttpContextWrapper(context);

            //inject http context - for request response
            HttpContext.Current.Trace.Write("umbracoMacro", string.Format("Loading Macro Script Context (file: {0})", macro.Name));
            razorWebPage.Context = contextWrapper;
            HttpContext.Current.Trace.Write("umbracoMacro", string.Format("Done Loading Macro Script Context (file: {0})", macro.Name));

            //Inject Macro Model And Parameters
            if (razorWebPage is IMacroContext) {
                HttpContext.Current.Trace.Write("umbracoMacro", string.Format("Boxing Macro Script MacroContext (file: {0})", macro.Name));
                var razorMacro = (IMacroContext)razorWebPage;
                HttpContext.Current.Trace.Write("umbracoMacro", string.Format("Done Boxing Macro Script MacroContext (file: {0})", macro.Name));

                HttpContext.Current.Trace.Write("umbracoMacro", string.Format("Loading Macro Script Model (file: {0})", macro.Name));
                razorMacro.SetMembers(macro, currentPage);
                HttpContext.Current.Trace.Write("umbracoMacro", string.Format("Done Loading Macro Script Model (file: {0})", macro.Name));
            }
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:20,代码来源:RazorMacroEngine.cs


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