本文整理汇总了C#中System.Web.UI.WebControls.Image.RenderControl方法的典型用法代码示例。如果您正苦于以下问题:C# Image.RenderControl方法的具体用法?C# Image.RenderControl怎么用?C# Image.RenderControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Image
的用法示例。
在下文中一共展示了Image.RenderControl方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected override void Render(HtmlTextWriter output)
{
Assert.ArgumentNotNull(output, nameof(output));
base.Render(output);
//render other control
var value = GetValue();
if (!string.IsNullOrEmpty(value))
{
//get lat lng
var position = value.Split(',');
if (position.Count() == 2)
{
double lat = 0;
double lng = 0;
double.TryParse(position[0], out lat);
double.TryParse(position[1], out lng);
var mapImageCtrl = new Image();
mapImageCtrl.ID = ID + "_Img_MapView";
mapImageCtrl.CssClass = "imageMapView";
mapImageCtrl.Width = mapWidth;
mapImageCtrl.Height = mapHeight;
mapImageCtrl.ImageUrl = GetMapImageUrl();
mapImageCtrl.Style.Add("padding-top", "5px");
mapImageCtrl.RenderControl(output);
}
}
}
示例2: RenderContents
/// <summary>
/// Renders the contents.
/// </summary>
/// <param name="output">The output.</param>
protected override void RenderContents(HtmlTextWriter output)
{
System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();
int height = Convert.ToInt32(this.Height.Value);
image.ImageUrl = string.Format("image.barcode?Type={0}&Code={1}&Height={2}", Type, Code, height);
image.RenderControl(output);
}
示例3: Render
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
switch (DefaultValueType)
{
case ValidatorValueType.Image:
if (!string.IsNullOrEmpty(defaultValue))
{
System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
img.ID = "img_" + base.ClientID;
img.ImageUrl = base.IsValid ? defaultValue : errorValue;
img.RenderControl(writer);
}
break;
case ValidatorValueType.Text:
if (!string.IsNullOrEmpty(defaultValue))
writer.WriteLine(base.IsValid ? defaultValue : errorValue);
break;
}
}
示例4: Render
protected override void Render(HtmlTextWriter output)
{
var image = new Image();
image.ID = this.ClientID + "_Image";
image.AlternateText = this.Checked.ToString();
if (!this.ShowCheckBox)
{
base.Style.Add("display", "none");
}
if (this.Checked)
{
image.ImageUrl = this.ImageChecked;
}
else
{
image.ImageUrl = this.ImageUnchecked;
}
image.RenderControl(output);
base.Render(output);
}
示例5: RenderNodeArrow
protected void RenderNodeArrow( HtmlTextWriter writer )
{
if( m_objNode.HasNodes )
{
Label oSpan = new Label();
oSpan.RenderBeginTag( writer );
if( m_objNode.Level == 0 )
{
if( m_objNode.DNNMenu.RootArrowImage.Length > 0 )
{
Image objImage = new Image();
objImage.ImageUrl = m_objNode.DNNMenu.RootArrowImage;
objImage.RenderControl( writer );
}
}
else
{
if( m_objNode.DNNMenu.ChildArrowImage.Length > 0 )
{
Image objImage = new Image();
objImage.ImageUrl = m_objNode.DNNMenu.ChildArrowImage;
objImage.RenderControl( writer );
}
}
oSpan.RenderEndTag( writer );
}
}
示例6: RenderNodeIcon
/// <summary>
///
/// </summary>
/// <param name="writer"></param>
/// <remarks>
/// </remarks>
/// <history>
/// [jhenning] 9/21/2005 Created
/// </history>
protected void RenderNodeIcon( HtmlTextWriter writer )
{
Label oSpan = new Label();
if( m_objNode.CSSIcon.Length > 0 )
{
oSpan.CssClass = m_objNode.CSSIcon;
}
else if( m_objNode.DNNMenu.DefaultIconCssClass.Length > 0 )
{
oSpan.CssClass = m_objNode.DNNMenu.DefaultIconCssClass;
}
oSpan.RenderBeginTag( writer );
if( m_objNode.ImageIndex > -1 )
{
NodeImage m_objNodeImage = m_objNode.DNNMenu.ImageList[m_objNode.ImageIndex];
if( !( m_objNodeImage == null ) )
{
Image objImage = new Image();
objImage.ImageUrl = m_objNodeImage.ImageUrl;
objImage.RenderControl( writer );
writer.Write( " ", null );
}
}
oSpan.RenderEndTag( writer );
}
示例7: RenderContents
override void RenderContents (HtmlTextWriter w)
{
if (HasControls () || HasRenderMethodDelegate ()) {
base.RenderContents (w);
return;
}
string image_url = ImageUrl;
if (image_url != "") {
Image img = new Image ();
img.ImageUrl = ResolveClientUrl (image_url);
string str = Text;
if (str != "")
img.AlternateText = str;
str = ToolTip;
if (str != "")
img.ToolTip = str;
img.RenderControl (w);
} else {
w.Write (Text);
}
}
示例8: RenderItemIcon
private void RenderItemIcon(HtmlTextWriter writer, string iconUrl, string description) {
System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
img.AlternateText = description;
//
img.ImageUrl = iconUrl;
img.BorderStyle = BorderStyle.None;
img.Page = _page;
img.RenderControl(writer);
}
示例9: RenderExpandNodeIcon
/// <summary>
///
/// </summary>
/// <param name="writer"></param>
/// <remarks>
/// </remarks>
/// <history>
/// [jbrinkman] 5/6/2004 Created
/// [Jon Henning] 11/28/2005 Added iscrawler logic
/// </history>
protected void RenderExpandNodeIcon( HtmlTextWriter writer )
{
if( _Node.HasNodes )
{
HyperLink _link = new HyperLink();
Image _image = new Image();
if( _Node.IsExpanded || _Node.DNNTree.IsCrawler )
{
_link.Text = _expcol[1];
if( _Node.DNNTree.ExpandedNodeImage.Length > 0 )
{
_image.ImageUrl = _Node.DNNTree.ExpandedNodeImage;
}
}
else
{
_link.Text = _expcol[0];
if( _Node.DNNTree.CollapsedNodeImage.Length > 0 )
{
_image.ImageUrl = _Node.DNNTree.CollapsedNodeImage;
}
}
//If _Node.PopulateOnDemand Then 'handled in postback handler
// _link.NavigateUrl = ClientAPI.GetPostBackClientHyperlink(_Node.DNNTree, _Node.ID & ",OnDemand")
//Else
_link.NavigateUrl = ClientAPI.GetPostBackClientHyperlink( _Node.DNNTree, _Node.ID );
//End If
if( _image.ImageUrl.Length > 0 )
{
_link.RenderBeginTag( writer );
_image.RenderControl( writer );
_link.RenderEndTag( writer );
}
else
{
_link.RenderControl( writer );
}
_image = null;
_link = null;
}
else
{
RenderSpacer( writer, _Node.DNNTree.ExpandCollapseImageWidth );
}
writer.Write( " ", null );
}