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


C# HyperLink类代码示例

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


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

示例1: BuildNavigationAdmin

    // Modify for Admin
    // render navigation on admin side
    public void BuildNavigationAdmin(int categoryID)
    {
        pnlNavi.Controls.Clear();
        var hlM = new HyperLink
                     {
                         NavigateUrl = UrlService.GetAdminAbsoluteLink("catalog.aspx?CategoryID=0"),
                         CssClass = "Link",
                         Text = Resource.Client_MasterPage_Catalog
                     };
        pnlNavi.Controls.Add(hlM);
        var categoryList = CategoryService.GetParentCategories(categoryID);
        for (var i = categoryList.Count - 1; i >= 0; i--)
        {
            var lblSeparator = new Label { CssClass = "Link", Text = @" > " };

            pnlNavi.Controls.Add(lblSeparator);

            var hl = new HyperLink
            {
                NavigateUrl = UrlService.GetAdminAbsoluteLink("catalog.aspx?CategoryID=" + categoryList[i].CategoryId),
                CssClass = "Link",
                Text = SQLDataHelper.GetString(categoryList[i].Name)
            };
            pnlNavi.Controls.Add(hl);
        }
    }
开发者ID:AzarinSergey,项目名称:learn,代码行数:28,代码来源:SiteNavigation.ascx.cs

示例2: projectRepeater_ItemDataBound

    // Project repeater data bound
    void projectRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        BusinessLogic.Project project = (BusinessLogic.Project)e.Item.DataItem;
        HtmlGenericControl imageContainer = (HtmlGenericControl)e.Item.FindControl("imgContainer");

        // Get project thumbnail
        HyperLink projectLink = new HyperLink();
        projectLink.NavigateUrl = "/give/projects/" + project.SeoURL;

        Image projectImage = new Image();
        projectImage.CssClass = "shadow";

        var thumbnail = project.RelatedMedias.FirstOrDefault(x => x.MediaType.Type == "Thumbnail");

        if (thumbnail != null)
        {
            projectImage.ImageUrl = ResolveUrl(thumbnail.URL);
            projectImage.AlternateText = thumbnail.DescriptionOrAltText;
        }
        else // Thumbnail not provided
        {
            projectImage.ImageUrl = ResolveUrl("~/Images/Project/NoImageProvided.jpg");
        }

        // Add image to container
        projectLink.Controls.Add(projectImage);
        imageContainer.Controls.Add(projectLink);
    }
开发者ID:OneMissionSociety,项目名称:OMS-Corporate-Website,代码行数:29,代码来源:Project.aspx.cs

示例3: AddSiteCellInnerHTML

 private HtmlTableCell AddSiteCellInnerHTML(string name, string banner, string url)
 {
     HtmlTableCell cell = new HtmlTableCell();
     Panel pnl = new Panel();
     pnl.CssClass = "sitesbanerhome";
     if(IsSitePage)
     {
         pnl.CssClass = "sitespagebaner";
     }
     HyperLink hl = new HyperLink();
     hl.NavigateUrl = url;
     hl.Attributes["rel"] = "nofollow";
     hl.Target = "_blank";
     if (banner != "")
     {
         Image i = new Image();
         i.ImageUrl = Path.Combine(Utils.GaleryImagePath, banner);
         hl.Controls.Add(i);
     }
     else
     {
         hl.Text = name;
     }
     pnl.Controls.Add(hl);
     cell.Controls.Add(pnl);
     return cell;
 }
开发者ID:ivladyka,项目名称:OurTravels,代码行数:27,代码来源:SiteTableView.ascx.cs

示例4: Create

 public static HyperLink Create(string Path, string Text, string Content)
 {
     var link = new HyperLink(ROOT, Path);
     link.Text = Text;
     link.Content = Content;
     return link;
 }
开发者ID:iinteractive,项目名称:IInteractive.WebTest,代码行数:7,代码来源:TestHyperLink.cs

示例5: cargar_botones_internos

    private void cargar_botones_internos()
    {
        TableRow filaTabla;
        TableCell celdaTabla;
        HyperLink link;
        Image imagen;

        int contadorFilas = 0;

        filaTabla = new TableRow();
        filaTabla.ID = "row_" + contadorFilas.ToString();

        celdaTabla = new TableCell();
        celdaTabla.ID = "cell_1_row_" + contadorFilas.ToString();
        link = new HyperLink();
        link.ID = "link_salir";
        link.NavigateUrl = "javascript:window.close();";
        link.CssClass = "botones_menu_principal";
        imagen = new Image();
        imagen.ImageUrl = "~/imagenes/areas/bMenuSalirEstandar.png";
        imagen.Attributes.Add("onmouseover", "this.src='../imagenes/areas/bMenuSalirAccion.png'");
        imagen.Attributes.Add("onmouseout", "this.src='../imagenes/areas/bMenuSalirEstandar.png'");
        imagen.CssClass = "botones_menu_principal";
        link.Controls.Add(imagen);

        celdaTabla.Controls.Add(link);

        filaTabla.Cells.Add(celdaTabla);

        Table_MENU.Rows.Add(filaTabla);
    }
开发者ID:jquirogadesarrollador,项目名称:Varu_Original,代码行数:31,代码来源:controlCumplimientoAnno.aspx.cs

示例6: setTable

    protected void setTable()
    {
        DataTable myDataTable = new DataTable();
        JobsModule myJobsModule = new JobsModule();
        myJobsModule.setUserId((String)Session["userId"]);

        myDataTable = myJobsModule.getEmployersJobPositions().Copy();

        myDataTable.Columns.Add("Delete", typeof(String)).SetOrdinal(0);
        myDataTable.Columns.Add("List of Applied Applicants", typeof(String)).SetOrdinal(4);

        JobPositionsGridView.DataSource = myDataTable;
        JobPositionsGridView.DataBind();

        foreach (GridViewRow row in JobPositionsGridView.Rows)
        {
            LinkButton lb = new LinkButton();
            lb.Text = "Delete";
            lb.Click += new EventHandler(LinkButtonClicked);
            row.Cells[0].Controls.Add(lb);

            HyperLink hp = new HyperLink();
            hp.Text = row.Cells[2].Text;
            hp.NavigateUrl = "~/ShowJobPositionsManager.aspx?pId=" + row.Cells[1].Text;
            row.Cells[2].Controls.Add(hp);

            HyperLink hp2 = new HyperLink();
            hp2.Text = "Show Applied Applicants";
            hp2.NavigateUrl = "~/ListOfAppliedApplicants.aspx?pId=" + row.Cells[1].Text;
            row.Cells[4].Controls.Add(hp2);
        }
    }
开发者ID:lilylakshi,项目名称:second-year-group-project,代码行数:32,代码来源:ViewEmployersJobPositions.aspx.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (projects_directory == null)
        {
            projects_directory = new Panel();

            // Generate Projects Row (bottom projects directory) based on contents of Projects folder
            string[] files = { "ConcurrentContainers", "WiiMotion", "GameBoyEmulator", "SerializeQueue", "BubbleGrow", "GreyWeaver", "PreviewLite" };
            foreach (string file_name in files)
            {
                Panel panel = new Panel();
                panel.CssClass = "col-sm-3 col-xs-6";

                HyperLink link = new HyperLink();
                link.NavigateUrl = "~/Projects/" + file_name + ".aspx";

                Image image = new Image();
                image.CssClass = "img-responsive portfolio-item";
                image.ImageUrl = "~/data/" + file_name + ".png";

                link.Controls.Add(image);
                panel.Controls.Add(link);
                projects_directory.Controls.Add(panel);
            }
        }

        ProjectsRow.Controls.Add(projects_directory);
    }
开发者ID:Salgat,项目名称:Personal-Website-DEPRECATED,代码行数:28,代码来源:MasterPage_Projects.master.cs

示例8: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string ContentID = Request.QueryString["ContentID"].ToString();
        OA.OAService service=new OA.OAService();
        DataSet ds = service.FileContent_Select("Subject,Content,Attachment_ID,Attachment_Name", "Content_ID=" + ContentID, "");
        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            lblText.Text = ds.Tables[0].Rows[0]["Subject"].ToString();
            tdContent.InnerHtml = ds.Tables[0].Rows[0]["Content"].ToString();

            // 添加附件信息
            string strDirName = ds.Tables[0].Rows[0]["Attachment_ID"].ToString();
            string strFiles = ds.Tables[0].Rows[0]["Attachment_Name"].ToString();

            string[] strfile = strFiles.Split('*');
            for (int i = 0; i < strfile.Length; i++)
            {
                // ../../OA/News/092/ckmsg.txt
                HyperLink hl = new HyperLink();
                string strPath = "..\\..\\..\\Attachment\\Files\\" + strDirName + "\\" + strfile[i];
                hl.NavigateUrl = strPath;
                hl.Text = strfile[i];
                hl.Style.Add("cursor", "hand");
                hl.Style.Add("font-Size", "14px");
                hl.Target = "black";
                DivAnnex.Controls.Add(hl);
                Label lbl = new Label();
                lbl.Width = 20;
                DivAnnex.Controls.Add(lbl);
            }
        }
    }
开发者ID:dalinhuang,项目名称:128Web,代码行数:32,代码来源:Read.aspx.cs

示例9: submitComment

    protected void submitComment(object sender, EventArgs e)
    {
        //Connection String
        string connString = System.Configuration.ConfigurationManager.ConnectionStrings["database"].ConnectionString;
        string query = "UPDATE studentAssignments set checked='yes',[email protected] WHERE [email protected] AND [email protected]";

        //Get Connection
        SqlConnection conn = new SqlConnection(connString);
        conn.Open();

        SqlCommand cmd = new SqlCommand();
        cmd.Parameters.AddWithValue("@comment", comments.Text);
        cmd.Parameters.AddWithValue("@userid", Context.Request["userid"]);
        cmd.Parameters.AddWithValue("@id", Context.Request["id"]);
        cmd.Connection = conn;
        cmd.CommandText = query;
        cmd.ExecuteNonQuery();

        conn.Close();

        submittedGrade.Controls.Clear();

        HyperLink hl1 = new HyperLink();

        submittedGrade.Controls.Add(new LiteralControl("<br/> Comment Submitted Successfully<br/>"));
        hl1.NavigateUrl = "~/ta/studentAssignments.aspx";
        hl1.Text = "Go Back";
        submittedGrade.Controls.Add(hl1);
    }
开发者ID:htyfifa,项目名称:digicourse,代码行数:29,代码来源:submitComment.aspx.cs

示例10: OnPreRender

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

        MonkData db = new MonkData();
        foreach(PropertyInfo tablePInfo in db.GetType().GetProperties())
        {
            Type[] genericTypes = tablePInfo.PropertyType.GetGenericArguments();
            if(genericTypes.Count() < 1)
                continue;

            if(!CanUserAccessTable(genericTypes[0].Name, false, ref db))
            {
                continue;
            }

            HyperLink hlTypeEdit = new HyperLink();
            hlTypeEdit.NavigateUrl = "AddEdit.aspx?typename=" + genericTypes[0].Name;
            hlTypeEdit.Text = "Add " + GetFieldNameFromString( tablePInfo.Name);
            plcAddItemsList.Controls.Add(hlTypeEdit);

            Literal litLineBreak = new Literal();
            litLineBreak.Text = "<br />";
            plcAddItemsList.Controls.Add(litLineBreak);

            HyperLink hlTypeGridView = new HyperLink();
            hlTypeGridView.NavigateUrl = "GridView.aspx?typename=" + genericTypes[0].Name;
            hlTypeGridView.Text = GetFieldNameFromString( tablePInfo.Name);
            plcViewItems.Controls.Add(hlTypeGridView);

            Literal litLineBreakGridView = new Literal();
            litLineBreakGridView.Text = "<br />";
            plcViewItems.Controls.Add(litLineBreakGridView);
        }
    }
开发者ID:vsrz,项目名称:CS498,代码行数:35,代码来源:Admin-AllTables.aspx.cs

示例11: RowDataBound

    public void RowDataBound(object sender, GridRowEventArgs e)
    {
        if (e.Row.RowType == GridRowType.DataRow)
        {
            if (lastGroupHeader != null)
            {
                Literal textContainer = lastGroupHeader.Cells[0].Controls[0].Controls[lastGroupHeader.Cells[0].Controls[0].Controls.Count - 1].Controls[0] as Literal;
                textContainer.Text = ((GridDataControlFieldCell)e.Row.Cells[2]).Text;

                textContainer.Text += "&#160;&#187;&#160;";

                HyperLink link = new HyperLink();
                link.CssClass = "header-link";
                link.Attributes["onclick"] = "alert('In a real application the category form should open.')";
                link.NavigateUrl = "aspnet_grouping_custom_headers.aspx?CategoryID=" + ((GridDataControlFieldCell)e.Row.Cells[1]).Text;
                link.Text = "Edit Category";

                textContainer.Parent.Controls.Add(link);

                lastGroupHeader = null;
            }            
            
        }
        else if (e.Row.RowType == GridRowType.GroupHeader)
        {
            if (e.Row.GroupLevel == 0)
            {
                lastGroupHeader = e.Row;
            }
        }
        
    }
开发者ID:veraveramanolo,项目名称:power-show,代码行数:32,代码来源:aspnet_grouping_custom_headers.aspx.cs

示例12: AddUrls

    protected void AddUrls(string strAppKey, string strName, string strIcon, int count)
    {
        HyperLink link = new HyperLink();
          
        link.ID = "CentrifyApp" + count;
        link.NavigateUrl = Session["NewPodURL"].ToString() + CentRunAppURL + strAppKey + "&Auth=" + Session["OTP"].ToString();
        link.Text = strName;

        //If image is unsecured global
        if (strIcon.Contains("vfslow"))
        {
            link.ImageUrl = Session["NewPodURL"].ToString() + strIcon;
        }
        else//If image needs a cookie or header to access
        {
            link.ImageUrl = "Helpers/GetSecureImage.aspx?Icon=" + strIcon;
        }
       
        link.ImageHeight = 75;
        link.ImageWidth = 75;

        if (count % 7 == 0)
        {
            Apps.Controls.Add(new LiteralControl("<br />"));
        }
        else
        {
            Apps.Controls.Add(new LiteralControl("&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"));

        }

        Apps.Controls.Add(link);
    }
开发者ID:erajsiddiqui,项目名称:CentrifyAPIExamples_APIDemoWebsite,代码行数:33,代码来源:Apps.aspx.cs

示例13: getLatestProducts

    //gets the first 8 products in the products list and displays them on the latest products section
    public void getLatestProducts()
    {
        List<Product> p = (List<Product>)Session["Products"];

        try
        {
            for (int i = 0; i < 8; i++)
            {
                Product product = p[i];
                Image img = new Image();
                HyperLink link = new HyperLink();
                HtmlGenericControl a = new HtmlGenericControl("a");
                HtmlGenericControl newLi = new HtmlGenericControl("li");

                string prodID = Convert.ToString(product.ProdID);

                img.ImageUrl = product.ProdImage;
                img.ID = prodID;

                link.NavigateUrl = "Product.aspx?id=" + prodID;
                link.Controls.Add(img);

                newLi.Controls.Add(link);

                latestProducts.Controls.Add(newLi);
            }
        }
        catch (Exception)
        {

        }
    }
开发者ID:nelson9,项目名称:LidiFlu,代码行数:33,代码来源:Default.aspx.cs

示例14: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Unload += PageUnload;

        ronUtil2 get = new ronUtil2();

        DropDownList1.DataSource = get.getStudentIds();
        if(!IsPostBack)
        DropDownList1.DataBind();

        int[] ID = get.getAdvisorIDs();

        for (int ii = 0; ii < ID.Length; ii++)
        {
            TableCell[] td = new TableCell[8];
            HyperLink link = new HyperLink();
            link.NavigateUrl = "~/Schedule.aspx?AdvisorID=" + ID[ii];
            for (int i = 0; i < 8; i++) { td[i] = new TableCell(); }

            link.Text = get.getName(ID[ii]);
            link.ForeColor=System.Drawing.Color.Yellow;
        //    link.Font.Bold = true;
            td[0].Controls.Add(link);
            td[1].Text = get.getDepartment(ID[ii]);
            td[2].Text = get.getMonday(ID[ii]);
            td[3].Text = get.getTuesday(ID[ii]);
            td[4].Text = get.getWednesday(ID[ii]);
            td[5].Text = get.getThursday(ID[ii]);
            td[6].Text = get.getFriday(ID[ii]);

            TableRow tRow = new TableRow();
            myTable.Rows.Add(tRow);
            tRow.Cells.AddRange(td);
        }
    }
开发者ID:svarinder,项目名称:AdvisorBooking,代码行数:35,代码来源:Advisor.aspx.cs

示例15: SetUserInGroupInfo

    private void SetUserInGroupInfo(User user)
    {
        int[] groups = user.Groups;
        for (int i = 0; i < groups.Length; i++)
        {
            Group group = AdminServer.TheInstance.SecurityManager.GetGroup(groups[i]);

            TableRow row = new TableRow();
            TableCell cell = new TableCell();
            HyperLink linkRemoveGroup = new HyperLink();
            linkRemoveGroup.NavigateUrl = "UserGroup.aspx?userId=" + _user.SecurityObject.Id + "&groupId=" + group.SecurityObject.Id;
            linkRemoveGroup.Text = StringDef.Remove;
            linkRemoveGroup.SkinID = "SmallButton";
            cell.Controls.Add(linkRemoveGroup);
            row.Cells.Add(cell);
            cell = new TableCell();
            cell.Text = (i + 1).ToString();
            row.Cells.Add(cell);
            cell = new TableCell();
            cell.Text = group.SecurityObject.Id.ToString();
            row.Cells.Add(cell);
            cell = new TableCell();
            HyperLink linkEditGroup = new HyperLink();
            linkEditGroup.NavigateUrl = "EditGroup.aspx?groupId=" + group.SecurityObject.Id;
            linkEditGroup.Text = group.SecurityObject.Name;
            linkEditGroup.SkinID = "PlainText";
            cell.Controls.Add(linkEditGroup);
            row.Cells.Add(cell);
            cell = new TableCell();
            cell.Text = group.SecurityObject.Comment;
            row.Cells.Add(cell);

            TableUserInGroup.Rows.Add(row);
        }
    }
开发者ID:viticm,项目名称:pap2,代码行数:35,代码来源:EditUser.aspx.cs


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