I have 15 dropdowns on the page, and they are cascading dropdowns.
second dropdown loads data depending on the first one.
Whenever i change the dropdown item. It is posted back, and page flickers
can i remove it
so that my page stays still when the next dropdown loads
You want to do one of two things: either avoid the postback altogether, or set it up so that the whole page doesn't refresh. There are a few approaches I can think of to fix this problem:
1) Take a look at the CascadingDropDown control in the asp.net AJAX toolkit
2) Look into using the UpdatePanel control to cause the part of the page with cascading content to post back asynchronously
3) If the content of the cascading dropdowns is static, you may want to implement the dropdowns in a client-side script; either using native JavaScript events or a JavaScript framework like jQuery. example
I am creating a .net website in c#.
The master page contains a fixed footer bar from which you can display 'bookmarks'. I also have a remove function for each bookmark.
Some aspx pages may have a add bookmark/remove bookmark function (a button control) on them.
I use update panels throughout so button controls are always encapsulated by one.
If I add/remove a bookmark from an aspx page, I can trigger an update to the fixed footer panel. A delegate event is triggered in the aspx page which calls a method on the master page to update the fixed footer panel, so everything is sync'd dynamically.
It doesn't seem possible to do the same the other way around. If i remove a bookmark from the fixed footer, I would need to know if the current aspx page was displaying a bookmark control. Pretty much impossible I would have thought, but I'm open to suggestions.
With that in mind the question really is does anyone have a technique that they use to deal with these scenarios, such as calling a full page update or something similar, or is it a case of doing nothing until the next page load/postback?
Thanks in advance.
I have two modal popups on a page, both inside user controls, and both have different names, and different behavior id's. Also, the hidden buttons used with them have different id's. I use javascript to click those buttons to show the popup.
On load of the page, the first popup is hidden, but the second one is not, and is at the bottom of the page completely visible. When I click the link that is supposed to show the second popup, the first one is shown instead, but the javascript to load the default values into the first popup does not run, so I'm confused as to what is going on. Any ideas?
I have solved the issue. My situation is bit different. for you both pop ups are in a user control. But for me only one is in user control and other one is in the page itself. hope this will shed some light on your issue.
I gave different id's for
Hidden Target button (TargetControlID)
OK button (OkControlID)
Popup Panel (pnlPopup)
Model Popup control
Still if you are not sure, try your page in firefox with firebug installed. This will help you to identify any java-script errors.
Hope this helps.
I have used Update Panels in my ASP.net webpage. I have a modal popup. But the tab index is set to -1 for all the parent page controls once the modal popup comes in picture.
Does anybody has resolution for this. I tried again reseting the tab index through javascript......But its not working(may be DOM is not getting refreshed)
Regards,
Justin Samuel
I have seen this happen when you have multiple ModalPopupExtender controls open at the same time. If you hide whichever popups you aren't currently using, that fixes the problem. (Or at least it did in my case.)
I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server.
I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so left it there) that makes the current panel not visible and a sibling panel visible. This works with the exception that the button must be clicked twice. Not double clicked, but clicked once than clicked again.
In setting breakpoints I discovered the code behind that's attached to the button is actually being executed on the first click, but the panels don't switch as expected. If I click the same button OR worse yet, a different button, the expected behavior of the second panel appearing occurs. However, with the second button being clicked there's an unwanted bonus of a third panel being displayed, the third panel being made visible due to the second button being clicked.
I'm assuming this behavior is due to the updatepanel and its Ajax nature. Is there a way to avoid the second click? Am I misusing the updatepanel? I really wanted to use a modal popup (right out of the AjaxToolKit) but had problems with posting back the data so I opted for this approach. Any insights, assistance, even criticism would be welcome as this has plagued me long enough. Thanks
If you get rid of the UpdatePanels do things work as expected with PostBacks? Chances are something in your Page_Load or other event higher up the chain are "resetting" things in some way before it gets to your click event. Could this be the case?
I think your problem is that only the update panel is receiving data from the server after the method executes. The panel your are trying to change is outside of the update panel so it does not know that its properties have changed.
You either need to do a full page postback or have the panel you wish to modify inside the update panel.
I have run into this before and resolved it, I just can't remember how. I will try to find my old code and get back to you. one thought, do you have EnablePartialRendering enabled in your scriptmanager? maybe try wrapping both containers in a third panel.
Your update panel is sitting inside the other panels.
Should that be the other way around? AFAIK only controls within the update panel will get updated in via the AJAX call.
Here's a fairly simple solution. (I was having the same problem this morning.)
The UpdatePanel can't render stuff outside itself. So, as you noticed, the updates are happening, but you're not seeing the result.
The easiest solution is to force a full postback. You can do that like this:
protected override void OnInit(EventArgs e)
{
var scriptManager = ScriptManager.GetCurrent(this);
// or this.Page in a UserControl, etc.
scriptManager.RegisterPostBackControl(someButton);
scriptManager.RegisterPostBackControl(someOtherButton);
// etc. for each control that needs to update something outside the UpdatePanel
}
This still allows the buttons themselves to be updated in the UpdatePanel by Ajax (e.g. changing their state to disabled or enabled). The full postback only happens if the buttons are clicked.
Like others have said an update panel only updates its contents, thats one of the main benefits of using it.
Panel2 and pnlPrvCmt need to be inside your update panel for your button click method to work. Another option would be to put Panel2 inside one update panel and pnlPrvCmt inside a second update panel. Then any control inside either update panel will cause both to refresh, as long as the UpdateMode=Always (which it is by default).
Try giving the dynamic control an ID when it is created. For some reason this is required by .net for a dynamic control to work in this context.
myControl.id="newID"
I have found this to occur under 2 different scenerios:
No ID set on the control. Either the ID is left off of the markup or the the ID was not set when a dynamic control was created. ASP.Net uses the ID to track actions.
Nested UpdatePanels. Scenerio: When using a Masterpage, you might have a content placeholder that you wrap in an UpdatePanel so that an UpdatePanel is not needed in the content on the page. Then, in developing your page you might, as a habit, add an UpdatePanel.