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

C# HtmlControls.HtmlImage类代码示例

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

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



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

示例1: GetDesignTimeHtml

		public override string GetDesignTimeHtml()
		{
			StringWriter sw = new StringWriter();
			HtmlTextWriter writer = new HtmlTextWriter(sw);

			Panel panel = new Panel();
			panel.BackColor = Color.WhiteSmoke;
			panel.Width = new Unit("100%");

			HtmlTable table = new HtmlTable();
			table.Attributes["align"] = "center";
			HtmlTableRow row = new HtmlTableRow();

			HtmlTableCell cell1 = new HtmlTableCell();
			cell1.Align = "left";
			cell1.VAlign = "middle";

			HtmlImage castleImg = new HtmlImage();
			castleImg.Style["margin"] = "4px";
			castleImg.Src = binder.Page.ClientScript.GetWebResourceUrl(
				GetType(), "Castle.MonoRail.Framework.Views.Aspx.ControllerBinder.Design.Castle.gif");
			cell1.Controls.Add(castleImg);
			row.Cells.Add(cell1);

			HtmlTableCell cell2 = new HtmlTableCell();
			cell1.Align = "left";
			cell1.VAlign = "middle";

			HtmlImage monoRailImg = new HtmlImage();
			monoRailImg.Src = binder.Page.ClientScript.GetWebResourceUrl(
				GetType(), "Castle.MonoRail.Framework.Views.Aspx.ControllerBinder.Design.MonoRail.gif");
			cell2.Controls.Add(monoRailImg);
			row.Cells.Add(cell2);

			HtmlTableCell cell3 = new HtmlTableCell();
			cell3.Align = "center";
			cell3.VAlign = "middle";
			cell3.Attributes["style"] = "font-family: verdana, tahoma, arial, sans-serif; font-size: 0.9em; color:#5266A6";
			LiteralControl caption = new LiteralControl();
			int bindingCount = binder.ControllerBindings.Count;
			caption.Text = string.Format("<b>Controller Binder</b> - {0} binding{1}",
				bindingCount, bindingCount != 1 ? "s" : "");
			cell3.Controls.Add(caption);
			row.Cells.Add(cell3);

			table.Rows.Add(row);

			panel.Controls.Add(table);

			// Get the HTML produced by the control.
			panel.RenderControl(writer);
			return sw.ToString();
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:53,代码来源:ControllerActionBinderDesigner.cs


示例2: CreateChildControls

        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            this.EnsureChildControls();

            // create the controls
            this.TextBoxControl.ID = this.TextBoxControl.ClientID;
            this.TextBoxControl.Width = Unit.Pixel(330);
            this.TextBoxControl.CssClass = "guiInputText";

            // add the controls
            this.Controls.Add(this.TextBoxControl);

            // create the image
            HtmlImage image = new HtmlImage() { Src = string.Concat(GlobalSettings.Path, "/images/foldericon.png") };
            image.Style.Add("padding-left", "5px");

            // create the anchor link
            HtmlAnchor anchor = new HtmlAnchor() { HRef = "javascript:void(0);" };
            anchor.Attributes.Add("onclick", string.Format("javascript:UmbClientMgr.openModalWindow('{0}/plugins/uComponents/Shared/Pages/DirectoryBrowser.aspx?target={1}&path={2}', 'Choose a file or a folder', true, 400, 500, 0, 0); return false;", GlobalSettings.Path, this.TextBoxControl.ClientID, this.SelectedDirectory));

            // add the image to the anchor link
            anchor.Controls.Add(image);

            // add the anchor link to the data-type property
            this.Controls.Add(anchor);
        }
开发者ID:bokmadsen,项目名称:uComponents,代码行数:31,代码来源:FP_Control.cs


示例3: AttachChildControls

 protected override void AttachChildControls()
 {
     int num;
     int num2;
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound("");
     }
     this.litProdcutName = (Literal) this.FindControl("litProdcutName");
     this.litSalePrice = (Literal) this.FindControl("litSalePrice");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litSoldCount = (Literal) this.FindControl("litSoldCount");
     this.productImage = (HtmlImage) this.FindControl("productImage");
     this.productLink = (HyperLink) this.FindControl("productLink");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     string str = this.Page.Request["OrderId"];
     string str2 = "";
     if (!string.IsNullOrEmpty(str))
     {
         OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(str);
         if ((orderInfo != null) && (orderInfo.ReferralUserId > 0))
         {
             str2 = "&&ReferralId=" + orderInfo.ReferralUserId;
         }
     }
     else if (Globals.GetCurrentDistributorId() > 0)
     {
         str2 = "&&ReferralId=" + Globals.GetCurrentDistributorId().ToString();
     }
     ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
     this.litProdcutName.SetWhenIsNotNull(product.ProductName);
     this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
     this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
     this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
     this.productImage.Src = product.ThumbnailUrl180;
     this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + product.ProductId + str2;
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     ProductReviewQuery reviewQuery = new ProductReviewQuery {
         productId = this.productId,
         IsCount = true,
         PageIndex = num,
         PageSize = num2,
         SortBy = "ReviewId",
         SortOrder = SortAction.Desc
     };
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     DbQueryResult productReviews = ProductBrowser.GetProductReviews(reviewQuery);
     this.rptProducts.DataSource = productReviews.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
     PageTitle.AddSiteNameTitle("商品评价");
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:59,代码来源:VProductReview.cs


示例4: AttachChildControls

 protected override void AttachChildControls()
 {
     this.imgWeixin = (HtmlImage) this.FindControl("imgWeixin");
     this.hidWeixinNumber = (HtmlInputHidden) this.FindControl("hidWeixinNumber");
     this.hidWeixinLoginUrl = (HtmlInputHidden) this.FindControl("hidWeixinLoginUrl");
     SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
     this.hidWeixinNumber.Value = masterSettings.WeixinNumber;
     this.imgWeixin.Src = masterSettings.WeiXinCodeImageUrl;
     PageTitle.AddSiteNameTitle("登录向导");
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:10,代码来源:VLoginGuide.cs


示例5: AttachChildControls

 protected override void AttachChildControls()
 {
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.img = (HtmlImage) this.FindControl("imgDefaultBg");
     this.pager = (Pager) this.FindControl("pager");
     this.litstorename = (Literal) this.FindControl("litstorename");
     this.litdescription = (Literal) this.FindControl("litdescription");
     this.imgback = (HiImage) this.FindControl("imgback");
     this.imglogo = (HiImage) this.FindControl("imglogo");
     this.Page.Session["stylestatus"] = "3";
     SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
     PageTitle.AddSiteNameTitle(masterSettings.SiteName);
     this.litstorename.Text = masterSettings.SiteName;
     this.litdescription.Text = masterSettings.ShopIntroduction;
     if (base.referralId <= 0)
     {
         HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
         if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value)))
         {
             base.referralId = int.Parse(cookie.Value);
         }
     }
     DistributorsInfo userIdDistributors = new DistributorsInfo();
     userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
     if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
     {
         PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
         this.litdescription.Text = userIdDistributors.StoreDescription;
         this.litstorename.Text = userIdDistributors.StoreName;
         if (userIdDistributors.Logo != "")
         {
             this.imglogo.ImageUrl = userIdDistributors.Logo;
         }
         this.imgback.ImageUrl = userIdDistributors.BackImage;
     }
     if (this.rptProducts != null)
     {
         ProductQuery query = new ProductQuery {
             PageSize = this.pager.PageSize,
             PageIndex = this.pager.PageIndex
         };
         DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
         this.rptProducts.DataSource = homeProduct.Data;
         this.rptProducts.DataBind();
         this.pager.TotalRecords = homeProduct.TotalRecords;
         if (this.pager.TotalRecords <= this.pager.PageSize)
         {
             this.pager.Visible = false;
         }
     }
     if (this.img != null)
     {
         this.img.Src = new VTemplateHelper().GetDefaultBg();
     }
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:55,代码来源:VDefault.cs


示例6: AttachChildControls

 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
     {
         base.GotoResourceNotFound("");
     }
     this.bgimg = (HtmlImage) this.FindControl("bgimg");
     this.litActivityDesc = (Literal) this.FindControl("litActivityDesc");
     this.litPrizeNames = (Common_PrizeNames) this.FindControl("litPrizeNames");
     this.litPrizeUsers = (Common_PrizeUsers) this.FindControl("litPrizeUsers");
     this.litStartDate = (Literal) this.FindControl("litStartDate");
     this.litEndDate = (Literal) this.FindControl("litEndDate");
     PageTitle.AddSiteNameTitle("砸金蛋");
     LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);
     if (lotteryActivity == null)
     {
         base.GotoResourceNotFound("");
     }
     if (MemberProcessor.GetCurrentMember() == null)
     {
         MemberInfo member = new MemberInfo();
         string generateId = Globals.GetGenerateId();
         member.GradeId = MemberProcessor.GetDefaultMemberGrade();
         member.UserName = "";
         member.OpenId = "";
         member.CreateDate = DateTime.Now;
         member.SessionId = generateId;
         member.SessionEndTime = DateTime.Now;
         MemberProcessor.CreateMember(member);
         member = MemberProcessor.GetMember(generateId);
         HttpCookie cookie = new HttpCookie("Vshop-Member") {
             Value = member.UserId.ToString(),
             Expires = DateTime.Now.AddYears(10)
         };
         HttpContext.Current.Response.Cookies.Add(cookie);
     }
     this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
     this.litEndDate.Text = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
     if (VshopBrowser.GetUserPrizeCount(this.activityid) >= lotteryActivity.MaxNum)
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>alert_h(\"亲,不好意思您的抽奖机会已经用完了哦,敬请期待下次活动吧!\",function(){window.location.href=\"/vshop/default.aspx\";});</script>");
     }
     if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
     {
         this.litActivityDesc.Text = lotteryActivity.ActivityDesc;
         this.litPrizeNames.Activity = lotteryActivity;
         this.litPrizeUsers.Activity = lotteryActivity;
         int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
         this.litActivityDesc.Text = this.litActivityDesc.Text + string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
     }
     else
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";})</script>");
     }
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:55,代码来源:VSmashEgg.cs


示例7: gvPlayerResults_RowCreated

        protected void gvPlayerResults_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header)
            {
                foreach (TableCell tc in e.Row.Cells)
                {
                    if (tc.HasControls())
                    {
                        LinkButton lnk = (LinkButton)tc.Controls[0];
                        if (lnk != null)
                        {
                            lnk.CssClass = "sortingHeader";
                            lnk.ToolTip = "Posortuj po polu: " + lnk.Text;
                            HtmlGenericControl span = new HtmlGenericControl("span");
                            span.InnerText = lnk.Text;
                            lnk.Controls.Add(span);

                            HtmlImage img = new HtmlImage();

                            object oSortDirection = Session["defaultSortDirection"];
                            object oSortExpression = Session["defaultSortExpression"];

                            if (oSortExpression == null)
                            {
                                if (lnk.Text == "#")
                                    img.Src = Page.ResolveUrl("~/Assets/arrow_asc.png");
                                else
                                    img.Src = Page.ResolveUrl("~/Assets/arrow_Sorting.png");
                            }
                            else
                            {
                                string sortExpression = oSortExpression.ToString();
                                string sortDirection = oSortDirection.ToString();
                                if (string.Compare(sortExpression, lnk.Text) == 0)
                                {
                                    if (sortDirection == SortDirection.Ascending.ToString())
                                        img.Src = Page.ResolveUrl("~/Assets/arrow_asc.png");
                                    else
                                        img.Src = Page.ResolveUrl("~/Assets/arrow_desc.png");
                                }
                                else
                                    img.Src = Page.ResolveUrl("~/Assets/arrow_Sorting.png");
                            }

                            img.Alt = "Posortuj po polu: " + lnk.Text;
                            img.Width = 14;
                            img.Height = 14;
                            lnk.Controls.Add(img);

                        }
                    }
                }
            }
        }
开发者ID:Cybercom-Poland,项目名称:Trambambule,代码行数:54,代码来源:Default.aspx.cs


示例8: AddImageContrl

 private void AddImageContrl(NamedRectangle shp, String type, bool hide)
 {
     HtmlImage image = new HtmlImage();
     image.Src = "resource/en-us/" + type + ".gif";
     image.ID = shp.Name + "_" + type;
     image.Style["Z-INDEX"] = "200";
     image.Style["LEFT"] = String.Format("{0}px", (int)shp.Left - 12);
     image.Style["TOP"] = String.Format("{0}px", (int)shp.Top - 12);
     image.Style["POSITION"] = "absolute";
     image.Style["DISPLAY"] = hide ? "none" : "";
     PlaceHolder.Controls.Add(image);
 }
开发者ID:BGCX261,项目名称:zhoulijinrong-svn-to-git,代码行数:12,代码来源:ProcessViewer.aspx.cs


示例9: DefaultProperties

		public void DefaultProperties ()
		{
			HtmlImage img = new HtmlImage ();
			Assert.AreEqual (0, img.Attributes.Count, "Attributes.Count");

			Assert.AreEqual (String.Empty, img.Align, "Align");
			Assert.AreEqual (String.Empty, img.Alt, "Alt");
			Assert.AreEqual (-1, img.Border, "Border");
			Assert.AreEqual (-1, img.Height, "Height");
			Assert.AreEqual (String.Empty, img.Src, "Src");
			Assert.AreEqual (-1, img.Width, "Width");

			Assert.AreEqual ("img", img.TagName, "TagName");
		}
开发者ID:nobled,项目名称:mono,代码行数:14,代码来源:HtmlImageTest.cs


示例10: AddTo

        public override Control AddTo(Control container, PluginContext context)
        {
            if(!ActiveFor(container, context.State))
                return null;

            HtmlImage img = new HtmlImage();
            img.Src = Engine.ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Resources/Img/separator.png");
            img.Attributes["class"] = "separator";
            img.Height = 16;
            img.Width = 1;
            img.Alt = "|";
            container.Controls.Add(img);
            return img;
        }
开发者ID:EzyWebwerkstaden,项目名称:n2cms,代码行数:14,代码来源:ControlPanelSeparatorAttribute.cs


示例11: generateDevice

        private HtmlGenericControl generateDevice(Device device, DatabaseEntities db)
        {
            var brandQuery = db.Brands.Where(b => b.brand_id == device.brand_id);
            var brand = brandQuery.FirstOrDefault<Brand>();

            var operatingSystemQuery = db.OperatingSystems.Where(b => b.operating_system_id == device.operating_system_id);
            var operatingSystem = operatingSystemQuery.FirstOrDefault<OperatingSystem>();

            var displayQuery = db.Displays.Where(b => b.display_id == device.display_id);
            var display = displayQuery.FirstOrDefault<Display>();

            HtmlGenericControl deviceDiv = new HtmlGenericControl("DIV");
            deviceDiv.Attributes["class"] = "device";

            //HtmlGenericControl anchorFirst = new HtmlGenericControl("a");
            HtmlAnchor anchorFirst = new HtmlAnchor();
            anchorFirst.HRef = String.Format("~/device.aspx?id={0}", device.device_id);

            HtmlImage img = new HtmlImage();
            img.Src = String.Format("~/images/{0}/{1} {2} .jpg", brand.name, brand.name, device.device_name);

            anchorFirst.Controls.Add(img);

            HtmlGenericControl h2 = new HtmlGenericControl("h2");
            //HtmlGenericControl anchorSecond = new HtmlGenericControl("a");
            HtmlAnchor anchorSecond = new HtmlAnchor();
            anchorSecond.HRef = String.Format("~/device.aspx?id={0}", device.device_id);
            anchorSecond.InnerText = String.Format("{0} {1}", brand.name, device.device_name);
            h2.Controls.Add(anchorSecond);

            HtmlGenericControl p = new HtmlGenericControl("p");
            p.InnerText = String.Format("{0}, экран {1}, {2} ( {3} ), ОЗУ {4}, аккумулятор {5}",
                operatingSystem.name, device.screen_size, display.type, device.screen_resolution, device.ram, device.battery_capacity);

            HtmlGenericControl clrDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
            clrDiv.Attributes["class"] = "clr";

            HtmlGenericControl priceDiv = new HtmlGenericControl("DIV");
            priceDiv.Attributes["class"] = "price";
            priceDiv.InnerText = String.Format("{0}", device.price);

            deviceDiv.Controls.Add(anchorFirst);
            deviceDiv.Controls.Add(h2);
            deviceDiv.Controls.Add(p);
            deviceDiv.Controls.Add(clrDiv);
            deviceDiv.Controls.Add(priceDiv);

            return deviceDiv;
        }
开发者ID:encode481,项目名称:CourseWorkPSP,代码行数:49,代码来源:Default.aspx.cs


示例12: OnInit

        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            phExternalLogins.Controls.Clear();

            // Look for active external authentication providers
            foreach ( var serviceEntry in AuthenticationContainer.Instance.Components )
            {
                var component = serviceEntry.Value.Value;

                if ( component.IsActive && component.RequiresRemoteAuthentication )
                {
                    string loginTypeName = component.GetType().Name;

                    // Check if returning from third-party authentication
                    if ( !IsPostBack && component.IsReturningFromAuthentication( Request ) )
                    {
                        string userName = string.Empty;
                        string returnUrl = string.Empty;
                        if ( component.Authenticate( Request, out userName, out returnUrl ) )
                        {
                            LoginUser( userName, returnUrl, false );
                            break;
                        }
                    }

                    LinkButton lbLogin = new LinkButton();
                    phExternalLogins.Controls.Add( lbLogin );
                    lbLogin.AddCssClass( "btn btn-authenication " + loginTypeName.ToLower() );
                    lbLogin.ID = "lb" + loginTypeName + "Login";
                    lbLogin.Click += lbLogin_Click;
                    lbLogin.CausesValidation = false;

                    if ( !String.IsNullOrWhiteSpace( component.ImageUrl() ) )
                    {
                        HtmlImage img = new HtmlImage();
                        lbLogin.Controls.Add( img );
                        img.Attributes.Add( "style", "border:none" );
                        img.Src = Page.ResolveUrl( component.ImageUrl() );
                    }
                    else
                    {
                        lbLogin.Text = "Login Using " + loginTypeName;
                    }
                }
            }
        }
开发者ID:pkdevbox,项目名称:Rock,代码行数:52,代码来源:Login.ascx.cs


示例13: RenderContents

        protected override void RenderContents()
        {
            HtmlGenericControl contents = new HtmlGenericControl("div");
            contents.ID = "contents";

            HtmlGenericControl h1 = new HtmlGenericControl("h1");
            h1.InnerText = "Requests by Browser Type";
            contents.Controls.Add(h1);

            Chart browsersChart = new Chart();
            browsersChart.ImageStorageMode = ImageStorageMode.UseHttpHandler;
            browsersChart.Width = 500;
            browsersChart.Height = 500;
            browsersChart.Titles.Add("Requests by Browser Type");

            //contents.Controls.Add(browsersChart);

            // This is the most important part, and the departure from using any custom classes or Futures library.

            //// Simply use a MemoryStream to save the chart.
            //MemoryStream imageStream = new MemoryStream();
            //browsersChart.SaveImage(imageStream, ChartImageFormat.Png);

            //// Reset the stream’s pointer back to the start of the stream.
            //imageStream.Seek(0, SeekOrigin.Begin);

            // return the normal FileResult available in the current release of MVC

            browsersChart.RenderType = RenderType.ImageTag;
            browsersChart.ImageLocation = "~/MyChart.png";

            browsersChart.SaveImage(Server.MapPath("~/MyChart.png"), ChartImageFormat.Png);

            HtmlImage chart = new HtmlImage();
            chart.ID = "browsers chart";
            chart.Src = Request.ApplicationPath + "/MyChart.png";
            chart.Height = 500;
            chart.Width = 500;

            contents.Controls.Add(chart);

            //contents.Controls.Add(browsersChart);

            //browsersChart.SaveImage(Response.OutputStream, ChartImageFormat.Png);
            //Response.End();

            _body.Controls.Add(contents);
        }
开发者ID:tresat,项目名称:LogEm,代码行数:48,代码来源:BrowsersByRequestPage.cs


示例14: Page_Load

        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            cornerImage.ImageUrl="images/style" + CssStyleNum.ToString() + "/tab_corn.gif";
            cornerImage.CssClass="t_act";

            if (IsRoot==true)
            {
                Table.Rows[0].Cells[0].CssClass="t_white";
                Table.Rows[0].Cells[1].CssClass="t_white";

                if(EnableLogoutButton==true && IsRoot==true)
                {
                    System.Web.UI.WebControls.Literal capt=new System.Web.UI.WebControls.Literal();
                    capt.Text=WelcomeNote + "&nbsp;&nbsp;";
                    System.Web.UI.HtmlControls.HtmlAnchor anch=new System.Web.UI.HtmlControls.HtmlAnchor();
                    anch.HRef=LogoutHref;
                    System.Web.UI.HtmlControls.HtmlImage img=new System.Web.UI.HtmlControls.HtmlImage();
                    img.Alt="Logout";
                    img.Src="images/logout.gif";
                    img.Border=0;
                    anch.Controls.Add(img);
                    Table.Rows[0].Cells[0].HorizontalAlign=System.Web.UI.WebControls.HorizontalAlign.Right;
                    Table.Rows[0].Cells[0].Controls.Add(capt);
                    Table.Rows[0].Cells[1].Controls.Add(anch);
                }

                Table.Rows[0].Cells[2].CssClass="t_white";

            }
            else
            {
                Table.Rows[0].Cells[0].CssClass="t_act";
                Table.Rows[0].Cells[1].CssClass="t_act";
                Table.Rows[0].Cells[2].CssClass="t_act";
            }

            Table.Rows[1].Cells[0].CssClass="t_white";
            Table.Rows[1].Cells[1].CssClass="t_white";
            Table.Rows[1].Cells[2].CssClass="t_white";

            Table.Rows[2].Cells[0].CssClass="t_act";
            Table.Rows[2].Cells[1].CssClass="t_act";
            Table.Rows[2].Cells[2].CssClass="t_act";
        }
开发者ID:GermanGlushkov,项目名称:FieldInformer,代码行数:46,代码来源:Space.ascx.cs


示例15: NullProperties

		public void NullProperties ()
		{
			HtmlImage img = new HtmlImage ();

			img.Align = null;
			Assert.AreEqual (String.Empty, img.Align, "Align");
			img.Alt = null;
			Assert.AreEqual (String.Empty, img.Alt, "Alt");
			img.Border = -1;
			Assert.AreEqual (-1, img.Border, "Border");
			img.Height = -1;
			Assert.AreEqual (-1, img.Height, "Height");
			img.Src = null;
			Assert.AreEqual (String.Empty, img.Src, "Src");
			img.Width = -1;
			Assert.AreEqual (-1, img.Width, "Width");

			Assert.AreEqual (0, img.Attributes.Count, "Attributes.Count");
		}
开发者ID:nobled,项目名称:mono,代码行数:19,代码来源:HtmlImageTest.cs


示例16: AttachChildControls

 protected override void AttachChildControls()
 {
     int num;
     int num2;
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound("");
     }
     ProductConsultationAndReplyQuery consultationQuery = new ProductConsultationAndReplyQuery();
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     consultationQuery.ProductId = this.productId;
     consultationQuery.IsCount = true;
     consultationQuery.PageIndex = num;
     consultationQuery.PageSize = num2;
     consultationQuery.SortBy = "ConsultationId";
     consultationQuery.SortOrder = SortAction.Desc;
     consultationQuery.HasReplied = true;
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(consultationQuery);
     this.rptProducts.DataSource = productConsultations.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productConsultations.TotalRecords.ToString());
     this.litProductTitle = (Literal) this.FindControl("litProductTitle");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litSoldCount = (Literal) this.FindControl("litSoldCount");
     this.litSalePrice = (Literal) this.FindControl("litSalePrice");
     this.imgProductImage = (HtmlImage) this.FindControl("imgProductImage");
     ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
     this.litProductTitle.SetWhenIsNotNull(product.ProductName);
     this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
     this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
     this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
     this.imgProductImage.Src = product.ThumbnailUrl60;
     PageTitle.AddSiteNameTitle("商品咨询");
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:43,代码来源:VProductConsultations.cs


示例17: OnTagProcessed

        protected override void OnTagProcessed(HtmlGenericControl tag)
        {
            HtmlImage image = new HtmlImage();
            image.Src = tag.Attributes["src"];
            if (BaseHref != null)
            {
                image.Src = HtmlUriExtractor.TryCreate(BaseHref, image.Src);
            }
            image.Alt = tag.Attributes["alt"];

            int width = 0;
            if (int.TryParse(tag.Attributes["width"], out width))
                image.Width = width;

            int height = 0;
            if (int.TryParse(tag.Attributes["height"], out height))
                image.Height = height;

            mImages.Add(image);
        }
开发者ID:dblock,项目名称:sncore,代码行数:20,代码来源:HtmlImageExtractor.cs


示例18: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     string request = Request.QueryString["image"];
     if (request.Contains(".jpg"))
     {
         HtmlImage hi = new HtmlImage();
         hi.Src = "Effect/WallPapers/" + request;
         hi.Alt = "Full Size WallPaper of " + request;
         ScreenshotPlaceholder.Controls.Add(hi);
     }
     else
     {
         HtmlAnchor ha = new HtmlAnchor();
         ha.HRef = "javascript:alert(&quot;No fooling around the site, buddy. Zasz Rules!&quot;)";
         ha.InnerText = "Security Warning";
         HtmlGenericControl hgc = new HtmlGenericControl("h1");
         hgc.Controls.Add(ha);
         ScreenshotPlaceholder.Controls.Add(hgc);
     }
 }
开发者ID:chandru9279,项目名称:StarBase,代码行数:20,代码来源:FullWallpaper.aspx.cs


示例19: CreateOpinionInfo

		private void CreateOpinionInfo(GenericOpinion opinion)
		{
			HtmlTable table = new HtmlTable();

			table.Style["border"] = "1px solid #efae27";
			table.Style[HtmlTextWriterStyle.BackgroundColor] = "#ffffe8";
			table.Width = "100%";

			Controls.Add(table);

			HtmlTableRow row = new HtmlTableRow();

			table.Controls.Add(row);

			HtmlTableCell cellLeft = new HtmlTableCell();

			row.Controls.Add(cellLeft);

			HtmlTableCell cellRight = new HtmlTableCell();

			cellRight.Align = "right";

			row.Controls.Add(cellRight);

			HtmlImage logo = new HtmlImage();

			logo.Src = ControlResources.CancelledLogoUrl;
			logo.Align = "absmiddle";
			logo.Alt = "流程被作废";

			cellLeft.Controls.Add(logo);

			HtmlGenericControl span = new HtmlGenericControl("span");

			span.InnerHtml = HttpUtility.HtmlEncode(opinion.Content).Replace("\n", "<br/>");

			cellLeft.Controls.Add(span);

			cellRight.InnerText = opinion.IssuePerson.DisplayName + " " +
				string.Format("{0:yyyy-MM-dd HH:mm:ss}", opinion.IssueDatetime);
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:41,代码来源:WfAbortOpinionDisplayControl.cs


示例20: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Classes.Database objDB = new Classes.Database();

            SqlDataReader allProducts = objDB.getData("select top 10 * from products where status='active'");

            if (allProducts != null)
            {
                HtmlTable myTable = new HtmlTable();

                while (allProducts.Read())
                {
                    HtmlTableRow myRow = new HtmlTableRow();
                    myTable.Rows.Add(myRow);

                    HtmlTableCell myCell = new HtmlTableCell();
                    myCell.InnerText = "";

                    if (allProducts["image"].ToString() != null)
                    {
                        HtmlImage profilePic = new HtmlImage();
                        profilePic.Height = 50;
                        profilePic.Width = 50;
                        profilePic.Src = "http://" + Request.Url.Authority + "/uploads/" + allProducts["image"].ToString();
                        myCell.Controls.Add(profilePic);
                    }
                    myRow.Cells.Add(myCell);

                    myCell = new HtmlTableCell();
                    myCell.InnerHtml = "<b><u><a href=Product/View-Product.aspx?id=" + allProducts["ID"] + " >" + allProducts["name"].ToString() + "</a></u></b><br>"
                                        + allProducts["description"].ToString();

                    myRow.Cells.Add(myCell);
                }

                objDB.close();
                pnlProduct.Controls.Add(myTable);

            }
        }
开发者ID:shubhamgupta28,项目名称:EshopeePortal,代码行数:40,代码来源:Default.aspx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# HtmlControls.HtmlInputButton类代码示例发布时间:2022-05-26
下一篇:
C# HtmlControls.HtmlGenericControl类代码示例发布时间: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