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


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

Show/Hide controls very slow.

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

Hi,

Would like to seek advice, what is the best way to show/hide controls in .net?

I have a page with many show/hide depending on the control value.

eg. radio button list rbl (dynamically generated from the database values)

based on the radio button list value,will need to show/hide the other controls.

if the value is 1, will need to show or hide dropdownlist1.

if the value is 2, will need to show or hide dropdownlist2.

I tried using the javascript with rbl.Attributes.Add("onChange","return toggleDropdown();")

then in my javascript function i will show/hide the control.

However when I toggle the dropdown for the second time, it became very slow. The first time is okay.

I have also tried using ScriptManager and UpdatePanel (putting the controls inside the UpdatePanel), but it is also very slow when toggling dropdown for the second time onwards, causing the page to hang.

Any idea how to solve this?





View Complete Post


More Related Resource Links

how to hide/display controls in NewForm.aspx based on dropdown value in SharePoint list

  

Hi,

I have 1 dropdown in my sharepoint list with other columns. If dropdown value equal to 'xyz' i need to display some other controls, otherwise these controls should be hidden.

I know we can achieve this with javascript. If any one can provide code or sample then it will be appreciated. or is there any other alternative methods to do this ........


Thanks & Regards, Neerubee

Show/hide dashboard items Sharepoint

  

Hello!

I'm having a problem with trying to filter the appearence of items on a sharepoint site by having a dropdown list and filter according to the current value, The method i am using atm is by having javascript and by looping through all the <td> on page. This works for list views, But not for Performance point dashboard objects/web parts, +

Is there a way to somehow get the title of all performance point objects on a page, fill the dropdownbox show/hide depending on the selected item in the box?

 

BR


Issues with dynamically created TabContainer (Hide/Show TabPanel)

  

I have a web page that contains an UpdatePanel. In that panel, there is a TabContainer control that has 5 TabPanels, only the first one "Tab 1" will be displayed during initial page load. There is an Add button in "Tab 1", whenever it gets clicked, I will add (show) the next TabPanel (Tab 2, Tab 3, etc., all the way to Tab 5). "Tab 2" thru "Tab 5" contains a Close button that will close (hide) the current tab when clicked.

I'm doing all of these from code behind (dynamically create controls in Page_Init event and re-generate them during postback, track each TabPanel's content in a session variable, etc.), and everything seems to work just fine IF after adding several TabPanels, I remove  them in order (i.e. remove Tab 5 first, then Tab 4, Tab 3, etc.). It will NOT work whenever I try to remove a tab in the middle, then I will get all kinds of strange results.

I've attached the sample codes here for reviewing and testing. Any help is greatly appreciated.

 

==================== demo.aspx page ====================

<%@ Page

NewForm.aspx - Show/Hide fields dynamically

  
I have about 20 + fields in a custom list.  I want to be able to show and hide fields depending on user selection.  Does anyone know a way of accomplishing this? Ive tried some embedded javascript but can't seem to get it working in sharepoint. Please help :)http://lbellows.blogspot.com http://www.ptreviews.net

How to sequentially show/hide

  
I appologize upfront if this is a noob question.  I have to teach myself this stuff and have no one to ask questions of.  I promise I searched both online and in books for the answer before posting, but still can't make sense of this. Initially I should state that this is all supposed to be wrapped up in a modalPopup.  I have no problem getting the popup to trigger and display, the issue is the content. I need to create a page that will display a series of paragraphs sequentially (instructional material).  I would like to have each "step" of the instructions put into a <div> with a "next" button that lets the user confirm that they have understood the step and ready for the next step.  I would assign each <div> a unique id, eg. "Div1", "Div2", "Div3", etc. I would assign the "visibility" attribute of Div1 to "visible", and all other Div's to "hidden".  When the user clicks the "next" button, Div1 would have its "visibility" attribute changed to "hidden" and Div2 changed to "visible".  This process would repeat until all the steps have been completed. I have seen some code that uses the system method getElementByID() but I just simply could not figure out how to get it going.&n

After async postback, hide/show panel stops working

  
I have a Gridview in an UpdatePanel with a column containing an "expander" button that shows (and hides) more detail beneath its row of data.  It all works great until the user pages the gridview.  After the async postback to page the gridview, the javascript function to toggle hide/show appears to work flawlessly (the expander's button image even changes correctly), but the detail panel just doesn't show on the page.Note that my expander control supports a "AsyncTriggerId" property that, if set in the markup, will rebind the javascript toggle function when that control triggers an async postback (see OnPreRender below)Here's the hide/show toggle javascript:function toggleExpander(divId, imgId) { var div = document.getElementById(divId); var img = document.getElementById(imgId); var cssClass = div.getAttribute("className"); if (div.style.display == "" || div.style.display == "none" || cssClass == "hidden") { div.style.display = "inline"; div.setAttribute("className", ""); img.src = "images/dir_down.png"; mce_src = "images/dir_down.png"; img.alt = "Collapse to hide details"; } else { div.style.display = "none"; img.src = "images/dir_rig

Master Page show/hide links

  
Hello,        I'm fairly new to mvc and I'm just looking for a best practice on hiding action links in the master page depending on the user logged in. Since the master page doesn't receive a model I'm not sure how to pull this off the right(MVC) way. Thanks

Using jQuery .hide() and .show() on panel sets doesn't maintain status through postback. Viewstate

  
I'm using jQuery against a set of three asp panels.  I set up an 'onChange' function for a dropdown list that dictates which panels to hide and show based on the UI selection.When the page first loads, one of the panels will be shown, the others will be hidden.  Let's say pnlOne is showing because the dropdown has option 1 selected.  This is done on the server with this:pnlOne.Style.Add("display","block");//and all the other panels are set to ".Style.Add("display","none");" based on logic.Then, the user selects a different value in the dropdown.  Let's say they select option number 2.  With javascript and jQuery I do this:$("#<%=pnlOne.ClientID %>").hide();$("#<%=pnlTwo.ClientID %>").hide();$("#<%=pnlThree.ClientID %>").hide();switch($("#<%= ddlOptionNumber.ClientID %> option:selected").text()){case "1":$("#<%= pnlOne.ClientID %>").show();break;case "2": etc.,}The issue is when the page posts back.  I'm running client side validation only at this point.  (Even if I add client side in the future I will still run client side as well to avoid security issues.)  When the validation functions detect an issue and the page returns to be displayed, the original panel (pnlOne)

How can we show and hide iframes progarmmtically in javascript, calling the function from a seprate

  
I have currently placed 5 iframes inside 5 divs and i m trying to show and hide iframes by following code if (docid == idpath_array[1])             {                document.all("div1").style.display = 'block';                document.all("div2").style.display = 'none';                document.all("div3").style.display = 'none';                document.all("div4").style.display = 'none';                document.all("div5").style.display = 'none';            } but the problem is that after setting style of one div as display:none,I am not able to display the same div latter by setting display:block hence programmically I am not able to display an already hidden iframe by making display:block in div

Show and hide items in the list as per permission (depend on the permission)

  

Dear all,

In sharepoint 2010

How I Show and hide items in the list as per permission.

i.e the user can fill the most fields in the list and we need to prevent him to see manager's fields in the same list.

Thanks


Loading please wait image show hide

  

Hi,

I am trying to implement the loading please wait image funtionality while controls refersh on the page. Here are steps I have taken:

1. Added the image to the .net solution file in the image folder.
2. Added a div with the hidden class that holds the image source on the webform.

Image loads hidden by default and I am trying to show it when any postback or partial post back occurs. There are several controls like dropdowns, checboxes, gridview etc and links in the gridview that could take a few moments to load so I want to display the loading please wait while they reload after selections are made. All Controls exist in the update panel. I can't figure out how to show the image and hide it again when controls are reloaded. I am trying to add to this existing jQuery, my challenge is events occur after the document has been loaded so I need to add Ajax events to this query to show hide the loading please wait image. Here is what I have so far



//Dialog box settings

$(document).ready(function() {

    // $("mytest").dialog({
        title: "   Test",
        resizable: false,
        modal: true,
    &nbs

Show or hide programmatically based on audience

  

I'm trying to either show or hide a datalist control based on a users Audience.

      AudienceLoader audienceLoader = AudienceLoader.GetAudienceLoader();

      string audienceFieldValue = "United States";

      if ((AudienceManager.IsCurrentUserInAudienceOf(audienceLoader, audienceFieldValue, false)))
      {
        DataList2.Visible = true;
      }
      else
      {
        DataList2.Visible = false;
      }

I have tried couple different things this is where I'm at now... any help would be appreciated.

Thanks

 


sayitfast

how to hide html controls if user logged in

  

Hi:

I am combinning .aspx pages with some html pages.

If user logged in (use asp.net membership function), I need hide a html user control which is locatd in .html page (such as html input control), how can do that?

Thanks

JT


Hide a measure group in excel 2007 'Show Fields Related to'

  

Hi All,

I know that if a I want to hide a measure group to users I have to set the properties 'Visible' to false for all the measure of the measure group.

But when I open a connection to the cube with Excel 2007 I see again the measure group in the drop down list 'Show Fields Related to' in the 'Pivot Table Fields List'.

I don't see it in the measure group list when I choose 'All' in the 'Show Fields Related to', but i don't want to see it in the list 'Show Fields Related to' too.

 

How I can do to hide permanently the measure group?

 

Thank you all,

SimonaP


is it possible to hide a link in the sitemap, yet still show the breadcrumb on the page?

  

We have a dynamic sitemap and all nodes in the sitemap display a breadcrumb.

Is it possible to have the breadcrumb still showing, but make the link in the sitemap invisible or non-clickable?

Reason for this is that...
we dont want users to select some pages from the sitemap (becasue they need to conduct a search first to populate a datagrid) and clicking on the link will only take them to an empty page.


I tried just removing the url, or having a blank title, but that didn't work.

perhaps a stylesheet and display none or something..?


thanks,
mark.


GridView: Hide validators and show validator summary

  

Hi, I want to have TextBox validators like in this case: http://msdn.microsoft.com/en-us/library/ms972948.gridview_fig45l(l=en-us).gif

I transfer the code to my necessities but the error message, displayed at the textbox, is the same as in the summary.

In the msdn - example there is only a asterisk at the respective textbox where the validation fails and the full error message is displayed in the summary.

How can I handle this? It seems to me that the validation summary only repeat the single error messages of the validators. When I set the single validators vissibility to "hidden"(which I would also use, because I thought they are still displayed in the validation summary -_- ), they are not displayed in the summary too.

 


Using Javascript to show/hide asp elements

  

I have an address page that validates via USPS.  The user inputs their address and clicks the "validate" button.  The "validate" button goes away, the validated address is displayed and a "submit" button shows up.  If a user makes a change to their address after they have validated, they need to be forced to validate again.  However that's not happening.  The visibility doesn't change at all.

Here is my script:

<script language="javascript" type="text/javascript">
    function HideValidated(form) {
        document.getElementById('<%= trValidate.ClientID %>').style.display = "inline";
        document.getElementById('<%= trCorrected.ClientID %>').style.display = "none";
        document.getElementById('<%= trSubmit.ClientID %>').style.display = "none";
    }
</script>

Here is part of my HTML:

<asp:TableRow runat="server" ID="trValidate">
        <asp:TableCell><asp:LinkButton ID="btnValidate" runat="server" OnClick="btnVa

Categories: 
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