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


C# HyperLink.ResolveClientUrl方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.HyperLink.ResolveClientUrl方法的典型用法代码示例。如果您正苦于以下问题:C# HyperLink.ResolveClientUrl方法的具体用法?C# HyperLink.ResolveClientUrl怎么用?C# HyperLink.ResolveClientUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.HyperLink的用法示例。


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

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            session = (SessionObject)Session["SessionObject"];
            userid = session.LoggedInUser.UserId;
  
               
                if (Request.QueryString["StandardID"] != null && Request.QueryString["StudentID"] != null && Request.QueryString["WorksheetID"] != null)
                {
                    StandardId = Convert.ToInt32(Request.QueryString["StandardID"]);
                    StudentId = Convert.ToInt32(Request.QueryString["StudentID"]);
                    WorksheetId = Convert.ToInt32(Request.QueryString["WorksheetID"]);
                }
                if (!IsPostBack)
                {
                    radGridHistory.Visible = true;
                    radGridComments.Visible = true;
                    RadScriptManager scriptManager = (RadScriptManager)ScriptManager.GetCurrent(this.Page);

                    DataSet ds = CompetencyWorkSheet.GetCompetencyWorksheetSingleStudentStandard(StandardId, StudentId, WorksheetId);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        lblStudentName.Text = ds.Tables[0].Rows[0]["StudentName"].ToString();
                        lblStandardDesc.Text = ds.Tables[0].Rows[0]["StandardDesc"].ToString();
                        StandardName = ds.Tables[0].Rows[0]["StandardName"].ToString();
                        lnkStandard.Text = StandardName;
                        HyperLink link = new HyperLink();
                        ID_Encrypted = Encryption.EncryptInt(StandardId);
                        link.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + ID_Encrypted;
                        lnkStandard.Attributes.Add("onclick", "window.open('" + link.ResolveClientUrl(link.NavigateUrl) + "');");
                        lnkStandard.Attributes.Add("style", "cursor:pointer; text-decoration: underline; color: #034AF3");
                        BindPerformanceGrid();
                        BindCommentGrid();
                    }
                }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:35,代码来源:WorksheetHistory.aspx.cs

示例2: StandardsFilterRadTree_NodeDataBound

 protected void StandardsFilterRadTree_NodeDataBound(object sender, RadTreeNodeEventArgs e)
 {
     var node = e.Node;
     
     if(node.ParentNode == null)
     {
         node.CssClass = "RadTreeView_Thinkgate_TreeView_ParentNode";
         var link = (ImageButton)node.FindControl("editLink");
         if (link != null)
         {
             var dataRowView = (DataRowView)node.DataItem;
             HyperLink tempLink = new HyperLink();
             tempLink.NavigateUrl = "~/Controls/Standards/StandardsFilterEdit.aspx?filterName=";
             string linkURL = tempLink.ResolveClientUrl(tempLink.NavigateUrl) + dataRowView["Name"];
             link.OnClientClick = "customDialog({url: '" + linkURL + "', title: 'Edit Standard Filter',maximize: true}); return false;";
             link.Visible = true;
             link.Attributes["style"] = "cursor:pointer;";
         }
     }
 }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:20,代码来源:StandardsFilter.ascx.cs

示例3: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Tile == null) return;
            //return; //Preventing this code from running because it is incomplete

            DataSet standardsFilterDataSet = Base.Classes.Standards.GetStandardsFilters(SessionObject.LoggedInUser.Page);
            //DataTable standardsFilterTable = Standpoint.Core.Classes.Encryption.EncryptDataTableColumn(standardsFilterDataSet.Tables[0], "FilterID", "FilterID_Encrypted");
            DataTable standardsFilterTable = standardsFilterDataSet.Tables[0];

            standardsFilterDataSet.Tables.Remove(standardsFilterDataSet.Tables[0]);
            standardsFilterDataSet.Tables.Add(standardsFilterTable);

            if (standardsFilterDataSet.Tables[0].Rows.Count > 0)
            {
                standardsFilterDefaultTextSpan.Visible = false;


                standardsFilterRadTree.DataTextField = "Name";
                standardsFilterRadTree.DataFieldID = "ID";
                standardsFilterRadTree.DataFieldParentID = "ParentID";

                standardsFilterRadTree.DataSource = standardsFilterDataSet;
                standardsFilterRadTree.DataBind();

                BtnAdd.Attributes["onclick"] = "return false;";
                BtnAdd.Attributes["style"] = "cursor:default; margin-top: -1px;";
                BtnAddSpan.Attributes["style"] = "opacity:.5; filter:progid:DXImageTransform.Alpha(opacity=50); filter:alpha(opacity=50);"; //BJC 8/2/2012: opacity fix for IE8.
                BtnAddDiv.Attributes["style"] = "padding: 0; opacity:.5; filter:progid:DXImageTransform.Alpha(opacity=50); filter:alpha(opacity=50);"; //BJC 8/2/2012: opacity fix for IE8.
            }
            else
            {
                standardsFilterDefaultTextSpan.Visible = true;
                standardsFilterRadTree.Visible = false;

                HyperLink link = new HyperLink();
                link.NavigateUrl = "~/Controls/Standards/StandardsFilterEdit.aspx?filterName=";

                BtnAdd.Attributes["onclick"] = "customDialog({url: '" + link.ResolveClientUrl(link.NavigateUrl) + "', title: 'Edit Standard Filter',maximize: true}); return false;";
            }

        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:41,代码来源:StandardsFilter.ascx.cs

示例4: radGridResults_ItemDataBound


//.........这里部分代码省略.........
                else
                {
                    Label assessmentNameLabel;
                    if ((assessmentNameLabel = (Label)gridItem.FindControl("lblListTestName")) != null)
                    {
                        assessmentNameLabel.Visible = true;
                    }
                }

                System.Web.UI.HtmlControls.HtmlInputCheckBox chk = (System.Web.UI.HtmlControls.HtmlInputCheckBox)item.FindControl("chkRowInput");
                chk.Attributes["onclick"] = "selectThisRow(this,'" + radGridResults.ClientID + "'," + item.ItemIndex + "," + ProofedTestCount + "," + row["TestID"] + ");";
                chk.Attributes.Add("rowIndex", item.ItemIndex.ToString());

                string[] arrUnChecked = hiddenDeSelected.Text.Split(',').ToArray();
                var foundUnChecked = arrUnChecked.FirstOrDefault(x => x.ToString() == row["TestID"].ToString());
                if (hiddenChkAll.Text == "1" && string.IsNullOrEmpty(foundUnChecked) && !(chk.Disabled))
                {
                    gridItem.Selected = true;
                    chk.Checked = true;
                }

                string[] arrChecked = hiddenSelected.Text.Split(',').ToArray();
                var foundChecked = arrChecked.FirstOrDefault(x => x.ToString() == row["TestID"].ToString());
                if (!string.IsNullOrEmpty(foundChecked) && !(chk.Disabled))
                {
                    gridItem.Selected = true;
                    chk.Checked = true;
                }

                #endregion

                string assessmentTitle = "Term " + row["Term"] + " " + row["TestType"] + " - " + row["Grade"] + " Grade " + row["Subject"] + (row["Course"].ToString() == row["Subject"].ToString() ? string.Empty : " " + row["Course"]);
                //ShowAndHideIcons
                #region Show Administration Button
                Base.Enums.Permission administPerm = (Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Icon_Administration" + row["TestCategory"].ToString(), true);
                Boolean showAdministBtn = UserHasPermission(administPerm) && string.Compare(row["STATUS"].ToString(), "Proofed", true) == 0;
                System.Web.UI.HtmlControls.HtmlImage imgAdminBtn;
                if ((imgAdminBtn = (System.Web.UI.HtmlControls.HtmlImage)item.FindControl("imgGraphicAdmin")) != null)
                {
                    string onClientClickAdmin = "searchAsssessment_adminClick(" + "'" + row["EncryptedID"].ToString() + "'"
                                                                                                         + "," + "'" + assessmentTitle + "','" + Category + "','" + isSecureAssessment + "'" + ")";

                    imgAdminBtn.Visible = showAdministBtn;
                    if (showAdministBtn && row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride))
                    {
                        imgAdminBtn.Attributes["onclick"] = "return false;";
                        imgAdminBtn.Attributes["style"] = "cursor:default; opacity:.3; filter:alpha(opacity=30);";
                    }
                    else
                    {
                        imgAdminBtn.Attributes["onclick"] = onClientClickAdmin;
                    }
                }
                #endregion

                #region Show Print Button
                Base.Enums.Permission assessmentPerm = (Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Print_Assessment" + row["TestCategory"].ToString(), true);
                Base.Enums.Permission answerKeyPerm = (Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Print_AnswerKey" + row["TestCategory"].ToString(), true);
                String printonclick = @"searchAsssessment_printClick(" + "'" + Standpoint.Core.Classes.Encryption.EncryptInt(DataIntegrity.ConvertToInt(row["TestID"])) + "'"
                                                                                                         + "," + "'" + row["TestName"].ToString() + "'" + ")";
                Boolean showPrint = (UserHasPermission(assessmentPerm) || UserHasPermission(answerKeyPerm)) && (row["ContentType"].ToString() != "No Items/Content");

                System.Web.UI.HtmlControls.HtmlImage imgBtn;
                //TFS: 6362
                imgBtn = (System.Web.UI.HtmlControls.HtmlImage)item.FindControl("imgGraphicPrint");
                //if ((imgBtn = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("imgGraphicPrint")) != null)
                if (imgBtn != null)
                {
                    if (bPrintFlag)
                    {
                        imgBtn.Attributes["onclick"] = printonclick;
                        imgBtn.Visible = showPrint;
                    }
                    else
                    {
                        imgBtn.Attributes["onclick"] = "return false;";
                        imgBtn.Attributes["style"] = "cursor:default; opacity:.3; filter:alpha(opacity=30);";
                    }
                }
                #endregion

                #region Show Edit Button
                Boolean editAssessment = UserHasPermission((Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Edit_Assessment" + row["TestCategory"].ToString(), true)) && string.Compare(row["STATUS"].ToString(), "Proofed", true) != 0;
                HyperLink imgOnclickLink = new HyperLink();
                string imgOnclickLinkString;
                imgOnclickLink.NavigateUrl = "~/" + clientFolder + "Record/AssessmentPage.aspx?xID=" + (string)row["EncryptedID"];
                imgOnclickLinkString = imgOnclickLink.ResolveClientUrl(imgOnclickLink.NavigateUrl);

                string onClientClick = @"searchAsssessment_editClick('" + row["EncryptedID"].ToString() + "','" + assessmentTitle + "', '" + imgOnclickLinkString + "'); ";

                System.Web.UI.HtmlControls.HtmlImage editBtn;
                if ((editBtn = (System.Web.UI.HtmlControls.HtmlImage)item.FindControl("btnGraphicEdit1")) != null)
                {
                    editBtn.Visible = editAssessment;
                    editBtn.Attributes["onclick"] = onClientClick;
                }
                #endregion

            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:101,代码来源:AssessmentSearchExpanded.aspx.cs

示例5: lbxList_ItemDataBound


//.........这里部分代码省略.........
                if (!hasPermissionActiveTestNameLnk)
                { testNameLinkActive = false; }

                if (Convert.ToBoolean(row["Targetted"]) && !isDistrictOrSchool && Convert.ToInt32(row["createdBy"].ToString()) != SessionObject.LoggedInUser.Page)
                {
                    testNameLinkActive = false;
                    hasPermissionActiveTestNameLnk = false;
                }

                // For now we have been asked to make the scored hyperlinks disabled.
                testScoredLinkActive = false;

                SetControlVisibility(listBoxItem.FindControl("lblListTestName"), !(testNameLinkActive || hasPermissionActiveTestNameLnk));
                SetControlVisibility(listBoxItem.FindControl("lnkListTestName"), testNameLinkActive || hasPermissionActiveTestNameLnk);
                SetControlVisibility(listBoxItem.FindControl("lblListTestScored"), !testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lblListTestScoredPct"), !testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkListTestScored"), testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkListTestScoredPct"), testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lblGraphicTestName"), !(testNameLinkActive || hasPermissionActiveTestNameLnk));
                SetControlVisibility(listBoxItem.FindControl("lnkGraphicTestName"), testNameLinkActive || hasPermissionActiveTestNameLnk);
                SetControlVisibility(listBoxItem.FindControl("lblGraphicTestScored"), !testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lblGraphicTestScoredPct"), !testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkGraphicTestScored"), testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkGraphicTestScoredPct"), testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("btnGraphicUpdate"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("btnListUpdate"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("listLine2Edit"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("graphicLine2Edit"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("graphicLine3Edit"), editItemMode.Value);

                String testLinkUrl = "~/Record/AssessmentObjects.aspx?xID=" + (String)row["TestID_Encrypted"];
                SetNavigateURL((HyperLink)listBoxItem.FindControl("lnkListTestName"), testLinkUrl);
                SetNavigateURL((HyperLink)listBoxItem.FindControl("lnkGraphicTestName"), testLinkUrl);

                HyperLink imgOnclickLink = new HyperLink();
                imgOnclickLink.NavigateUrl = "~/Record/AssessmentPage.aspx?xID=" + (string)row["TestID_Encrypted"];

                string imgOnclickLinkString = imgOnclickLink.ResolveClientUrl(imgOnclickLink.NavigateUrl);
                string assessmentTitle = "Term " + row["Term"] + " " + row["TestType"] + " - " + row["Grade"] + " Grade " + row["Subject"] + (row["Course"].ToString() == row["Subject"].ToString() ? string.Empty : " " + row["Course"]);
                string onClientClick = "var _this=this; this.disabled=true; setTimeout(function(){ _this.disabled=false; }, 500); viewAssessments_editLink_onClick('" + imgOnclickLinkString + "', '" + assessmentTitle + "');";

                var btnListEdit = (HyperLink)listBoxItem.FindControl("btnListEdit");
                
                var btnGraphicEdit = (HyperLink)listBoxItem.FindControl("btnGraphicEdit");
                var btnGraphicUpdate = (HyperLink)listBoxItem.FindControl("btnGraphicUpdate");
                var btnListUpdate = (HyperLink)listBoxItem.FindControl("btnListUpdate");

                if (btnListEdit != null)
                {
                    btnListEdit.NavigateUrl = "javascript:" + onClientClick;
                    //WR 2932: Edit Button only visible for District Assessments when user/role has "Icon_Edit_District_Assessment" permission and item is not proofed
                    btnListEdit.Visible = editItemMode.Value && (!IsDistrictPortal || (UserHasPermission(Permission.Icon_Edit_District_Assessment)));
                }

                if (btnGraphicEdit != null)
                {
                    btnGraphicEdit.NavigateUrl = "javascript:" + onClientClick;
                    //WR 2932: Edit Button only visible for District Assessments when user/role has "Icon_Edit_District_Assessment" permission and item is not proofed
                    btnGraphicEdit.Visible = editItemMode.Value && (!IsDistrictPortal || (UserHasPermission(Permission.Icon_Edit_District_Assessment)));
                }
                if (btnGraphicUpdate != null) btnGraphicUpdate.NavigateUrl = "javascript:" + onClientClick;
                if (btnListUpdate != null) btnListUpdate.NavigateUrl = "javascript:" + onClientClick;

                System.Web.UI.WebControls.Image proofedImg = (System.Web.UI.WebControls.Image)listBoxItem.FindControl("testImg");
                if (proofedImg != null) proofedImg.ImageUrl = (editItemMode.Value) ? "~/Images/editable.png" : "~/Images/proofed.png";

                // String for onclick for showing Assessment Administration popup. We pass parameters that we have.
                String classid = (_level == Base.Enums.EntityTypes.Class) ? _levelID.ToString() : String.Empty;
                string isSecureText = "false";
                String imgonclick = @"viewAsssessment_adminClick(" + row["TestID"].ToString() + "," + (String.IsNullOrEmpty(classid) ? "null" : classid) + ",'" + assessmentTitle + " - " + row["Description"].ToString().Replace("'", "") + "','" + isSecureText + "')";

                var imgListAdmin = (HyperLink)listBoxItem.FindControl("imgListAdmin");
                var imgGraphicAdmin = (HyperLink)listBoxItem.FindControl("imgGraphicAdmin");

                if (imgListAdmin != null)
                {
                    if (row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride)) 
                    {
                        imgListAdmin.Attributes["style"] = "opacity:.3; filter:alpha(opacity=30); cursor:default;";
                        imgListAdmin.Attributes["onclick"] = "return false;";
                    }
                    else
                    {
                        imgListAdmin.NavigateUrl = "javascript:" + imgonclick;
                    }
                }
                if (imgGraphicAdmin != null)
                {
                    if (row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride))
                    {
                        imgGraphicAdmin.Attributes["style"] = "opacity:.3; filter:alpha(opacity=30); cursor:default;";
                        imgGraphicAdmin.Attributes["onclick"] = "return false;";
                    }
                    else
                    {
                        imgGraphicAdmin.NavigateUrl = "javascript:" + imgonclick;
                    }
                }
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:101,代码来源:ViewAssessments.ascx.cs

示例6: LoadStandardDistributionTable_AssessmentObjectScreen

        protected void LoadStandardDistributionTable_AssessmentObjectScreen()
        {
            DataTable standardDistributionTable = _ds.Tables["StandardQuestionCounts"];

            if (standardDistributionTable.Rows.Count > 0)
            {
                string cell1Width;
                string cell2Width;
                if (standardDistributionTable.Rows.Count > 4 && !isPDFView)
                {
                    cell1Width = "width:41%;";
                    cell2Width = "width:48%;";
                }
                else
                {
                    cell1Width = "width:110px;";
                    cell2Width = "width:128px;";
                    if(isPDFView) standardDistScrollContainerDiv.Attributes["style"] = "height: 85px;";
                }

                foreach (DataRow dr in standardDistributionTable.Rows)
                {
                    TableRow row = new TableRow();
                    TableCell cell1 = new TableCell();
                    TableCell cell2 = new TableCell();
                    TableCell cell3 = new TableCell();

                    HyperLink link = new HyperLink();
                    link.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + Encryption.EncryptInt(DataIntegrity.ConvertToInt(dr["StandardID"]));

                    cell1.Text = string.IsNullOrEmpty(dr["StandardName"].ToString()) ? "&nbsp;" : "<a href=\"javascript:void();\" onclick=\"window.open('" + link.ResolveClientUrl(link.NavigateUrl) + "'); return false;\">" + dr["StandardName"].ToString() + "</a>";
                    cell1.Attributes["class"] = "contentLabel";
                    cell1.Attributes["style"] = cell1Width + (standardDistributionTable.Rows.Count < 4 ? "border-bottom:solid 1px #000;" : "");

                    cell2.Text = Math.Round(100.0 * DataIntegrity.ConvertToInt(dr["StandardQuestionCount"]) / DataIntegrity.ConvertToInt(dr["TotalItemCount"])).ToString() + "%";
                    cell2.Attributes["class"] = "standardContentElement";
                    cell2.Attributes["style"] = cell2Width + (standardDistributionTable.Rows.Count < 4 ? "border-bottom:solid 1px #000;" : "");
                    cell2.Attributes["style"] = cell2.Attributes["style"] + "font-weight: bold;text-align: center;padding: 3px;";

                    cell3.Text = string.IsNullOrEmpty(dr["StandardQuestionCount"].ToString()) ? "&nbsp;" : dr["StandardQuestionCount"].ToString();
                    cell3.Attributes["class"] = "standardContentElement";
                    if (standardDistributionTable.Rows.Count < 4)
                    {
                        cell3.Attributes["style"] = "border-bottom:solid 1px #000;";
                    }
                    cell3.Attributes["style"] = cell3.Attributes["style"] + "font-weight: bold;text-align: center;padding: 3px;";

                    row.Cells.Add(cell1);
                    row.Cells.Add(cell2);
                    row.Cells.Add(cell3);

                    standardTable.Rows.Add(row);
                }

                standardTable.DataBind();
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:57,代码来源:AssessmentSummary.aspx.cs

示例7: LoadTeachers

        private void LoadTeachers()
        {
            if(_selectedClass.Teachers.Count == 0) _selectedClass.LoadTeachers();

            HtmlImage summaryImage = new HtmlImage();
            summaryImage.Src = "~/Images/summary.png";
            string summaryImageSrc = summaryImage.ResolveClientUrl(summaryImage.Src);

            HyperLink teacherOnclickLink = new HyperLink();
            string teacherOnclickLinkString;
            teacherOnclickLink.NavigateUrl = "~/Record/Teacher.aspx?childPage=yes&xID=";
            teacherOnclickLinkString = teacherOnclickLink.ResolveClientUrl(teacherOnclickLink.NavigateUrl);

            foreach (Thinkgate.Base.Classes.Teacher teacher in _selectedClass.Teachers)
            {
                HtmlTableRow newRow = new HtmlTableRow();
                HtmlTableCell cell1 = new HtmlTableCell();
                string xID = Encryption.EncryptInt(teacher.PersonID);

                if (UserHasPermission(Permission.Hyperlink_Teacher_ClassSummaryExpanded))
                {
                    /* User has permission so display Teacher Name as hyperlink. */
                    cell1.InnerHtml = "<img src=\"" + summaryImageSrc + "\" class=\"summaryImgButton\" style=\"display:none; cursor:pointer; margin-right:5px;\"/><a href=\"javascript:void();\" onclick=\"window.open('" +
                        teacherOnclickLinkString + xID + "'); return false;\">" + teacher.FirstName + " " + teacher.LastName + "</a> " + (teacher.IsPrimary ? "(Primary)" : "");
                }
                else
                {
                    /* User does not have permission so display Teacher Name as label. */
                    cell1.InnerHtml = "<img src=\"" + summaryImageSrc + "\" class=\"summaryImgButton\" style=\"display:none; cursor:pointer; margin-right:5px;\"/><label>" + 
                                      teacher.FirstName + " " + teacher.LastName + "</label> " + (teacher.IsPrimary ? "(Primary)" : "");
                }

                newRow.Cells.Add(cell1);
                teachersTable.Rows.Add(newRow);
            }

            teachersTable.DataBind();
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:38,代码来源:ClassSummary_Expanded.aspx.cs

示例8: rlbSecureList_ItemDataBound


//.........这里部分代码省略.........
            }
            HtmlGenericControl spnLastEdit = (HtmlGenericControl)listBoxItem.FindControl("spnLastEditSecure");
            spnLastEdit.InnerText = "Last Edited: " + ((DateTime)row["DateUpdated"]).ToShortDateString();

            Boolean? editItemMode = null;
            if (row["Proofed"] is String) editItemMode = !DataIntegrity.ConvertToBool(row["Proofed"]);

            if (editItemMode.HasValue)
            {
                // District test links are not active on teacher page.
                bool IsDistrictOrSchool = (_level == Base.Enums.EntityTypes.District || _level == Base.Enums.EntityTypes.School);
                bool IsDistrictPortal = _category.ToLower().Trim() == "district";
                bool IsTargetted = Convert.ToBoolean(row["Targetted"]);
                int CreatedByPage = string.IsNullOrEmpty(row["createdBy"].ToString()) ? 0 : Convert.ToInt32(row["createdBy"].ToString());

                bool HasHyperlinkPermission = false;
                bool HasAdminIconPermission = false;

                switch (_category.ToLower())
                {
                    case "classroom":
                        HasHyperlinkPermission = UserHasPermission(Permission.Hyperlink_AssessmentNameClassroom);
                        HasAdminIconPermission = true;
                        break;

                    case "district":
                        HasHyperlinkPermission = UserHasPermission(Permission.Hyperlink_AssessmentNameDistrict);
                        HasAdminIconPermission = true;
                        break;

                    case "state":
                        HasHyperlinkPermission = UserHasPermission(Permission.Hyperlink_AssessmentNameState);
                        HasAdminIconPermission = UserHasPermission(Permission.Icon_AdministrationState);
                        break;
                }


                bool IsTestNameLinkActive = (IsDistrictOrSchool || IsDistrictPortal) && HasHyperlinkPermission;
                bool isSloTeacherAndNonSloAssessment = sloTeacher != null && (row["ItemClassId"].ToString() != "2") && (_category.ToUpper() == "DISTRICT");

                //determine if this is an SLOTeach user if the assessment is for an SLO CurrCourse

                if (IsTargetted && !IsDistrictOrSchool && CreatedByPage != SessionObject.LoggedInUser.Page)
                {
                    IsTestNameLinkActive = false;
                    HasHyperlinkPermission = false;
                }

                imgProofed.ImageUrl = (editItemMode.Value) ? "~/Images/editable.png" : "~/Images/proofed.png";
                hlkTestname.Enabled = ((IsTestNameLinkActive || HasHyperlinkPermission) && !isSloTeacherAndNonSloAssessment);
                hlkTestname.NavigateUrl = "~/Record/AssessmentObjects.aspx?xID=" + (String)row["TestID_Encrypted"];


                spnNumItems.Visible = editItemMode.Value;

                //WR 2932: Edit Button only visible for District Assessments when user/role has "Icon_Edit_District_Assessment" permission and item is not proofed
                hlkEdit.Visible = editItemMode.Value && (!IsDistrictPortal || (UserHasPermission(Permission.Icon_Edit_District_Assessment)));


                //MF 4022: Admin icon visible only when user/role has "Icon_AdministrationState" permission and item is proofed.
                hlkAdmin.Visible = !editItemMode.Value && HasAdminIconPermission;
                pnlLastEdit.Visible = editItemMode.Value;

                HyperLink imgOnclickLink = new HyperLink();
                imgOnclickLink.NavigateUrl = "~/Record/AssessmentPage.aspx?xID=" + (string)row["TestID_Encrypted"];

                string imgOnclickLinkString = imgOnclickLink.ResolveClientUrl(imgOnclickLink.NavigateUrl);
                string SecureText = "Term ";
                string isSecure = "false";
                if (SecureFormativetabStrip.SelectedIndex == 1)
                {
                    //SecureText = "[SECURE] Term ";
                    isSecure = "true";
                }
                string assessmentTitle = SecureText + row["Term"] + " " + row["TestType"] + " - " + row["Grade"] + " Grade " + row["Subject"] + (row["Course"].ToString() == row["Subject"].ToString() ? string.Empty : " " + row["Course"]);

                string onClientClick = "var _this=this; this.disabled=true; setTimeout(function(){ _this.disabled=false; }, 500); viewAssessments_editLink_onClick('" + imgOnclickLinkString + "', '" + assessmentTitle + "');";

                if (hlkEdit != null) hlkEdit.NavigateUrl = "javascript:" + onClientClick;

                // String for onclick for showing Assessment Administration popup. We pass parameters that we have.
                String classid = (_level == Base.Enums.EntityTypes.Class) ? _levelID.ToString() : String.Empty;
                String imgonclick = @"viewAsssessment_adminClick(" + row["TestID"].ToString() + "," + (String.IsNullOrEmpty(classid) ? "null" : classid) + ",'" + assessmentTitle + " - " + row["Description"].ToString().Replace("'", "") + "','" + _category.ToString() + "','" + _level.ToString() + "','" + false + "','" + isSecure + "')";

                if (hlkAdmin != null)
                {
                    if (row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride))
                    {
                        hlkAdmin.Attributes["style"] = "opacity:.3; filter:alpha(opacity=30); cursor:default;";
                        hlkAdmin.Attributes["onclick"] = "return false;";
                    }
                    else
                    {
                        // TFS: 6703
                        //hlkAdmin.NavigateUrl = "javascript:" + imgonclick;
                        hlkAdmin.Attributes["onclick"] = "javascript:" + imgonclick;
                    }
                }
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:101,代码来源:ViewAssessmentsV2.ascx.cs

示例9: LoadStandardsSearchTable_Click

        public void LoadStandardsSearchTable_Click(object sender, EventArgs e)
        {
            LoadStandardsSearchDataTable();
            standardsSearchTable.Rows.Clear();

            if(_standardsSearchDataTable.Rows.Count > 0)
            {
                standardsSearchTable.Visible = true;
                standardsSearchHeader.Visible = true;
            }
            else
            {
                standardsSearchTable.Visible = false;
                standardsSearchHeader.Visible = false;
            }

            List<int> filterList = new List<int>();
            if (SessionObject.LoggedInUser.StandardFilters.ContainsKey(_filterName) &&
                SessionObject.LoggedInUser.StandardFilters[_filterName].Length > 0)
            {
                foreach (var strID in SessionObject.LoggedInUser.StandardFilters[_filterName].Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    Int32 id;
                    if (Int32.TryParse(strID.Trim(), out id)) filterList.Add(id);
                }
            }

            foreach (DataRow row in _standardsSearchDataTable.Rows)
            {
                if (!filterList.Contains(Convert.ToInt32(row["ID"])))
                {
                    TableRow newRow = new TableRow();
                    TableCell cell1 = new TableCell();
                    TableCell cell2 = new TableCell();
                    TableCell cell3 = new TableCell();
                    TableCell cell4 = new TableCell();
                    TableCell cell5 = new TableCell();
                    TableCell cell6 = new TableCell();
                    TableCell cell7 = new TableCell();

                    newRow.Attributes["standardID"] = row["ID"].ToString();

                    HtmlInputCheckBox cell1Data = new HtmlInputCheckBox();
                    cell1Data.ID = "standardsSearchCheckbox_" + row["ID"].ToString();
                    cell1Data.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                    cell1Data.Attributes["onclick"] = "addToFilter(this); return false;";
                    cell1Data.Attributes["standardID"] = row["ID"].ToString();
                    cell1.CssClass = "alignCellCenter";
                    cell1.Width = 50;
                    cell1.Controls.Add(cell1Data);

                    HyperLink cell2Data = new HyperLink();
                    cell2Data.NavigateUrl = "~/Record/StandardsPage.aspx?xID="
                                            + Standpoint.Core.Classes.Encryption.EncryptString(
                                                row["ID"].ToString());
                    cell2Data.Attributes["onclick"] = "window.open('"
                                                      + cell2Data.ResolveClientUrl(
                                                          cell2Data.NavigateUrl)
                                                      + "'); return false;";
                    cell2Data.Text = row["StandardName"].ToString();
                    cell2.ToolTip = row["StandardName"].ToString();
                    cell2.Style.Add("overflow", "hidden");
                    cell2.Width = 100;
                    cell2.Controls.Add(cell2Data);

                    HtmlGenericControl cell3Data = new HtmlGenericControl("DIV");
                    ImageButton closeButton = new ImageButton();
                    closeButton.ImageUrl = "~/Images/X.png";
                    string closeButtonImgURL = closeButton.ResolveClientUrl(closeButton.ImageUrl);

                    cell3Data.InnerHtml =
                        "<div class=\"divOverflowHidden\"><a href=\"javascript:void(0);\" onclick=\"displayFullDescription(this); return false;\" class=\"standardTextLink\" >"
                        + row["Description"].ToString()
                        + "</a></div><div class='fullText'><img src='" + closeButtonImgURL
                        + "' onclick='this.parentNode.style.display=&quot;none&quot;;' style='position:relative; float:right; cursor:pointer;' />"
                        + row["Description"].ToString() + "</div>";
                    cell3.Controls.Add(cell3Data);
                    cell3.Width = 250;

                    cell4.Text = row["Grade"].ToString();
                    cell4.Width = 50;

                    cell5.Text = row["Subject"].ToString();
                    cell5.Width = 100;

                    cell6.Text = row["Course"].ToString();
                    cell6.Width = 100;

                    cell7.Text = row["Level"].ToString();
                    if (_standardsSearchDataTable.Rows.Count > 13)
                        cell7.Width = 91;
                    else
                        cell7.Width = 100;

                    newRow.Cells.Add(cell1);
                    newRow.Cells.Add(cell2);
                    newRow.Cells.Add(cell3);
                    newRow.Cells.Add(cell4);
                    newRow.Cells.Add(cell5);
                    newRow.Cells.Add(cell6);
//.........这里部分代码省略.........
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:101,代码来源:StandardsFilterEdit.aspx.cs

示例10: LoadStandardsFilterTable

        private void LoadStandardsFilterTable()
        {
            standardsFilterTable.Rows.Clear();

            if (_standardsFilterDataTable != null && _standardsFilterDataTable.Rows.Count > 0)
            {
                tableContainerDiv.Attributes["style"] = "display:block;";
                updateButton.Enabled = true;
                defaultMessageDiv.Attributes["style"] = "display:none;";
            }
            else
            {
                tableContainerDiv.Attributes["style"] = "display:none;";
                defaultMessageDiv.Attributes["style"] = "display:block;";
                if(IsPostBack && filterIDs.Value.Length > 0) updateButton.Enabled = false;
            }

            foreach(DataRow row in _standardsFilterDataTable.Rows)
            {
                TableRow newRow = new TableRow();
                TableCell cell1 = new TableCell();
                TableCell cell2 = new TableCell();
                TableCell cell3 = new TableCell();
                TableCell cell4 = new TableCell();
                TableCell cell5 = new TableCell();
                TableCell cell6 = new TableCell();
                TableCell cell7 = new TableCell();

                HtmlInputCheckBox cell1Data = new HtmlInputCheckBox();
                cell1Data.ID = "standardsFilterCheckbox_" + row["StandardID"].ToString();
                cell1Data.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                cell1Data.Attributes["onclick"] = "removeFromFilter(this, this.checked);";
                cell1Data.Attributes["standardID"] = row["StandardID"].ToString();
                cell1.CssClass = "alignCellCenter";
                cell1.Width = 50;
                cell1.Controls.Add(cell1Data);

                HyperLink cell2Data = new HyperLink();
                cell2Data.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + Standpoint.Core.Classes.Encryption.EncryptString(row["StandardID"].ToString());
                cell2Data.Attributes["onclick"] = "window.open('" + cell2Data.ResolveClientUrl(cell2Data.NavigateUrl) + "'); return false;";
                cell2Data.Text = row["StandardName"].ToString();
                cell2.ToolTip = row["StandardName"].ToString();
                cell2.Style.Add("overflow", "hidden");
                cell2.Width = 100;
                cell2.Controls.Add(cell2Data);

                HtmlGenericControl cell3Data = new HtmlGenericControl("DIV");
                ImageButton closeButton = new ImageButton();
                closeButton.ImageUrl = "~/Images/X.png";
                string closeButtonImgURL = closeButton.ResolveClientUrl(closeButton.ImageUrl);

                cell3Data.InnerHtml = "<div class=\"divOverflowHidden\"><a href=\"javascript:void(0);\" onclick=\"displayFullDescription(this); return false;\" class=\"standardTextLink\" >"
                    + row["Desc"].ToString() + "</a></div><div class='fullText'><img src='" + closeButtonImgURL
                    + "' onclick='this.parentNode.style.display=&quot;none&quot;;' style='position:relative; float:right; cursor:pointer;' />" + row["Desc"].ToString() + "</div>";
                cell3.Controls.Add(cell3Data);
                cell3.Width = 250;

                cell4.Text = row["Grade"].ToString();
                cell4.Width = 50;

                cell5.Text = row["Subject"].ToString();
                cell5.Width = 100;

                cell6.Text = row["Course"].ToString();
                cell6.Width = 100;

                cell7.Text = row["Level"].ToString();
                if (_standardsFilterDataTable.Rows.Count > 13) cell7.Width = 91;
                else cell7.Width = 100;

                newRow.Cells.Add(cell1);
                newRow.Cells.Add(cell2);
                newRow.Cells.Add(cell3);
                newRow.Cells.Add(cell4);
                newRow.Cells.Add(cell5);
                newRow.Cells.Add(cell6);
                newRow.Cells.Add(cell7);

                standardsFilterTable.Rows.Add(newRow);
            }

            standardsFilterTable.DataBind();
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:83,代码来源:StandardsFilterEdit.aspx.cs


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