當前位置: 首頁>>代碼示例>>C#>>正文


C# HtmlControls.HtmlImage類代碼示例

本文整理匯總了C#中System.Web.UI.HtmlControls.HtmlImage的典型用法代碼示例。如果您正苦於以下問題:C# HtmlImage類的具體用法?C# HtmlImage怎麽用?C# HtmlImage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HtmlImage類屬於System.Web.UI.HtmlControls命名空間,在下文中一共展示了HtmlImage類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.Web.UI.HtmlControls.HtmlImage類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。