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

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

Panel Visibility Problem!

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net

I am making a project in which i databinded dropdownlist which contains two options and I created two pannels containg more controls.

When option 1 is chosen pannel 1 becomes visible and when option 2 is chosen pannel 2 becomes visible.(This is Suppose to happen)

When i run it and i choose option 2 it works perfectly whereas when i choose option 1 both the panels appear.

 I have set their visibility as false and written this code behind

protected void dropdownsource_SelectedIndexChanged(object sender, EventArgs e)
        if (dropdownsource.SelectedValue == "Air")
            Panel1.Visible = true;
        Panel2.Visible = false;

        if (dropdownsource.SelectedValue == "road")
            Panel1.Visible = false;
            Panel2.Visible = true;


View Complete Post

More Related Resource Links

Problem with master page and update panel (I think)



the app I am working with is made up of three nested master pages that have the following design:

The first master page ha only realize the HEADER, BODY and FOOTER divs.

The second one specialize the Body content placeholder and divide it in three more layers: NAVIGATOR, PAGE TITLE, BODY CONTENT.

The final layer specialize the BODY CONTENT in PAGE CONTENT and ACTIONS.

In one of my content pages I have (inside the PAGE CONTENT area) 

  • 1 Update Panel that contains a gridview object
  • 1 Update Panel that contains some HTML code to show in a PopupModalExtender

The PopupModalExtender can be either triggered from inside the gridView and also from a series of LinkButtons that are in the ACTIONS area.

The problem is that when the PopupModalExtender shows the FOOTER and the ACTIONS areas are not dimmed from the style I apply as background to the modal popup. An example of what I am trying to explain can be viewed in the following screenshot.

Why this is going to happen? Has anybody any suggestion on how to solve this problem?

Thanks a lot

Document Information Panel problem with Infopath

Hi, I have created a custom document content type that uses a specified word template deployed by a feature for a sharepoint site collection. The Content Type is defined in site collection level i have add a column also defined as a site column called "Abstract", and I added this column to my content type. Now I want to create a custom DIP using Infopath, when infopath is launched it maps all column from this content type. The problem that the "Abstract" column wich is defined as rich text and optional column is not mapped correctly Infopath show that field as a required field and can not be blank. When i added this content type to a document library and try to create a new document i have an error "Document Information Panel cannot create.. problem on the schema with Abstract field". When i try to modify the xsn file at the document library level and republish the form it works but when i do it in the site collection level it's impossible to map the field properly. Any suggestions about what might be causing this problem or how to fix it would be greatly appreciated. ABT

Problem with Ajax calendar extender visibility

sir i am using ajax calender extender in textbox below this textbox i am using a panel there is a gridview that show data.problem is when i click the textbox half of the calender id hiden behind the panel how to solve this problem. 

problem with update panel height

I am using ajax update panel to show a tree without postback there is a label that is at the top of the panel I am hiding the label while showing the tree. document.getElementById('ctl00_phldDialogBody_lbltext').style.display = "none"; in the javascript but even after hiding the space of the label is still left blank causing the tree to be moved down pls help to fix it i want the tree to be at the same position

update panel and jquery problem

I m working on JQuery, I have one UserControl in that I have taken one button(it is present inside an updatePanel).  when i m clicking on button on that time i want to show alert from server side for that i have written-  ScriptManager sm = ScriptManager.GetCurrent(Page); string strScript = "alert('hi')"; ScriptManager.RegisterStartupScript(this, typeof(UserControl_FrmUConFriendList), "AlertKey", strScript , true); But it is not working, if i m removing updatePanel then it is working. So plz help me. Thank's in advance.    

Upload panel problem



   I have used update panel in one my application page,but it takes too long to load when any event is fired on that page.If I remove update panel then that page works fine with post back and taking normal time to load.But when I add update panel it takes too long almost 1 minute to load.Can any body help to resolve this problem?


Thanks & Regards,


Problem with User Control, Update panel and flicker


I have  block of code that consists of a textbox a button and a dropdown. The text entered in the text box filters the dropdownlist when the user clicks the button. The Ajax works great when it is in a simple page but if I put the same code in a User control I get flicker. Can anyone assist with this issue?

panel problem with opera,safari and chrome



I have an update panel on a form with two panels inside,one of them is hidden on pageload,there are divs inside panels and inside the hidden div there's an iframe. By clicking linkbutton the visible div become hidden and hidden become visible.At Internet Explorer and Firefox,there's no problem but at Chrome,Safari and Opera the second div that become visible by clicking linkbutton is not shown properly,it's sliding to right. I tried all possibilities about positioning at css for second div.Absolute,relative,fixed but none of them worked,i also tried without positioning but nothing changed. Is there any idea ? Thank you

problem with user control+update panel+javascript


hai all,


Im having a aspx page which has 5 tabs inside a update panel..also I have a user control

Wen I click each tab im dynamically loading dat user control .

The problem is im using javascript in dat user control..

the user control has a button which displays a panel containing three grid views  n s activated by a java script as given below..

function Elig()



'<%=btnLegend.ClientID %>')).click(function(){


('<%=pBody.ClientID %>')).slideToggle('slow');




Wen i run the aspx page the first tab  successfully loaded with dat user control n a

Back button and update panel problem



I have a search page that uses an AJAX update panel to deliver results to the user. They can then navigate to a product page for more info. So far so good...

My problem occurs when they are on a product page and use the back button. They are redirected to the search page, but its a blank search page and not the one they left when they clicked for product details. I realise this is because the browser only made a history 'marker' (I dont know the technical term) when they first came to the search page, so this is what it returns them to.

Does anyone know how I can make the back button redirect the user to the search page as it was when they left it? I have tried making the page expire immediately and storing the search terms in session state so I can rebuild the page when they click 'back'. This works in IE, but not in Firefox as it seems to just load out the old page from the cache regardless of the expiration policy I set. As if that werent bad enough, this also causes 'corrupted state information' error when they try to search again.

Any suggestions? Any help would be very much appreciated.

Thank you

(PS -  I have seen various solutions to the back button/ajax problem, but none of them seem to address my problem. Or have I missed something?)


Problem with the layout of the parameter panel


I work on several server or vm, and did not have this problem before until this new vm.  For all my reports, the parameter section of the reports is not displayed properly.  It usually displays the parameters on a grey background, in this case it's totally white.  Also, the section containing the arrows to go to a page, the zoom, the find/next, the refresh...has the same problem also.  Where can I look to solve this?



Update panel problem in gridview footer


On my aspx page, I'm having troubles when I have an update panel within the footer template of a gridview. It appears to be an intermitent problem that occurs on subsequent postback when you do a delete command in the gridview. The first delete command always goes through fine (first postback). Clicking on another row to delete on the gridview (or any other button on the form) triggers this error:

An error has occurred because a control with id 'ctl00$SupremeContent$grdLineNumbers$ctl09$ctl00' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.

If you click the back button in the browser, then click on another page, then come back to this page, you can delete another record. Another attempt to delete another record brings you back to the above problem. Thectl00$SupremeContent$grdLineNumbers$ctl09$ctl00 changes each time you delete, come back to the page and delete.

If I disable the udpate panel, there's no errors.

The reason I have the update panel is so that the user can select the relevant pipe specification (they see multiple columns using a textbox, drop down extender, panel and gridview) without the form's data being reset by the embedded gridview's

Problem with creating more than one Panel


I have this code:

in Default.aspx:

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />

    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /><br /><br />



    <asp:PlaceHolder ID="PlaceHolder1" runat="server">




and in Default.aspx.cs:

    protected void Button1_Click(object sender, EventArgs e)
        Panel pan = new Panel();

Modal Popup Extender and an Update Panel - "Cancel" Button problem


This should be a quick "yes" answer - I am in the process of creating a very simple test, but I thought I'd ask on here too (also, so other people might be able to find the answer, if they have the same problem).

I have created a modalpopupextender that opens up a panel containing an update panel.  I have a cancel button that is tied into the MPE's [CancelControlID] property and this closes the popup when I click it.  However, if I perform a partial postback within the update panel, the cancel button no longer works.  I have found an example online that seems to imply that the cancel button (and I'm guessing, by association) and the OK button should be outside the update panel.  Does the partial postback break the buttons' client script bindings, and thus should they always be placed outside the update panel?

problem with greybox inside update panel


Hi ,

i am using an link which displays the window in a grey box

<script type="text/javascript"> var GB_ROOT_DIR = "<%= ConfigurationSettings.AppSettings["SunTrust.SOS.BaseURL"] %><%= ConfigurationSettings.AppSettings["Root_Dir_Lightbox"] %>";

<script>script type="tex

Update Panel Postback Problem?



Related to my previous question which is answered. The deal is, there is an update panel for modalpopup extender that is triggered by a button. The problem is when the form is submitted by a button, this modal popup is seen on the page! I do NOT want this modal popup extender to be seen when the form is submitted.

Any help please?

Thanks in Advance.

Best regards.

<asp:Label ID="lblPopupTargetID" runat="server" Style="display: none;"></asp:Label>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lblPopupTargetID"
PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="true" />
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Width="600px">
<asp:UpdatePanel runat="server" ID="UpdatePanel1">

Update Panel Problem?



I want to update a portion of my page. There is a dropdownlist and a checkbox. I want to update checkbox (checked...etc) when user changes the selected index of dropdownlist. Here is the code below. But it does NOT update the check box?

Any help would be great.

Thanks in advance.

 <asp:UpdatePanel runat="server" ID="UpdatePanel9" UpdateMode="Conditional">
                            <asp:CheckBox ID="CheckBox_otipi" runat="server" Text="<%$ Resources:OdemeTalep, CheckBox_otipi %>" />
                            <asp:AsyncPostBackTrigger ControlID="DropDownList_parabirimi" EventName="SelectedIndexChanged" />
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