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


C# UI.PostBackOptions类代码示例

本文整理汇总了C#中System.Web.UI.PostBackOptions的典型用法代码示例。如果您正苦于以下问题:C# PostBackOptions类的具体用法?C# PostBackOptions怎么用?C# PostBackOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PostBackOptions类属于System.Web.UI命名空间,在下文中一共展示了PostBackOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string qsuimode = Request.QueryString["mode"];

                if (string.IsNullOrEmpty(qsuimode) == false)
                {
                    _mode = (UIMode.mode)Enum.Parse(typeof(UIMode.mode), qsuimode);
                    if (_mode == UIMode.mode.add)
                    {
                        LoadApplicationList2DDL();
                        PopulatePortalList2DDL();
                        LoadSkinTypeList2DDL();
                        LoadPackageList2DDL();
                    }
                    if (_mode == UIMode.mode.edit)
                    {
                        _idx = Convert.ToInt32(Request.QueryString["idx"]);
                        LoadData();
                    }
                    hdnWindowUIMODE.Value = _mode.ToString();
                }

                MultiView1.ActiveViewIndex = 0;
            }

            PostBackOptions optionsSubmit = new PostBackOptions(btnOkay);
            btnOkay.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
            btnOkay.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
        }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:31,代码来源:admin_skins_edit.aspx.cs

示例2: GetPostBackEventReference

		public string GetPostBackEventReference (PostBackOptions options)
		{
			if (options.ActionUrl == null && options.ValidationGroup == null && !options.TrackFocus && 
				!options.AutoPostBack && !options.PerformValidation)
			{
				if (options.RequiresJavaScriptProtocol)
					return GetPostBackClientHyperlink (options.TargetControl, options.Argument);
				else
					return GetPostBackEventReference (options.TargetControl, options.Argument);
			}
			
			if (!IsClientScriptIncludeRegistered (typeof(Page), "webform")) {
				RegisterClientScriptInclude (typeof(Page), "webform", GetWebResourceUrl (typeof(Page), "webform.js"));
			}
			
			if (options.ActionUrl != null)
				RegisterHiddenField (Page.PreviousPageID, page.Request.FilePath);
			
			if (options.ClientSubmit || options.ActionUrl != null)
				page.RequiresPostBackScript ();
			
			return String.Format ("{0}WebForm_DoPostback({1},{2},{3},{4},{5},{6},{7},{8})", 
					options.RequiresJavaScriptProtocol ? "javascript:" : "",
					ClientScriptManager.GetScriptLiteral (options.TargetControl.UniqueID), 
					ClientScriptManager.GetScriptLiteral (options.Argument),
					ClientScriptManager.GetScriptLiteral (options.ActionUrl),
					ClientScriptManager.GetScriptLiteral (options.AutoPostBack),
					ClientScriptManager.GetScriptLiteral (options.PerformValidation),
					ClientScriptManager.GetScriptLiteral (options.TrackFocus),
					ClientScriptManager.GetScriptLiteral (options.ClientSubmit),
					ClientScriptManager.GetScriptLiteral (options.ValidationGroup)
				);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:33,代码来源:ClientScriptManager.cs

示例3: Render

        protected override void Render(HtmlTextWriter writer)
        {
            Button button = this.Control;

            writer.WriteBeginTag("button"); // <button 
            writer.WriteAttribute("value", "submit"); // <button value="submit" 
            writer.WriteAttribute("id", button.ClientID); // <button value="submit" id="btnButton"

            PostBackOptions myPostBackOptions = new PostBackOptions(button);
            //Add the Postback event
            if (button.Page.ClientScript.GetPostBackEventReference(myPostBackOptions).Length > 0)
            {
                //Turn on Validation if it needs to be on...
                if (button.CausesValidation)
                    myPostBackOptions.PerformValidation = true;

                //Need to replace double quotes with single quotes for javascript to work.
                writer.WriteAttribute("onclick", button.Page.ClientScript.GetPostBackEventReference(myPostBackOptions).Replace("\"", "'")); // <button value="submit" 

                //Register the Event
                button.Page.ClientScript.RegisterForEventValidation(myPostBackOptions);
            } // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')"

            if (button.CssClass.Length > 0)
                writer.WriteAttribute("class", button.CssClass); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button"

            writer.Write(HtmlTextWriter.TagRightChar); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button">
            writer.WriteFullBeginTag("span");
            writer.Write(button.Text);
            writer.WriteEndTag("span"); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button"><span>testButton</span>
            writer.WriteEndTag("button"); // <button value="submit" id="btnButton" onclick="__doPostBack('btnButton','')" class="large-button"><span>testButton</span></button>
        }
开发者ID:JBeans99,项目名称:CSharp__.NET,代码行数:32,代码来源:ButtonAdapter.cs

示例4: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string qsuimode = Request.QueryString["mode"];

                if (string.IsNullOrEmpty(qsuimode) == false)
                {
                    _mode = (UIMode.mode)Enum.Parse(typeof(UIMode.mode), qsuimode);
                    
                    if (_mode == UIMode.mode.edit)
                    {
                        _idx =Convert.ToInt32(Request.QueryString["idx"]);
                        LoadData();
                        hdnWindowUIMODE.Value = _mode.ToString();
                    }

                }
                MultiView1.ActiveViewIndex = 0;

            }

            PostBackOptions optionsSubmit = new PostBackOptions(btnOkay);
            btnOkay.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
            btnOkay.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
            //btnOkay.OnClientClick = String.Format("this.disabled=true; __doPostBack('{0}','');", btnOkay.UniqueID);

        }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:28,代码来源:permission_edit.aspx.cs

示例5: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string qsuimode = Request.QueryString["mode"];

                if (string.IsNullOrEmpty(qsuimode) == false)
                {
                    _mode = (UIMode.mode)Enum.Parse(typeof(UIMode.mode), qsuimode);
                    if (_mode == UIMode.mode.add)
                    {
                        ShowTreeNodes_Topics();
                        CollectionList2DDL();
                    }
                    if (_mode == UIMode.mode.edit)
                    {
                        _idx = Convert.ToInt32(Request.QueryString["idx"]);
                        LoadData();
                    }
                    hdnWindowUIMODE.Value = _mode.ToString();
                }
                Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString());
                MultiView1.ActiveViewIndex = 0;
            }

            PostBackOptions optionsSubmit = new PostBackOptions(btnOkay);
            btnOkay.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
            btnOkay.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
        }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:29,代码来源:admin_gallery_file_edit.aspx.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string qsuimode = Request.QueryString["mode"];

                if (string.IsNullOrEmpty(qsuimode) == false)
                {
                    _idx = Convert.ToInt32(Request.QueryString["idx"]);
                    LoadData();
                }
                Session["FileUpload1"] = null;
                MultiView1.ActiveViewIndex = 0;
            }
            else
            {
                if (FileUpload1.HasFile)
                {
                    Session["FileUpload1"] = FileUpload1;
                }
                else if (Session["FileUpload1"] != null)
                {
                    FileUpload1 = (FileUpload)Session["FileUpload1"];
                }
            }

            PostBackOptions optionsSubmit = new PostBackOptions(btnOkay);
            btnOkay.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
            btnOkay.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
        }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:30,代码来源:admin_audio_edit.aspx.cs

示例7: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //string qsuimode = Request.QueryString["mode"];

                //if (string.IsNullOrEmpty(qsuimode) == false)
                //{
                //    _mode = (UIMode.mode)Enum.Parse(typeof(UIMode.mode), qsuimode);
                //    if (_mode == UIMode.mode.add)
                //    {
                        loadPermissionToChkBoxListPermission();
                        ShowMenuSections();
                //    }
                //    if (_mode == UIMode.mode.edit)
                //    {
                //        _idx = Convert.ToInt32(Request.QueryString["idx"]);
                //        LoadData();
                //        hdnWindowUIMODE.Value = _mode.ToString();
                //    }
                        TreeView1.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                //}
                MultiView1.ActiveViewIndex = 0;

            }

            PostBackOptions optionsSubmit = new PostBackOptions(btnOkay);
            btnOkay.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
            btnOkay.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
            //btnOkay.OnClientClick = String.Format("this.disabled=true; __doPostBack('{0}','');", btnOkay.UniqueID);

        }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:32,代码来源:rights_edit.aspx.cs

示例8: GridViewInsertRowSelectScript

        protected void GridViewInsertRowSelectScript(object sender, GridViewRowEventArgs e)
        {
            if (isRowSelectable && e.Row.RowType == DataControlRowType.DataRow &&
                ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit))
            {
                var postOptions = new PostBackOptions(gridView, "Select$" + e.Row.RowIndex);
                String selectScript = gridView.Page.ClientScript.GetPostBackEventReference(postOptions);

                //
                // This for not uses equal, to not overbound the index
                //
                //for (int a = 0; a < e.Row.Cells.Count-1; a++)
                //{
                //    if (gridView.Columns[a].SortExpression != "Insert")
                //        e.Row.Cells[a].Attributes.Add("onclick", selectScript);
                //}
                e.Row.Attributes.Add("onclick", selectScript);

                //foreach (TableCell cell in e.Row.Cells)
                //{
                //    int i = e.Row.Cells.GetCellIndex(cell);
                //    if (gridView.Columns[i].GetType().Name != "CommandField")
                //        if (e.Row.RowType == DataControlRowType.DataRow)
                //            e.Row.Cells[a].Attributes.Add("onclick", selectScript);
                //}
            }
        }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:27,代码来源:GridViewAdapter.cs

示例9: RenderInputTag

 internal override void RenderInputTag(HtmlTextWriter writer, string clientID, string onClick)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Id, clientID);
     writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio");
     writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueGroupName);
     writer.AddAttribute(HtmlTextWriterAttribute.Value, this.ValueAttribute);
     if (this.Page != null)
     {
         this.Page.ClientScript.RegisterForEventValidation(this.UniqueGroupName, this.ValueAttribute);
     }
     if (this.Checked)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked");
     }
     if (!base.IsEnabled && this.SupportsDisabledAttribute)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
     }
     if ((this.AutoPostBack && !this.Checked) && (this.Page != null))
     {
         PostBackOptions options = new PostBackOptions(this, string.Empty);
         if (this.CausesValidation)
         {
             options.PerformValidation = true;
             options.ValidationGroup = this.ValidationGroup;
         }
         if (this.Page.Form != null)
         {
             options.AutoPostBack = true;
         }
         onClick = Util.MergeScript(onClick, this.Page.ClientScript.GetPostBackEventReference(options));
         writer.AddAttribute(HtmlTextWriterAttribute.Onclick, onClick);
         if (base.EnableLegacyRendering)
         {
             writer.AddAttribute("language", "javascript", false);
         }
     }
     else if (onClick != null)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Onclick, onClick);
     }
     string accessKey = this.AccessKey;
     if (accessKey.Length > 0)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, accessKey);
     }
     int tabIndex = this.TabIndex;
     if (tabIndex != 0)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, tabIndex.ToString(NumberFormatInfo.InvariantInfo));
     }
     if ((base._inputAttributes != null) && (base._inputAttributes.Count != 0))
     {
         base._inputAttributes.AddAttributes(writer);
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Input);
     writer.RenderEndTag();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:58,代码来源:RadioButton.cs

示例10: Constructors

		public void Constructors () {
			Control c = new WebControl(HtmlTextWriterTag.A);
			c.Page = new Page ();
			PostBackOptions options=new PostBackOptions(c);
			Assert.IsFalse (options.PerformValidation);
			Assert.IsFalse (options.AutoPostBack);
			Assert.IsFalse (options.TrackFocus);
			Assert.IsTrue (options.ClientSubmit);
			// MSDN: The default value is true, BUT FALSE
			Assert.IsFalse (options.RequiresJavaScriptProtocol);
			// MSDN: The default value is an empty string (""), BUT NULL
			Assert.AreEqual (null, options.Argument);
			// MSDN: The default value is an empty string (""), BUT NULL
			Assert.AreEqual (null, options.ActionUrl);
			// MSDN: The default value is an empty string (""), BUT NULL
			Assert.AreEqual (null, options.ValidationGroup);

			options = new PostBackOptions (c, null);
			Assert.IsFalse (options.PerformValidation);
			Assert.IsFalse (options.AutoPostBack);
			Assert.IsFalse (options.TrackFocus);
			Assert.IsTrue (options.ClientSubmit);
			Assert.IsFalse (options.RequiresJavaScriptProtocol);
			Assert.AreEqual (null, options.Argument);
			Assert.AreEqual (null, options.ActionUrl);
			Assert.AreEqual (null, options.ValidationGroup);

			options = new PostBackOptions (c, null, null, false, false, false, false, false, null);
			Assert.IsFalse (options.PerformValidation);
			Assert.IsFalse (options.AutoPostBack);
			Assert.IsFalse (options.TrackFocus);
			Assert.IsFalse (options.ClientSubmit);
			Assert.IsFalse (options.RequiresJavaScriptProtocol);
			Assert.AreEqual (null, options.Argument);
			Assert.AreEqual (null, options.ActionUrl);
			Assert.AreEqual (null, options.ValidationGroup);

			options = new PostBackOptions (c, "ARG");
			Assert.IsFalse (options.PerformValidation);
			Assert.IsFalse (options.AutoPostBack);
			Assert.IsFalse (options.TrackFocus);
			Assert.IsTrue (options.ClientSubmit);
			Assert.IsFalse (options.RequiresJavaScriptProtocol);
			Assert.AreEqual ("ARG", options.Argument);
			Assert.AreEqual (null, options.ActionUrl);
			Assert.AreEqual (null, options.ValidationGroup);

			options = new PostBackOptions (c, "ARG", "Page.aspx", true, true, false, false, false, "VG");
			Assert.IsFalse (options.PerformValidation);
			Assert.IsTrue (options.AutoPostBack);
			Assert.IsFalse (options.TrackFocus);
			Assert.IsFalse (options.ClientSubmit);
			Assert.IsTrue (options.RequiresJavaScriptProtocol);
			Assert.AreEqual ("ARG", options.Argument);
			Assert.AreEqual ("Page.aspx", options.ActionUrl);
			Assert.AreEqual ("VG", options.ValidationGroup);
		}
开发者ID:nobled,项目名称:mono,代码行数:57,代码来源:PostBackOptionsTest.cs

示例11: RenderContents

        protected override void RenderContents(HtmlTextWriter output)
        {
            PostBackOptions p = new PostBackOptions(this);

            output.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
            output.AddAttribute(HtmlTextWriterAttribute.Name, this.ClientID);
            output.AddAttribute(HtmlTextWriterAttribute.Value, this.Text);
            output.RenderBeginTag(HtmlTextWriterTag.Input);
            output.RenderEndTag();
        }
开发者ID:kacecode,项目名称:SchoolWork,代码行数:10,代码来源:Listing25-32.cs

示例12: BeginRender

		/// <summary>
		/// Adds an onclick attribute for post back refresh navigation when javascript is on
		/// </summary>
		/// <param name="writer">The output stream to render on the client</param>
		protected override void BeginRender(HtmlTextWriter writer)
		{
			if (HyperLink.Enabled && HyperLink.Attributes["__ToData"] != null)
			{
				PostBackOptions postBackOptions = new PostBackOptions(HyperLink);
				postBackOptions.Argument = REFRESH_POST_BACK;
				writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format(CultureInfo.InvariantCulture, "if(!event.ctrlKey&&!event.shiftKey){{{0};return false;}}", Page.ClientScript.GetPostBackEventReference(postBackOptions, true)));
			}
			HyperLink.Attributes.Remove("__ToData");
			base.BeginRender(writer);
		}
开发者ID:ericziko,项目名称:navigation,代码行数:15,代码来源:RefreshHyperLinkAdapter.cs

示例13: Render

 /// <summary>
 /// Overridden Render method solely to do registration for event validation
 /// </summary>
 /// <param name="writer">HtmlTextWriter object</param>
 protected override void Render(HtmlTextWriter writer)
 {
     PostBackOptions options = new PostBackOptions(this.btnDummyToPostBack);
     if (options != null)
     {
         options.PerformValidation = true;
         Page.ClientScript.RegisterForEventValidation(options);
         this.litPostBack.Text = String.Format("{0}{1}{2}", "<script type=\"text/javascript\" language=\"javascript\">function doPostBack() { ", Page.ClientScript.GetPostBackEventReference(options), "}</script>"); ;
     }
     base.Render(writer);
 }
开发者ID:JamesTryand,项目名称:NetSqlAzMan,代码行数:15,代码来源:ModalDialog.Master.cs

示例14: RenderContents

        protected override void RenderContents(HtmlTextWriter output)
        {
            PostBackOptions p = new PostBackOptions(this);

            output.AddAttribute(HtmlTextWriterAttribute.Onclick,
                Page.ClientScript.GetPostBackEventReference(p));
            output.AddAttribute(HtmlTextWriterAttribute.Value, "My Button");
            output.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_i");
            output.AddAttribute(HtmlTextWriterAttribute.Name, this.ClientID + "_i");
            output.RenderBeginTag(HtmlTextWriterTag.Button);
            output.RenderEndTag();
        }
开发者ID:netatomy,项目名称:LearningNet,代码行数:12,代码来源:Listing26-30.cs

示例15: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         LoadData();
         FillDataInGrid();
         MultiView1.ActiveViewIndex = 0;
     }
     PostBackOptions optionsSubmit = new PostBackOptions(btnOkay);
     btnOkay.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
     btnOkay.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:12,代码来源:permission_modules_edit.aspx.cs


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