Showing posts with label buttons. Show all posts
Showing posts with label buttons. Show all posts

Wednesday, March 28, 2012

Modal Popup Disable Background

I have a modalpopup for viewing some labels and buttons. But when i show modalpopup, background will not be disabled in IE 7 (it works for Firefox 2.0.0.3) . I looked at the codes in

( http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx ), but it has <atlas tags, not <asp tags.

Any idea?

Regards..

if you use the default css classes which are also used in the ajaxcontroltoolkit samplewebsite the background will be disabled in FF, IE6 and IE7.


Of course i tried it before writing here. But it did not work.

Regards..

Modal Popup Extender and Page Refresh ?

I use Modal Popup Extender and there are two buttons, login button and cancel button...Everytime any of the buttons are clicked whole page is refreshed. I want to stop that for cancel button, but don't know how that will work for login as I want some underlying events to happen when that is clicked.

How can I achieve the above functionality ?

Wrap the modalpopup in an updatepanel to take advantage of partial postbacks. You can also assign the cancel button as the cancelcontrolid of the modalpopup so that it will close the popup using JS without a postback.

Monday, March 26, 2012

Modal popup extender postback issue

Hai

I'm using Ajax toolkit modal popup extender to open the popup window, In that window having two buttons, save button save the entered information into database and cancel button close the popup window.When click the save button changes are saved and window remain open, this is my requirement. But when i clicked that save button the informations are saved and popup window is closed.

How i will get my requirement ? Plz help anyone.

kamal...

use Show method of the control object to make it visible


Hi Kama19101980,

If you want to show a window when storing data to database and hide the window as soon as the process finished, I think you should better useUpdatePanel + UpdateProgress. Otherwise(keep the window open after storing the data), we shall use UpdatePanel + ModalPopupExtender.

Now you can put all the inputs inside an UpdatePanel and the Button is set to be the trigger of the UpdatePanel or just inside the UpdatePanel.For example,

<UpdatePanel>controls <Button></UpdatePanel>

When the partial update occurs, we show the ModalPopupExtender. You can do it like this,

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);

function BeginRequestHandler(sender, args){
$find("ModalPopupExtender's BehaviorID").show();
}

I hope this help.

Best regards,

Jonathan

Modal popup in tabs

Hi Im trying to use a modal popup in my project.

Im generating a bunch of control on my form and some of them (buttons) when clicked should open a modalpopup and on okclick store some info in a db

the problem Im having is that when I am not in the tab with the button that will make the popup open, I see the popup, but when im inside the right tab popup disapear and I can't seem to make it appear.

second problem Im having is that I can't seem to find a way for having multiple button to open the same popup.

hmm Now the modal popup is always shown. maybe its a properpy of the target control or of the popup?
Here is the code

<ajaxToolkit:ModalPopupExtenderID="MPE"runat="server"

BackgroundCssClass="modalBackground"

TargetControlID="test"

PopupControlID="PanelAddLine"

DropShadow="true"

OkControlID="SavePrice"

CancelControlID="CancelButton"

>

</ajaxToolkit:ModalPopupExtender>

<asp:PanelID="PanelAddLine"runat="server"CssClass="modal">

Enter the number of Days<br/>

<asp:TextBoxID="TextBoxNbDays"runat="server"></asp:TextBox><br/>

<asp:ButtonID="SavePrice"runat="server"OnClick="SavePrice_Click"Text="Add"OnClientClick="AfterAdd()"/>

</asp:Panel>

<asp:HiddenFieldrunat="server"ID="test"Value="a"Visible="false"/>


well im not sure about the tabbing problem because im to busy right now to try to replicate it myselft, but i think i know whats going on with the problem you have trying to open the same modal popup from different buttons. The targetControlID for a modal popup lets you set a button to open the popup, but because you want more then one button to you should do the following
* Create a hidden field and assign its ID as the targetControlID for the modal popup
* Now for each button you have that you want to open the modalPopup, create an eventhandler for the button with this code inside(example further down)

modalPopup1.Show();

* to programmatically add the event for the button do this

myButton.Click += new EventHandler(this.myButton_Click);

* and then write the click function that will be called due to the above code

private void myButton_Click(object sender, EventArgs e)
{
modalPopup1.Show();
}


thats weird, i guess i cant be much more help, i love doing stuff programatically in C# to im not great with the aspx file sytax when stuff like this happens :(


could it be just a question of css?


Do I have to set special value to my css to make the modal popup work.

Can a master page could possibly be reason for this


Wookie:

hmm Now the modal popup is always shown.

I think you need to call MPE.Hide(); in the server side click event handler of the save button.

Also, don't specify OkControlID="SavePrice"