本文整理汇总了C#中XhtmlMobileTextWriter.WriteHiddenField方法的典型用法代码示例。如果您正苦于以下问题:C# XhtmlMobileTextWriter.WriteHiddenField方法的具体用法?C# XhtmlMobileTextWriter.WriteHiddenField怎么用?C# XhtmlMobileTextWriter.WriteHiddenField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XhtmlMobileTextWriter
的用法示例。
在下文中一共展示了XhtmlMobileTextWriter.WriteHiddenField方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPageState
private void RenderPageState (XhtmlMobileTextWriter writer) {
String viewState = Page.ClientViewState;
if (viewState != null) {
writer.WriteHiddenField (MobilePage.ViewStateID, viewState);
}
}
示例2: RenderHiddenVariables
private void RenderHiddenVariables(XhtmlMobileTextWriter writer) {
if (Page.HasHiddenVariables()) {
String hiddenVariablePrefix = MobilePage.HiddenVariablePrefix;
foreach (DictionaryEntry entry in Page.HiddenVariables) {
if (entry.Value != null) {
writer.WriteHiddenField(hiddenVariablePrefix + (String)entry.Key,
(String)entry.Value);
}
}
}
}
示例3: RenderAsHiddenInputField
/// <include file='doc\XhtmlBasicTextBoxAdapter.uex' path='docs/doc[@for="XhtmlTextBoxAdapter.RenderAsHiddenInputField"]/*' />
protected override void RenderAsHiddenInputField(XhtmlMobileTextWriter writer) {
// Optimization - if viewstate is enabled for this control, and the
// postback returns to this page, we just let it do the trick.
if (Control.Form.Action.Length > 0 || (!IsViewStateEnabled() && Control.Text != _staticValue)) {
writer.WriteHiddenField(Control.UniqueID, Control.Text);
}
}
示例4: RenderPostBackHeader
private void RenderPostBackHeader(XhtmlMobileTextWriter writer) {
bool postBack = Page.ActiveForm.Action.Length == 0;
RenderPageState(writer);
if (!postBack) {
writer.WriteHiddenField(PageAdapter.EventSourceKey, XhtmlConstants.PostedFromOtherFile);
}
else if (Page.ClientViewState == null) {
// The empty event source variable is used to identify a
// postback request. Value attribute is not needed, and some
// devices do not allow empty string value attributes.
if ((String)Device["requiresHiddenFieldValues"] != "true") {
writer.WriteHiddenField(PageAdapter.EventSourceKey);
}
else {
// Placeholder value is never used, just needed for some devices.
writer.WriteHiddenField(PageAdapter.EventSourceKey, PageAdapter.EventSourceKey);
}
}
RenderHiddenVariables(writer);
}
示例5: RenderAsHiddenInputField
/// <include file='doc\XhtmlBasicSelectionListAdapter.uex' path='docs/doc[@for="XhtmlSelectionListAdapter.RenderAsHiddenInputField"]/*' />
protected override void RenderAsHiddenInputField(XhtmlMobileTextWriter writer) {
// Optimization - if viewstate is enabled for this control, and the
// postback returns to this page, we just let it do the trick.
// One catch though - if the control is multiselect, it always
// interprets return values, so we do need to write out.
if (Control.IsMultiSelect || Control.Form.Action.Length > 0 || !IsViewStateEnabled()) {
String uniqueID = Control.UniqueID;
MobileListItemCollection items = Control.Items;
for (int i = 0; i < items.Count; i++) {
if (items[i].Selected) {
writer.WriteHiddenField(uniqueID, i.ToString(CultureInfo.InvariantCulture));
}
}
}
}