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


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Renders a postback event into the response stream as a hyperlink, including the encoded and possibly encrypted 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)

public virtual void RenderPostBackEvent(
	HtmlTextWriter writer,
	string target,
	string argument,
	string softkeyLabel,
	string text,
	string postUrl,
	string accessKey


Type: System.Web.UI.HtmlTextWriter

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

Type: System.String

The String value holding the postback event target name.

Type: System.String

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

Type: System.String

The String value to use as a soft key label.

Type: System.String

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

Type: System.String

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

Type: System.String

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

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.

View state is encrypted if the enableViewStateMac attribute of the pages Element (ASP.NET Settings Schema) configuration element is set to true.

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 the view state as a URL parameter. The RenderPostBackEvent base method does not write an attribute for softkeyLabel.

.NET Framework
Available since 2.0
Return to top