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


C# ImageButton.ResolveClientUrl方法代码示例

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


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

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsQueryStringMissingParameter(X_ID))
            {
                RedirectToPortalSelectionScreen();
            }

            int xID = GetDecryptedEntityId(X_ID);

            Assessment _assessment;
            string addendumHTML = string.Empty;
            int count = 1;

            _assessment = Assessment.GetAssessmentAndQuestionsByID(xID);
            if (_assessment == null)
            {
                SessionObject.RedirectMessage = "Could not find the assessment.";
                Response.Redirect("~/PortalSelection.aspx", true);
            }

            if (_assessment.Addendums.Count == 0)
            {
                addendumPreviewDiv.InnerHtml = "No addendums found.";
            }
            else
            {
                foreach (Addendum oAddendum in _assessment.Addendums)
                {
                    ImageButton closeButton = new ImageButton();
                    closeButton.ImageUrl = "~/Images/X.png";
                    string closeButtonImgURL = closeButton.ResolveClientUrl(closeButton.ImageUrl);

 addendumHTML +="<div>" + count.ToString() + ": <a href=\"javascript:void(0);\" onclick=\"displayFullDescription(this); return false;\">" + oAddendum.Addendum_Name                   + "</a>" +
                      "<div class=\"fullText\">" +
                       "<img src=\"" + closeButtonImgURL + "\" onclick=\"this.parentNode.style.display='none';\" style=\"position:relative; float:right; cursor:pointer;\" /><p>" 
                                + oAddendum.Addendum_Text + 
                      "</p></div>" +
               "</div>";
                    count++;
                }

                addendumPreviewDiv.InnerHtml = addendumHTML;
            }
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:44,代码来源:PreviewAddendums.aspx.cs

示例2: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsQueryStringMissingParameter(X_ID))
            {
                RedirectToPortalSelectionScreen();
            }

            int xID = GetDecryptedEntityId(X_ID);
            Assessment _assessment;
            string rubricHtml = string.Empty;
            int count = 1;

            _assessment = Assessment.GetAssessmentAndQuestionsByID(xID);
            if (_assessment == null)
            {
                SessionObject.RedirectMessage = "Could not find the assessment.";
                Response.Redirect("~/PortalSelection.aspx", true);
            }


            foreach (TestQuestion tq in _assessment.Items)
            {
                if (tq.Rubric != null)
                {
                    ImageButton closeButton = new ImageButton();
                    closeButton.ImageUrl = "~/Images/X.png";
                    string closeButtonImgUrl = closeButton.ResolveClientUrl(closeButton.ImageUrl);

                    rubricHtml += "<div>" + count.ToString() + ": <a href=\"javascript:void(0);\" onclick=\"displayFullDescription(this); return false;\">" + tq.Rubric.Name
                        + "</a><div class=\"fullText\"><img src=\"" + closeButtonImgUrl + "\" onclick=\"this.parentNode.style.display='none';\" style=\"position:relative; float:right; cursor:pointer;\" />"
                        + tq.Rubric.Content + "</div></div>";
                    count++;
                }
            }
            rubricPreviewDiv.InnerHtml = rubricHtml;
        }
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:36,代码来源:PreviewRubrics.aspx.cs

示例3: LoadControlsToContent

				public void LoadControlsToContent(List<Tile> tiles)
				{
						if (tiles == null) return;

						var counter = 1;
						
						foreach (Tile t in tiles)
						{
								try
								{
                                    //REFACTOR : WSH - investigate removing this permission check now that we've added check to RecordPage to prevent chunking
										if (t.TilePermission != null)
										{
												var permission = t.TilePermission ?? Thinkgate.Base.Enums.Permission.HasAccess;

												if (SessionObject == null && Session["SessionObject"] != null) SessionObject = (SessionObject)Session["SessionObject"];
												var isTrue = SessionObject.LoggedInUser.HasPermission(permission);

												if (!isTrue) continue;
										}

                    var widget = (TileControlBase) LoadControl(t.ControlPath);

										t.ParentContainer = this;

										//Control must inherit from TileControlBase in order to have Tile property
										//((TileControlBase)widget).Tile = t;
								        widget.Tile = t;

										var destination = FindControl("tileContainerDiv" + counter);

										if (destination == null) continue;

										RadDock dock = (RadDock)destination;

										if (t.Title.Contains("@@dockID"))
										{
												t.Title = t.Title.Replace("@@dockID", dock.ClientID);
										}

										dock.ContentContainer.Controls.Clear();
										dock.ContentContainer.Controls.Add(widget);

										var titlePanel = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
										titlePanel.Attributes["class"] = "tileTitleRow";
										titlePanel.InnerHtml = t.Title;
										dock.TitlebarContainer.Controls.Add(titlePanel);

										var extraCommandPanel = new System.Web.UI.WebControls.Panel();
										extraCommandPanel.ID = "extraCommandPanel";
										extraCommandPanel.CssClass = "extraCommandContainer";

										if (t.ToggleView || !String.IsNullOrEmpty(t.HelpJSFunction))
										{
												var extraCommandButtonPanel = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
												extraCommandButtonPanel.ID = "extraCommandButtonPanel";

												var tileGuid = Guid.NewGuid().ToString().Replace("-", string.Empty);

												if (t.ToggleView)
												{
													ImageButton extraCommandButton_ListViewToggle = new ImageButton()
													{
															ImageUrl = "~/Images/list_view.png"
													};

													string listViewImgURL = extraCommandButton_ListViewToggle.ResolveClientUrl(extraCommandButton_ListViewToggle.ImageUrl);
													string listViewClass = t.ToggleDefault == "list" ? "toggleViewButtons_selected" : "toggleViewButtons";
											
													ImageButton extraCommandButton_GraphicalViewToggle = new ImageButton
													{
															ImageUrl = "~/Images/graphical_view.png"
													};

													string graphicalViewImgURL = extraCommandButton_GraphicalViewToggle.ResolveClientUrl(extraCommandButton_GraphicalViewToggle.ImageUrl);
													string graphicalViewClass = t.ToggleDefault == "graphical" ? "toggleViewButtons_selected" : "toggleViewButtons";

													var listViewImgButton = new Image()
													{
															ID = destination.ID + "_ListView" + tileGuid,
															ImageUrl = listViewImgURL,
															AlternateText = "List View",
															ToolTip = "List View",
															CssClass = listViewClass,
															ClientIDMode = System.Web.UI.ClientIDMode.Static
													};

													var graphViewImgButton = new Image()
													{
															ID = destination.ID + "_GraphicalView" + tileGuid,
															ImageUrl = graphicalViewImgURL,
															AlternateText = "Graphical View",
															ToolTip = "Graphical View",
															CssClass = graphicalViewClass,
															ClientIDMode = System.Web.UI.ClientIDMode.Static
													};

													listViewImgButton.Attributes.Add("OnClick", "toggleView_SmallTile2(this, '"
																														+ destination.ID + "', 'listView','" + graphViewImgButton.ClientID + "','" + listViewImgButton.ClientID + "')");
													graphViewImgButton.Style.Add(HtmlTextWriterStyle.Display, "none");
//.........这里部分代码省略.........
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:101,代码来源:Container.cs

示例4: 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

示例5: 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

示例6: GetContentDataTable_ExportToExcel

        private DataTable GetContentDataTable_ExportToExcel()
        {
            if (_contentData == null || (!String.IsNullOrEmpty(_demoLabel) && !String.IsNullOrEmpty(_demoVal)) || !String.IsNullOrEmpty(_selectedFormID) || _isExcel)
            {
                _contentData = new DataTable();

                if (_distractorAnalysisData.Tables[0].Rows.Count > 0)
                {
                    int questionCount = _distractorAnalysisData.Tables[1].Rows.Count;
                    DataTable contentColumns = _distractorAnalysisData.Tables[1];

                    DataColumn name = new DataColumn("Name");
                    _contentData.Columns.Add(name);

                    DataColumn studentID = new DataColumn("StudentID");
                    _contentData.Columns.Add(studentID);

                    DataColumn score = new DataColumn("Score");
                    _contentData.Columns.Add(score);

                    // if(contentColumns.Columns.Contains("TR_Sort") && contentColumns.Columns.Contains("Sort"))
                    //{
                    foreach (DataRow row in contentColumns.Rows)
                    {
                        var newColName = row["TR_Sort"].ToString() != "0"
                                             ? row["Sort"].ToString() + " r(" + row["TR_Sort"].ToString() + ")"
                                             : row["Sort"].ToString();
                        DataColumn newCol = new DataColumn(newColName);
                        _contentData.Columns.Add(newCol);
                    }
                    //}

                    if (isPDFView || _isExcel)
                    {
                        DataColumn TestResponses = new DataColumn("TestResponses");
                        _contentData.Columns.Add(TestResponses);
                        DataColumn AltResponses = new DataColumn("AltResponses");
                        _contentData.Columns.Add(AltResponses);
                        DataColumn AnswerString = new DataColumn("AnswerString");
                        _contentData.Columns.Add(AnswerString);
                        DataColumn AdditionalData = new DataColumn("AdditionalData");
                        _contentData.Columns.Add(AdditionalData);
                    }

                    //Build Standards and Rigor Rows
                    DataRow standardsRow = _contentData.NewRow();
                    standardsRow[name] = "Standards";

                    foreach (DataRow row in _distractorAnalysisData.Tables[0].Rows)
                    {
                        standardsRow[score] = row["PctCorrectDisp"].ToString();


                    }



                    DataRow rigorRow = _contentData.NewRow();
                    rigorRow[name] = _distractorAnalysisData.Tables[0].Rows[0]["RigorType"].ToString();

                    foreach (DataRow row in _distractorAnalysisData.Tables[0].Rows)
                    {
                        rigorRow[score] = row["PctCorrectDisp"].ToString();


                    }

                    showRigor_checkbox.Value = _distractorAnalysisData.Tables[0].Rows[0]["RigorType"].ToString();
                    showRigor_span.InnerHtml = "Show " + _distractorAnalysisData.Tables[0].Rows[0]["RigorType"].ToString();

                    SessionObject.PreviewStandardsDialogParms.Clear();

                    foreach (DataRow contentRow in contentColumns.Rows)
                    {
                        var colName = contentRow["TR_Sort"].ToString() != "0"
                                             ? contentRow["Sort"].ToString() + " r(" + contentRow["TR_Sort"].ToString() + ")"
                                             : contentRow["Sort"].ToString();
                        ImageButton img = new ImageButton();
                        img.ImageUrl = "~/Images/preview1.gif";
                        string standardID_Encrypted = Encryption.EncryptInt(DataIntegrity.ConvertToInt(contentRow["StandardID"]));

                        Thinkgate.Base.Classes.Standards standard = new Thinkgate.Base.Classes.Standards(DataIntegrity.ConvertToInt(contentRow["StandardID"]),
                            contentRow["StandardName"].ToString(), contentRow["SText"].ToString(), 0, string.Empty);

                        if (!SessionObject.PreviewStandardsDialogParms.ContainsKey(DataIntegrity.ConvertToInt(contentRow["StandardID"])))
                        {
                            SessionObject.PreviewStandardsDialogParms.Add(DataIntegrity.ConvertToInt(contentRow["StandardID"]), standard);
                        }

                        standardsRow[colName] = "<img src=\"" + img.ResolveClientUrl(img.ImageUrl)
                            + "\" onclick=\"customDialog({ maximize_height:true, maxheight: 400,url: '../ControlHost/PreviewStandard.aspx?xID=" + standardID_Encrypted + "' }); return false;\" style=\"cursor:pointer;height:100%;\" title=\""
                            + contentRow["StandardName"].ToString() + ": " + contentRow["SText_Hover"].ToString() + "\"/>";

                        rigorRow[colName] = contentRow["qrigor"].ToString();
                    }
                    _contentData.Rows.Add(standardsRow);
                    _contentData.Rows.Add(rigorRow);

                    //Build Answer Rows
                    foreach (DataRow row in _distractorAnalysisData.Tables[0].Rows)
//.........这里部分代码省略.........
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:101,代码来源:DistractorAnalysis.ascx.cs


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