public int GetRowIndex(DNNTab row) { if (this.owner.HasControls()) { return(this.owner.Controls.IndexOf(row)); } return(-1); }
public void AddAt(int index, DNNTab row) { this.owner.Controls.AddAt(index, row); if (String.IsNullOrEmpty(row.ID)) { row.ID = this.owner.Controls.Count.ToString(); } //JH - COMMENTED 2/29/07 - caused markup with selectedindex to not function //If Me.owner.Controls.Count = 1 Then // Me.owner.SelectedIndex = 0 'assign default selected index //End If }
/// ----------------------------------------------------------------------------- /// <summary> /// This method is responsible for obtaining the HTML of a given tab. /// </summary> /// <param name="objTab"></param> /// <returns></returns> /// <remarks> /// The original technique used here is the same as the one found on this site. /// http://aspnet.4guysfromrolla.com/articles/102203-1.2.aspx /// /// EventValidation must be disabled in order to work (.NET 2.0 specific) /// </remarks> /// <history> /// [Jon Henning] 8/9/2006 Created /// </history> /// ----------------------------------------------------------------------------- private string GetTabContents(DNNTab objTab) { objTab.RaiseSetupDefaultsEvent(true); System.Text.StringBuilder objSB = new System.Text.StringBuilder(); System.IO.StringWriter objSW = new System.IO.StringWriter(objSB); HtmlTextWriter objHW = new HtmlTextWriter(objSW); System.Web.UI.HtmlControls.HtmlForm objForm; Page objPage; objPage = this.Page; objForm = DNNTabStrip.FindForm(this); if (objForm == null) { objForm = new System.Web.UI.HtmlControls.HtmlForm(); objPage.Controls.Add(objForm); } else { objForm.Controls.Clear(); } objTab.ID = objTab.UniqueID; objForm.Controls.Add(new LiteralControl(TAB_CONTENT_DELIMITER)); objForm.Controls.Add(objTab); objForm.Controls.Add(new LiteralControl(TAB_CONTENT_DELIMITER)); //Me.SelectedTab = objTab 'JH 1/29/07 objTab.SetParent(this); objTab.Enabled = true; //Experimental rendering using new page object //instead of clearing the form's controls. Unfortunately, there is //no way without reflection invoking a private member to associate //the httpcontext object to a new page object. //initial idea behind came from http://aspnet.4guysfromrolla.com/articles/102203-1.2.aspx //objPage = New Page //If System.Environment.Version.Major >= 2 Then // 'EventValidation must be disabled in order to work... since we are not .NET 2.0 specific yet we cannot do this here, so it needs to be done in web.config // objPage.GetType.InvokeMember("EnableEventValidation", Reflection.BindingFlags.SetProperty, Nothing, objPage, New Object() {False}) //End If //objPage.EnableViewState = False //objForm = New HtmlControls.HtmlForm //Dim objValidators As Collection = New Collection //For Each objValidator As IValidator In Me.Page.Validators // objValidators.Add(objValidator) //Next //objPage.DesignerInitialize() 'This causes the Page class's protected InitRecursive() method to be called, which preps a number of properties needed for rendering. //objPage.GetType.InvokeMember("SetIntrinsics", Reflection.BindingFlags.InvokeMethod Or Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance, Nothing, objPage, New Object() {HttpContext.Current}) //objPage.Controls.Add(objForm) //objTab.ID = objTab.UniqueID //objForm.Controls.Add(New LiteralControl(TAB_CONTENT_DELIMITER)) //objForm.Controls.Add(objTab) //objForm.Controls.Add(New LiteralControl(TAB_CONTENT_DELIMITER)) //Me.SelectedTab = objTab //objTab.SetParent(Me) //objTab.Enabled = True //Dim oCtl As Control //For Each objValidator As Control In objValidators // 'Me.Page.Validators.Remove(objValidator) // 'CType(objValidator, Control).Page = objPage // 'objPage.Validators.Add(objValidator) // objTab.Controls.Add(objValidator) //Next objForm.RenderControl(objHW); string strReturn = objSB.ToString().Split(new String[]{TAB_CONTENT_DELIMITER}, StringSplitOptions.None)[1]; //parse out only the contents of the tab's panel by using a delimiter HTMLElementCollection objScripts = this.GetScripts(objSB.ToString()); //GetFormHTML()) if (objScripts.Count > 0) { strReturn += ClientAPI.COLUMN_DELIMITER + objScripts.ToJSON(); } return strReturn; //Me.Tabs.FindTab(objTab.ID).RenderControl(objHW) //Return objSB.ToString() }
private void DisplayTabbedLoginControl(AuthenticationLoginBase authLoginControl, TabStripTabCollection Tabs) { var tab = new DNNTab(Localization.GetString("Title", authLoginControl.LocalResourceFile)) {ID = authLoginControl.AuthenticationType}; tab.Controls.Add(authLoginControl); Tabs.Add(tab); tsLogin.Visible = true; }
public int Add(DNNTab row) { this.AddAt(-1, row); return (this.owner.Controls.Count - 1); }
public void Remove(DNNTab row) { this.owner.Controls.Remove(row); }
public int GetRowIndex(DNNTab row) { if (this.owner.HasControls()) { return this.owner.Controls.IndexOf(row); } return -1; }
public void AddRange(DNNTab[] rows) { if ((rows == null)) { throw new ArgumentNullException("tabs"); } foreach (DNNTab row1 in rows) { this.Add(row1); } }
public int Add(DNNTab row) { this.AddAt(-1, row); return(this.owner.Controls.Count - 1); }