本文整理汇总了C#中System.Web.UI.WebControls.HiddenField.RenderControl方法的典型用法代码示例。如果您正苦于以下问题:C# HiddenField.RenderControl方法的具体用法?C# HiddenField.RenderControl怎么用?C# HiddenField.RenderControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.HiddenField
的用法示例。
在下文中一共展示了HiddenField.RenderControl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
// Create a hidden variable so our features can communicate with the jQuery.
HiddenField applicationErrorsField = new HiddenField();
applicationErrorsField.ID = "ApplicationErrors";
applicationErrorsField.Value = HttpContext.Current.Server.UrlDecode(ErrorMessage);
applicationErrorsField.RenderControl(writer);
// Build the jQuery
StringBuilder javascripts = new StringBuilder();
// jQuery UI scripts to stylize common web elements
javascripts.AppendLine(string.Format(@"
<!-- ***** START Error Handling ***** -->
<link href='Assets/Plugins/jquery.msgbox/styles/jquery.msgbox.css' rel='stylesheet' type='text/css' />
<script src='Assets/Plugins/jquery.msgbox/jquery.msgbox.js' type='text/javascript'></script>
<script type='text/javascript' language='javascript'>
$(document).ready(function () {{
if ($('INPUT[type=""hidden""][id*=""ApplicationErrors""]').val() != '') {{
$(function () {{
var error = $('INPUT[type=""hidden""][id*=""ApplicationErrors""]').val();
$.msgbox(error, {{
type: 'error',
buttons: [
{{ type: 'submit', value: '" + ((!string.IsNullOrEmpty(ButtonText)) ? ButtonText : "OK") + @"'}}
]
}});
}});
}}
}});
</script>
<!-- ***** END Error Handling ***** -->
"));
// Render the jQuery
writer.Write(javascripts.ToString());
}
示例2: RenderControl
/// <summary>
/// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
/// </summary>
/// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
public override void RenderControl( HtmlTextWriter writer )
{
HiddenField hfFilter = new HiddenField();
hfFilter.ID = this.ID + "_hSearchFilter";
var searchExtensions = new Dictionary<string,Tuple<string, string>>();
foreach ( KeyValuePair<int, Lazy<Rock.Search.SearchComponent, Rock.Extension.IComponentData>> service in Rock.Search.SearchContainer.Instance.Components )
{
if ( !service.Value.Value.AttributeValues.ContainsKey( "Active" ) || bool.Parse( service.Value.Value.AttributeValues["Active"].Value ) )
{
searchExtensions.Add( service.Key.ToString(), Tuple.Create<string, string>( service.Value.Value.SearchLabel, service.Value.Value.ResultUrl ) );
if ( string.IsNullOrWhiteSpace( hfFilter.Value ) )
hfFilter.Value = service.Key.ToString();
}
}
writer.AddAttribute( "class", "smartsearch " + this.CssClass );
writer.RenderBeginTag( HtmlTextWriterTag.Div );
writer.AddAttribute( "class", "fa fa-search" );
writer.RenderBeginTag( HtmlTextWriterTag.I );
writer.RenderEndTag();
writer.AddAttribute( "class", "nav pull-right smartsearch-type" );
writer.RenderBeginTag( HtmlTextWriterTag.Ul );
writer.AddAttribute( "class", "dropdown" );
writer.RenderBeginTag( HtmlTextWriterTag.Li );
writer.AddAttribute("class", "dropdown-toggle navbar-link");
writer.AddAttribute( "data-toggle", "dropdown" );
writer.RenderBeginTag( HtmlTextWriterTag.A);
// wrap item in span for css hook
writer.RenderBeginTag( HtmlTextWriterTag.Span );
if ( searchExtensions.ContainsKey( hfFilter.Value ) )
{
writer.Write( searchExtensions[hfFilter.Value].Item1 );
}
writer.RenderEndTag();
// add carat
writer.AddAttribute( "class", "fa fa-caret-down" );
writer.RenderBeginTag( HtmlTextWriterTag.B );
writer.RenderEndTag();
writer.RenderEndTag();
writer.AddAttribute( "class", "dropdown-menu" );
writer.RenderBeginTag( HtmlTextWriterTag.Ul );
foreach ( var searchExtension in searchExtensions )
{
writer.AddAttribute( "data-key", searchExtension.Key );
writer.AddAttribute( "data-target", searchExtension.Value.Item2 );
writer.RenderBeginTag( HtmlTextWriterTag.Li );
writer.RenderBeginTag( HtmlTextWriterTag.A );
writer.Write( searchExtension.Value.Item1 );
writer.RenderEndTag();
writer.RenderEndTag();
}
writer.RenderEndTag(); //ul
writer.RenderEndTag(); //li
writer.RenderEndTag(); //ul
base.RenderControl( writer );
hfFilter.RenderControl(writer);
writer.RenderEndTag(); //div
}
示例3: Render
/// <summary>
///
/// </summary>
/// <param name="writer"></param>
protected override void Render(HtmlTextWriter writer)
{
if (DesignMode)
{
writer.Write(string.Format("<div>TreeView-{0}<div>", ID));
return;
}
InitScript();
string cssFile = Page.ClientScript.GetWebResourceUrl(this.GetType(), "AgileEAP.WebControls.TreeView.Resources.TreeView.css");
writer.Write(string.Format("<link href=\"{0}\" rel=\"stylesheet\" type=\"text/css\" />", cssFile));
writer.AddAttribute("id", string.Format("{0}_TreeViewContainer", ID));
writer.AddAttribute("class", ContainerCssClass);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
if (IsAjaxLoad)
{
writer.AddAttribute("id", ID + "PromptMessage");
writer.AddAttribute("class", ID + "PromptMessage");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.RenderEndTag();
}
if (EnableDrag)
{
writer.AddAttribute("id", ID + "DragContainer");
writer.AddAttribute("class", DragContainerCssClass);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.RenderEndTag();
}
HiddenField hidCurrentNodeId = new HiddenField();
hidCurrentNodeId.ID = ID + "CurrentNodeId";
hidCurrentNodeId.Value = CurrentNodeId;
hidCurrentNodeId.RenderControl(writer);
writer.AddAttribute("id", ID);
writer.AddAttribute("class", TreeCssClass);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
if (Nodes != null && Nodes.Count > 0)
{
Nodes.Owner = this;
Nodes.Render(writer, 0);
}
writer.RenderEndTag();
writer.RenderEndTag();
}
示例4: Render
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if (!DesignMode)
{
var clientInfo = (EFClientTools.EFServerReference.ClientInfo)System.Web.HttpContext.Current.Session["ClientInfo"];
if (clientInfo != null)
{
var hiddenField = new HiddenField();
hiddenField.ID = "_DEVELOPERID";
hiddenField.Value = clientInfo.SDDeveloperID;
hiddenField.RenderControl(writer);
}
if (UseMap == JQMapType.Baidu)
{
var hiddenField = new HiddenField();
hiddenField.ID = "_BAIDUAK";
hiddenField.Value = BAIDU_AK;
hiddenField.RenderControl(writer);
}
}
}
示例5: CreateHiddenField
/// <summary>
/// Creates the hidden field.
/// </summary>
/// <param name="writer">The writer.</param>
private void CreateHiddenField(HtmlTextWriter writer)
{
HiddenField hidSelectedRows = new HiddenField();
hidSelectedRows.ID = "hidSelectedRows";
hidSelectedRows.RenderControl(writer);
HiddenField hidSelectedCriteriaName = new HiddenField();
hidSelectedCriteriaName.ID = "hidSelectedCriteriaName";
hidSelectedCriteriaName.RenderControl(writer);
HiddenField hidSearchType = new HiddenField();
hidSearchType.ID = "hidSearchType";
hidSearchType.RenderControl(writer);
//Added in DREAM 4.0 for Removing single asset restriction for context search
HiddenField hidSelectedAssetNames = new HiddenField();
hidSelectedAssetNames.ID = "hidSelectedAssetNames";
hidSelectedAssetNames.RenderControl(writer);
HiddenField hidAssetName = new HiddenField();
hidAssetName.ID = "hidAssetName";
hidAssetName.RenderControl(writer);
}
示例6: IncludeFacebookData
private void IncludeFacebookData(HtmlTextWriter writer)
{
HiddenField tokenField = new HiddenField();
tokenField.ID = "FacebookTokenField";
tokenField.Value = FvkAuth.AccessToken;
tokenField.RenderControl(writer);
string language = "en_US";
bool checkLoginStatus = true;
bool useCookie = true;
bool frictionlessRequests = false;
StringBuilder html = new StringBuilder();
string initFuncName = "FbInitConnectionEvents";
string onConnectFuncName = "FbOnCheckConnection";
html.Append("<div id='fb-root'></div>\n");
html.Append("<input type='hidden' name='FbAccessToken' id='FbAccessTokenId' value='undefined' />\n");
html.Append("<input type='hidden' id='FbConnectButtonName' value='' />\n");
html.Append("<script>\n");
html.Append("var logoutClick = false;\n");
html.Append("var graphApiInitialized = false;\n");
html.Append("var loginButtonInitDone = false;\n");
html.Append("var loginButtonNameSet = false;\n");
html.Append(" window.fbAsyncInit = function() {\n");
html.Append(" FB.init({\n");
html.Append(" appId : '" + FVKConfig.AppId + "',\n");
html.Append(" status : " + checkLoginStatus.ToString().ToLower() + ",\n");
html.Append(" cookie : " + useCookie.ToString().ToLower() + ",\n");
html.Append(" frictionlessRequests : " + frictionlessRequests.ToString().ToLower() + ",\n");
html.Append(" xfbml : true,\n");
html.Append(" oauth: true\n");
html.Append(" });\n");
html.Append(" graphApiInitialized = true;\n");
html.Append(" " + initFuncName + "();\n");
html.Append(" };\n");
html.Append(" (function() {\n");
html.Append(" var e = document.createElement('script');\n");
html.Append(" e.src = document.location.protocol + '//connect.facebook.net/" + language + "/all.js';\n");
html.Append(" e.async = true;\n");
html.Append(" document.getElementById('fb-root').appendChild(e);\n");
html.Append(" }());\n");
html.Append("\n");
html.Append(" function " + onConnectFuncName + "() {\n");
html.Append(" FB.getLoginStatus(function(response) {\n");
html.Append(" var accessTokenStorage = document.getElementById('FbAccessTokenId');\n");
html.Append(" var oldAccessToken = document.getElementById('" + tokenField.ClientID + "').value;\n");
html.Append(" if (response.status === 'connected') {\n");
html.Append(" var accessToken = response.authResponse.accessToken;\n");
html.Append(" accessTokenStorage.value = accessToken;\n");
html.Append(" if (accessToken != null && accessToken != '' && oldAccessToken == '') {\n");
html.Append(" var connectButtonName = document.getElementById('FbConnectButtonName');\n");
html.Append(" if (connectButtonName.value != '') document.getElementById(connectButtonName.value).click();\n");
html.Append(" }\n");
html.Append(" } else {\n");
html.Append(" accessTokenStorage.value = '';\n");
html.Append(" if (oldAccessToken != null && oldAccessToken != '' && logoutClick == false) {\n");
html.Append(" document.getElementById('" + Page.Form.ClientID + "').submit();\n");
html.Append(" }\n");
html.Append(" }\n");
html.Append(" })\n");
html.Append(" }\n");
html.Append(" function " + initFuncName + "() {\n");
html.Append(" if (loginButtonInitDone == true) return;\n");
html.Append(" loginButtonInitDone = true;\n");
html.Append(" " + onConnectFuncName + "();\n");
html.Append(" FB.Event.subscribe('auth.authResponseChange'," + onConnectFuncName + ");\n");
html.Append(" }\n");
html.Append("</script>\n");
Literal literal = new Literal();
literal.Text = html.ToString();
literal.RenderControl(writer);
}