PageAdapter.RenderPostBackEvent Method (HtmlTextWriter, String, String, String, String, String, String, Boolean)

Renders a postback event into the response stream as a hyperlink, including the encoded view state, an event target and argument, a previous-page parameter, and an access key.

Namespace:  System.Web.UI.Adapters
Assembly:  System.Web (in System.Web.dll)

protected void RenderPostBackEvent(
	HtmlTextWriter writer,
	string target,
	string argument,
	string softkeyLabel,
	string text,
	string postUrl,
	string accessKey,
	bool encode
)

Parameters

writer
Type: System.Web.UI.HtmlTextWriter

The HtmlTextWriter containing methods to render the target-specific output.

target
Type: System.String

The String value holding the postback event target name.

argument
Type: System.String

The String value holding the argument to pass to the postback target event.

softkeyLabel
Type: System.String

The String value to use as a soft key label.

text
Type: System.String

The String value of the text to display as the link.

postUrl
Type: System.String

The String value holding the URL target page of the postback.

accessKey
Type: System.String

The String value to assign to the accessKey attribute of the created link.

encode
Type: System.Boolean

true to use & as the URL parameter separator; false to use &.

The RenderPostBackEvent method writes a postback event as a scriptless hyperlink, including the possibly chunked UrlEncode view state, __EVENTTARGET=target, __EVENTARGUMENT=argument, __PREVIOUSPAGE=currentFilePath parameters, and an accessKey="accessKey" attribute.

Notes to Inheritors

When you inherit from the PageAdapter class, you can override the RenderPostBackEvent method if a different format is required for the postback event hyperlink or the browser has other unique requirements. For example, some browsers require the hyperlink text to be nonempty if the link is to render. You can also override RenderPostBackEvent if limited resources prevent including view state as a URL parameter. The RenderPostBackEvent base method does not write an attribute for softkeyLabel.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft