I have an ajax control toolkit modal popup on my page and in that modal popup i have a gridview on which user select some item through checkbox on each row of gridview. Whenever user check or uncheck on checkbox my modal popup automatically hide. I have set autopost property of checkbox set to true becuase im perporfing some calculation on each checkchanged event. what may be the problem
Your page is posting back because of the autopostback="true" on the checkbox, thus hiding the modal popup.
Look up 'ASP.Net Page Lifecycle' for further understandinf. It is important to know how this works.
I'm sure you'd also like to know how to solve this.
You could:
Set AutoWireUp=false on the page, but then you'd have to wire all events on the page manually. Since you aren't familiar with the Page Lifecycle, I'm not sure how successful you'd be.
Use a javascript-only modal popup.
Perhaps an UpdatePanel can be used.
Related
I have a page with 2 buttons on.
I want to show the updateprogress only when the page is submitted via one of the buttons, but not the other cancel button. I've been struggling for a while to come up with a solution.
Anyone know how I can do this?
Add parameter AssociatedUpdatePanelID for UpdateProgress, and set AsyncPostBackTrigger for UpdatePanel to button you want to make a postback.
If above instructions doesn't help, you can also try to wrap controls you need into asp:Panel control and set DefaultButton to your Submit button ID.
When using ModalPopupExtender inside a repeater, when the page loads, ALL of the popups appear without being called ( one for each item in the repeater) and then rapidly dissappear. With this, the popup works , but the problem is these popups being showed at the beginning. The popup is an OK/CANCEL popup, that triggers a postback when OK is clicked and does nothing when cancel is clicked. It is loaded on page load so that it exists when the user clicks on a linkbutton on the repeater. When the user clicks on the linkbutton, our intention was taht the popup appear directly without doing a postback, and this was achieved , just that small problem that random parade of popups at the beginning!thank you in advance!
I was not able to answer until now, sorry.
Turns out the HTML code and the CSS had conflicting codes and that made the popup appear!
I have a complex page. Basically, it is a ListView with images displayed through handlers. Paging is done through a datapager. This is all wrapped in an Ajax UpdatePanel so it pages seamlessly.
When the user sees a image they like and click on it, it should display in an image above the ListView. This work when I DON'T use the updatePanel, but of course, then I get flicker. Wrapping it in an update panel results in the paging working. When the user clicks an image it goes to the db as expected, but it simply never updates the image being displayed.
Here is how the image that is clicked on is defined.
<asp:ImageButton ID="imgbtnImage" runat="server" ImageUrl='<%#"~\Handlers\ThumbnailDBHandler.ashx?id=" & Eval("ID")%>' CommandArgument='<%#Eval("ID")%>'/>
does yout asp:ImageButton stays "in" update panel? 1 more thing, set update panel to use child as trigger. Because the event that postback in binable control is sometime not the control itself. It use the bindable control to postback.
eg. i have button in each grid view rows. when the button clicked, the update panel doesn't read the click event. it read the event as GridViewRowCommand. Not button click.
so set update panel to use child as trigger ans set to always update should solve the problem
I have a page with a user control which gets some data updated via a modal popup. Upon clicking "ok" on the modal popup - the new data is being written to the database - but the base page doesnt "reload" to show the updated data. How do I get that to happen?
1) Don't set the OKControlID property on the ModalPopupExtender.
2) In your Page_Load, set OkButton.OnClientClick = string.Format("$find('{0}').hide();", modalPopupExtender1.ClientID);
Explanation:
Setting the OkControlID stops the button from posting back. Instead, manually use javascript to hide the extender, which will allow the button to post the form.
You'll either have to update that control using ajax, or you could just do a Response.Redirect(assuming your modal is .net, or document.location if js) back to your page after your data has been updated.
Make sure the "Ok" button in your modal popup is causing a postback. If you want it to be ajax-enabled, make sure to put it inside of an update panel.
I have a progress bar (which is a user control). When user, click a button, this progressbar will get displayed. The issue is ...even if the progressbar is visible, I am able to set focus to other controls in base page. I need to blur the base page...and set focus to user control.
Plz help me ...Thanks in advance...!
The latest version of the ASP.Net AJAX toolkit has a ModalPopup which takes care of this behaviour for you - just set the PopupControlID of the Modal Popup Extender to the ID of your control and the TargetControlId to the button which will trigger the popup.