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

C# HyperLink类代码示例

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

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



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


示例16: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        int itemid = Convert.ToInt16(Session["ItemID"]);

        SqlDataSource1.SelectCommand = "select image from newsitemsimages where id = " + itemid;
        DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
        if (dv.Table.Rows.Count != 0)
        {            
            Panel big_img = new Panel();
            big_img.Style.Add("float", "left");
            big_img.ID = "bigimg";
            Image big_img_url = new Image();
            big_img_url.ImageUrl = dv.Table.Rows[0][0].ToString();
            big_img.Controls.Add(big_img_url);
            picture.Controls.Add(big_img);
        }
        if (dv.Table.Rows.Count > 1) {
            Panel small_img = new Panel();
            small_img.Style.Add("float", "left");
            small_img.Style.Add("height", "70px");
            small_img.Style.Add("width", "255px");
            small_img.Style.Add("overflow-y", "scroll");
            small_img.ID = "smallimg";

            for (int i = 0; i < dv.Table.Rows.Count; i++)
            {
                HyperLink link = new HyperLink();
                link.NavigateUrl = "#";
                Image small_img_url = new Image();
                small_img_url.ImageUrl = dv.Table.Rows[i][0].ToString();
                link.Controls.Add(small_img_url);
                small_img.Controls.Add(link);
    
                //smallimg.Controls.Add(small_img); <div id="smallimg" style="float: left; height: 70px; width: 255px; overflow-y: scroll">
            }
            picture.Controls.Add(small_img);
        }

        SqlDataSource1.SelectCommand = "select content, price, gid, name from NewsItems where id = " + itemid;
        dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
        Div1.InnerText = dv.Table.Rows[0][0].ToString();
        Label3.Text = "$" + dv.Table.Rows[0][1].ToString();
        product_name.InnerText = "Product Detail for " + dv.Table.Rows[0][3];

        Session.Add("GID", dv.Table.Rows[0][2]);

        SqlDataSource1.SelectCommand = "select Poster, Content from comments where PostID = " + itemid + " order by Date DESC";
        dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
        foreach (DataRow comment in dv.Table.Rows)
        {
            TableRow row = new TableRow();
            TableCell name = new TableCell();
            TableCell text = new TableCell();
            name.Text = comment[0].ToString();
            text.Text = comment[1].ToString();
            row.Cells.Add(name);
            row.Cells.Add(text);
            comment_table.Rows.Add(row);
        }
    }
开发者ID:pddpp,项目名称:Online-Shopping-and-Networking-Website,代码行数:60,代码来源:ProductDetail.aspx.cs


示例17: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //Connection String
        string connString = System.Configuration.ConfigurationManager.ConnectionStrings["database"].ConnectionString;
        SqlConnection conn = new SqlConnection(connString);
        string query = "SELECT * FROM Announcement ORDER BY date DESC, Time DESC";
        SqlCommand cmd2 = new SqlCommand();
        cmd2.Connection = conn;
        cmd2.CommandText = query;

        conn.Open();

        var reader2 = cmd2.ExecuteReader();

        while (reader2.Read())
        {
            string date = reader2["date"].ToString();
            Announcements.Controls.Add(new LiteralControl("<br/><b>" + reader2["announcement"].ToString() + "</b><br/>"));
            Announcements.Controls.Add(new LiteralControl("<br/>Date:&nbsp;&nbsp;" + date.Substring(0, 9) + "&nbsp;&nbsp;" + reader2["time"].ToString() + "<br/><br/><hr/>"));

            //Delete
            HyperLink hl1 = new HyperLink();
            hl1.ID = reader2["id"].ToString();
            hl1.Text = "Delete";
            hl1.CssClass = "more-link";
            hl1.NavigateUrl = "~/professor/deleteAnnouncements.aspx?id=" + reader2["id"].ToString();
            Announcements.Controls.Add(hl1);
            Announcements.Controls.Add(new LiteralControl("</br></br>"));
        }
    }
开发者ID:htyfifa,项目名称:digicourse,代码行数:30,代码来源:announcements.aspx.cs


示例18: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string absPath = MapPath("~/");
            try
            {
                int i = 0;
                foreach (string s in Directory.GetFiles(absPath))
                {
                    FileInfo fi = new FileInfo(s);

                    if (fi.Extension == ".aspx")
                    {
                        HyperLink hl = new HyperLink();
                        hl.Enabled = true;
                        hl.Text = fi.Name;
                   //     hl.Target = "_blank";
                        hl.NavigateUrl = fi.Name;
                        Label lbl = new Label();
                        lbl.Text = "&nbsp&nbsp&nbsp";
                        PlaceHolderHypLinks.Controls.Add(hl);
                        PlaceHolderHypLinks.Controls.Add(lbl);

                        i++;
                        if (i == 4)
                        {
                            Label lb = new Label();
                            lb.Text = "<br />";
                            PlaceHolderHypLinks.Controls.Add(lb);
                            i = 0;
                        }
                    }
                }
            }
            catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex); }
    }
开发者ID:kbridgeman1,项目名称:CMPE2300,代码行数:35,代码来源:Header.ascx.cs


示例19: AddSelectedUsersToSelectedRole

    // add selected users to selected role
    public static void AddSelectedUsersToSelectedRole(GridView GridView1, DropDownList ddlAddUsersToRole, HyperLink Msg)
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            CheckBox cb = (CheckBox)row.FindControl("chkRows");
            if (cb != null && cb.Checked)
            {
                // assign selected user names from gridview to variable
                string userName;
                userName = GridView1.DataKeys[row.RowIndex].Value.ToString();

                // if user already exist in the selected role, skip onto the others
                if (!Roles.IsUserInRole(userName, ddlAddUsersToRole.SelectedItem.Text))
                {
                    // the magic happens here!
                    Roles.AddUserToRole(userName, ddlAddUsersToRole.SelectedItem.Text);
                }

                Msg.Text = "User(s) were sucessfully <strong>ADDED</strong> to <strong>" + ddlAddUsersToRole.SelectedItem.Text.ToUpper() + "</strong> Role!";
                Msg.Visible = true;
            }

            // display message if no selection is made
            DisplayMessageIfNoSelectionIsMade(Msg, cb);
        }
    }
开发者ID:camiloamora,项目名称:AppAjc,代码行数:27,代码来源:UserGvUtil.cs


示例20: cargar_menu_botones_internos

    private void cargar_menu_botones_internos()
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro());

        QueryStringSeguro["img_area"] = "contratacion";
        QueryStringSeguro["nombre_area"] = "CONTRATOS Y RELACIONES LABORALES";
        QueryStringSeguro["accion"] = "inicial";

        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_ARP";
        QueryStringSeguro["nombre_modulo"] = "GENERAR AUTOLIQUIDACION";
        link.NavigateUrl = "~/contratacion/GenerarAutoliquidacion.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguro.ToString());
        link.CssClass = "botones_menu_principal";
        link.Target = "_blank";
        imagen = new Image();
        imagen.ImageUrl = "~/imagenes/areas/bGenerarAutoliquidacionEstandar.png";
        imagen.Attributes.Add("onmouseover", "this.src='../imagenes/areas/bGenerarAutoliquidacionAccion.png'");
        imagen.Attributes.Add("onmouseout", "this.src='../imagenes/areas/bGenerarAutoliquidacionEstandar.png'");
        imagen.CssClass = "botones_menu_principal";
        link.Controls.Add(imagen);

        celdaTabla.Controls.Add(link);

        filaTabla.Cells.Add(celdaTabla);

        celdaTabla = new TableCell();
        celdaTabla.ID = "cell_3_row_" + contadorFilas.ToString();
        link = new HyperLink();
        link.ID = "link_AFP";
        QueryStringSeguro["nombre_modulo"] = "REPORTES";
        link.NavigateUrl = "~/Reportes/autoliquidacion.aspx?data=" + HttpUtility.UrlEncode(QueryStringSeguro.ToString());
        link.CssClass = "botones_menu_principal";
        link.Target = "_blank";
        imagen = new Image();
        imagen.ImageUrl = "~/imagenes/areas/bReportesEstandar.png";
        imagen.Attributes.Add("onmouseover", "this.src='../imagenes/areas/bReportesAccion.png'");
        imagen.Attributes.Add("onmouseout", "this.src='../imagenes/areas/bReportesEstandar.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,代码行数:60,代码来源:Autoliquidaciones.aspx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Hypergeometric类代码示例发布时间:2022-05-24
下一篇:
C# HyperEdgeId类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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