当前位置: 首页>>代码示例>>C#>>正文


C# HiddenField.RenderControl方法代码示例

本文整理汇总了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());
        }
开发者ID:BakerWebDev,项目名称:strongbrook.me,代码行数:41,代码来源:ApplicationErrorModal.cs

示例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
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:78,代码来源:SearchField.cs

示例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();
        }
开发者ID:AgileEAP,项目名称:AgileEAP-BPM,代码行数:53,代码来源:TreeView.cs

示例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);
         }
     }
 }
开发者ID:san90279,项目名称:UK_OAS,代码行数:21,代码来源:JQScriptManager.cs

示例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);
 }
开发者ID:vijaymca,项目名称:Dotnet,代码行数:23,代码来源:UserControlContainer.cs

示例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);
        }
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:76,代码来源:FistCoreScriptManager.cs


注:本文中的System.Web.UI.WebControls.HiddenField.RenderControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。