How to use ASP Controls inside a jQuery Dialog box ? - asp.net

I have a div which is working as a jQuery Dialog box. Inside that I have two asp:ListBoxes and a asp:button. I want to select an Item from the ListBox1 and when clicking the button that Item should move to ListBox2. But when I clicking on the button Postback occurs and closes the jQuery Dialog.
How can I solve this ?

Put an UpdatePanel "inside" the Dialog Box and put asp:ListBoxes inside UpdatePanel so you prevent page from doing refresh and also Dialog Box doesn't disappear because it's outside of UpdatePanel.

Related

prevent modalpopup closing on postback

I have a textbox, button and gridview inside jquery modal popup. On page load I display the modal popup and enter a value in textbox then click button. In code-behind I wrote some functionality to calculate something and displayed it in the gridview but the modal popup should not close. In my case, while post back the modal popup closed. I'am not using modalpopupextender and update panel, without using modalpopup extender and update panel how to prevent modal popup closing while post back?

modal popup appears on screen on click of every usercontrol

I have multiple usercontrols in my home.aspx page.In the Header.ascx I have button imgbtnCreateAccount,On Click of this button modal popup appears on screen.
Now apart from this I have Product search User control ProductSearch.ascx.I am retrieving data from database for both the usercontrols. In producdtsearch.ascx page I have label, textbox and submit button.
If I leave textbox blank and press enter,it gives me required field validator which is fine,but when I type something in textbox and press enter it gives me modal popup which should not happen.It appears for all the other usercontrols which is textboxes in it.I have tried adding default button to the panel in which modal popup appears,but still nogo.Also tried changing the text property of imgbtnCreateAccount,still no go.
I also tried to set tetbox property to autopostback=true,but what haapens is that, the background of modal popup blinks for a second and then goes off. Modal popup should only appear on click of imgbtnCreateAccont which is Header.ascx page and nwhile entering tect in any of the textboxes of other usercontrols.Kindly suggest the resolution.
Issue got resolved as i added panel and inside the panel i have div which contains table.there is button in table.i have set the default button property of panel to this button name and the issue got resolved.

Using ModalPopupExtender in ASP.NET Repeater

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!

How can I update using Ajax when I am displaying an image in a handler?

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

Listbox appears through modal popup extender

I have a base page in which i have a listbox.
The base page is also having a modal popup extender.
When the modal popup extender appears over listbox, the listbox appears through modal poup.
That is, only for listbox, the popup extender becomes transparent.
What shud I do for this?
My understanding is that, since listboxes/dropdowns are windows controls, they will always appear over the modal popup.
I haven't tested this, but your best bet may be to write some code in the button click handler that launches the popup and either diable or hide the offending control.

Resources