本文整理汇总了C#中System.Web.UI.HtmlControls.HtmlImage.ResolveClientUrl方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlImage.ResolveClientUrl方法的具体用法?C# HtmlImage.ResolveClientUrl怎么用?C# HtmlImage.ResolveClientUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlControls.HtmlImage
的用法示例。
在下文中一共展示了HtmlImage.ResolveClientUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}