.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Tab Container, Tab panels with User Controls - bug?

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
Hello all, I have a aspx page with a tab container, and 5 tabs on it - 4 of which hold user controls on them. I have a strange issue that presents sometimes, and I am not sure just what is causing it. Here is the scenario : there is one user control on each tab. On each of those user controls, there are a number of radio buttons in Update Panels. If a user selects one of the tabs, then selects another tab and clicks on one of the radio buttons on that tab causing a postback, when the page refreshes, the content of the previous tab becomes visible at the top of the current tab, pushing the original content down below it - as if the content of the previous tab has been appended to the top of the current tab's content. Has anyone out there experienced anything like this? What I did to "fix" the issue was simply to go into the aspx code for the tab container, and change the order of the tab panels in the code, something like this :  <cc1:TabContainer ID="tabContainer" runat="server"> <cc1:TabPanel ID="tabFirstTab" runat="server" HeaderText="My first tab" > <ContentTemplate> <uc1:usercontrol1 ID="UC1" runat="server" /> </ContentTemplate> </cc1:TabPanel>

View Complete Post

More Related Resource Links

UI Datepicker and web user controls



I have developed an application using the Master-Detail pattern described in this Matt Berseth article.

The only difference between Matt's article and me is that I am using a FormView object in place of a DetailsView.

Everything works fine except that the formview object, in my case it's inside a user control and I can't figure out how to use the jquery datepicker UI plugin.

I have tried to put the script block for the datepicker either in the aspx page as well as inside the user control but in both cases the calendar does not come up when the related textbox get the focus.

Any suggestion on how to work with the datepicker inside an ascx?

thanks in advance!

Toolbox: User-Friendly UIs, Online Data Entry Controls, and More


Microsoft® Office is one of the most well-known and most-used consumer products. For many people, their only experience with a computer is when using Office, be it checking e-mail, creating presentations, or writing a document.

Scott Mitchell

MSDN Magazine February 2006

ASP.NET 2.0: Personalize Your Portal with User Controls and Custom Web Parts


ASP.NET 2.0 introduces a Web Part control that is designed to deal with the serialization, storage, and retrieval of customization and personalization data behind the scenes. In this article, the authors explain how you can put the WebPart control to work in your ASP.NET 2.0 applications.

Ted Pattison and Fritz Onion

MSDN Magazine September 2005

Advanced Basics: Adding New Features with User Controls


In past versions of Visual Basic, there were rudimentary graphics controls. In Visual Basic .NET you have the GDI+ library, which enables you to draw lines, circles, and most anything else. But how can you use the functionality of GDI+ to create lines and other graphics that respond to user mouse clicks and events? Find out.

Ken Spencer

MSDN Magazine June 2003

Windows Forms: Developing Compelling User Controls that Target Forms in the .NET Framework


In the beginning, writing controls meant dealing with Windows messages. Then came Visual Basic controls, which introduced methods, properties, and events. Later, ActiveX controls, which ran atop COM, became popular. While each innovation in control writing brought more flexibility, nothing has matched the versatility of the new .NET Windows Forms controls and Web Forms controls. This article, the first of a two-part series, introduces the reader to Windows Forms, beginning with their inheritance from one of the .NET CLR base classes, which makes control creation much faster than before. Control programming is illustrated through the development of a login control. The equally flexible Web Forms controls will be covered in Part 2.

David S. Platt

MSDN Magazine April 2002

asynchronous loading user controls


I have 3 user controls that I have to load at the same time.  They each contain a gridview that pulls data from the database.  They are doing a "delay" load of the data so there is a progress bar template that shows that the data is loading however the first gridview fires and loads, then the second, then the third and I need them to all fire at the same time.  Any ideas? 

User Controls and Control Extenders


Two separate questions, but sufficiently intertwined that I'm going to try the two together....

Firstly - User Controls and Behaviours

I have a User Control which contains a few visual controls.  I am attaching some behaviours by using GetScriptDescriptors and am passing some JavaScript to the browser using GetScriptReferences.  That is all rock solid and working well.  However, when developing, I did discover that I couldn't attach the behaviours to the User Control itself - not surprising as rendering a User Control does not create a DOM element which represents the actual control.  So, I have attached my behaviours to a "random" TextBox within the User Control. 

So - first question, is there a better way to do that?  For example, should I always be rendering a SPAN as an element to surround the control?  Not sure what that would do to the robustness of the rendering.  What is the right way to attach a behaviour to a User Control.

Secondly - Accessing those same Behaviours later

Assume I have placed a User Control on the page.  That User Control exposes a Property (actually a Javascript Function of course) which does "something" to the control - for the sake of example we'll say that the function is set_Border(colour). 

How to dynamically create user controls ?



can you explain how to create user control dynamically in a web form ?When i am creating server controls of user controls are not instantiated and it is not getting initialized .when i am tyying to initialize its properties error occurs tha object instance not created .

Any suggestion ? 

How to add user controls into toolbox?

Hello, I have created a user control with ComboBox  & TreeView together. I want to use this control as a component so that I can drag and drop this control to other windows form! So what are the steps to get user control into toolbox? THANKS!

How to pass param between two user controls?

Hello,I would like to convert some aspx code in user controls. This would lead me to having a master user control that contains other controls inside.The contained user controls have datasource with some control parameters that takes the value from a control present in the aspx (now) and that will then moved in the container user control.which is the best way to handle a scenario like this?thanks a lot

Dynamically adding User Controls -- newbie question!

I am new to ASP.NET (coming from ColdFusion, thank goodness I'm away from that!).  And I am have THE hardest time understanding how to work with forms in ASP.NET.  Here's what I am doing:Dynamically add User Controls to a PlaceHolder based on some int value (which currently is passed in a HiddenField).Fire an event if the WebControls inside of the User Control change, then handle that event in the Main Page (i.e. save the input to DB)When the user clicks the "Next/Continue" button, the next controls for the next page are loaded.And I guess maybe I just can't seem to get how things work in ASP.NET, because I am really struggling with the general idea of how ASP.NET flows.  Should I be dynamically loading the controls in Page_Init, or Page_Load?  Or should I load the controls when the buttonclick event is fired?Do I have to add the axCtrl.OnDataChange += new EventHandler(HandleAxControlDataChange); line on Page_Load?  Or should I put this in When I first load the UserControl, I need to initialize some WebControls within the UserContorl.  Is there a way to know if I have loaded new user controls into my placeholder?  I can't use Page.IsPostback, because after the first page, every page is a postback from the buttonclick.Any help for this confused newbie would be GREATLY appreciated!!Here's what I have: pu

Problem with user controls and the toolbox

Im building a control library, its just a library that builds to a dll with a bunch of user controls. But So far I can only get "user controls" to be loaded into the toolbox in a separate project. Many on my user controls need only be derived from a specific control and I often find using a user control is unnecessary for the control. So the question is, how can I get a control that is not derived from the user control class, to show in the toolbox, in a separate project? Another thing I would like to decorate my controls with an icon for the toolbox. I tried [ToolboxBitmap("Filename")] at the top of the class but it did not work for me.AbleOpus.ath.cx

Modify a batch of user controls

In a regular webform, I can enable a batch of textboxes Visibility switch on with the following command... Private Sub SetTextBoxesVisible(ByVal Page As Control) 'Iterate through controls, setting data textboxes visible For Each ctrl As Control In Page.Controls If TypeOf ctrl Is TextBox And Strings.Left(ctrl.ID, 4) = "dtxt" Then CType(ctrl, TextBox).Visible = True Else If ctrl.Controls.Count > 0 Then SetTextBoxesVisible(ctrl) End If End If Next End SubBut in an ajax webform, the above code will not work.Does anyone has any suggestion on how to tweak this subroutine?

Pass values between user controls on 2 different aspx pages

I have 2 user controls that is hosted by 2 different aspx pages.example: srcpage.aspx --> hosts the --> sourceusercontrol.ascxanddestpage.aspx --> hosts the --> destinationusercontrol.ascxI would like the values in the text fields of the sourceusercontrol.ascx to be passed on to the labels in the destinationusercontrol.ascx. I have gone through the MSDN ASP.Net examples and i was able to successfully pass values between two aspx page using the postback URL functionality, but cannot do the same thing with the usercontrols on 2 different aspx pages. Any suggestions would be helpfull....! Thanks..! 

Enable/Disable controls dynamically based on User settings

In my project I have a requirement that all controls in each window shall be enabled or visible dependent on user and the admin shall be able to change is a user will be able to use or see the control. I made a very simple test application that creates a user and gives him a list (will be loaded from db in real app) of the name of the controls in the window and also his settings. Then after initializing the window I use reflection to find the controls and set their isenabled/visibility properties. This solution does the thing but I'm wondering if there is a better solution. The main issue here is that each control must be set per user and thus roles wont work appropriate and also that I need to be able to change the settings at runtime.  

nested user controls



i have two usercontrols say usrcntrl1.ascx and usrcntrl2.ascx. In usrcntrl2, i have just few links defined. And I want this usrcntrl2 to show up in every page just like header. And now i have usrcntrl1 to call usrcntrl2 on the page_load. How to use nested usercontrols in this case? Is it possible ?

Give permission to all users of a customized sharepoint portal, where all the user controls of the w

Hello there

I have created a sharepoint portal and customized it. I have created my own master page and there are many webparts implemented. This has been hosted in a MOSS server. When a normal user is trying to access the portal first thing in the morning, he is getting a "You are not authorized to view this page" error. But when a site admin access the site, there is no issue and he is able to access the site. The site admin does nothing in the site and once he has logged in to the site,  the user is able to access the site without any trouble.

I have found what was causing the issue. But dont know whats the fix for it.

The issue is...We were trying to place all the usercontrols created as part of our application in a seperate folder under ControlTemplate folder. This is what was not allowing the users who are not site admins. But it was ok, when the admin first accesses the same.

WHat is the fix for this ... to make the new folder accessable to all users ??

Kindly help...

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend