Saturday, March 24, 2012

conditional modal popup

Hi,

I'd like to use the modal popup in a conditional sense... i.e. only when someone has entered changes to the drops or text boxes on my page. The modal popup would then issue the standard "you have changed the data on this page... would you like to save your changes". If the pages has not changed, obviously, I would not like the modal popup to appear when navigating to the next/prev page.

Has anyone done this?

Any help is muchly appreciated.

Thanks

Hi,

You can have Javascript set off a dirty flag metioning that Data has changed and then raise the ModalPopup Using Script .

EX:

function RaisePopup(){

if( dataHasChanged()) {

//Raise Modal Popup

}

}

Read this link on how to show/Hide the modalPopup Using javascript

http://blogs.msdn.com/phaniraj/archive/2007/02/20/show-and-hide-modalpopupextender-from-javascript.aspx

Hope this helps


Thanks for the reply... i'll work on that

Hmm, how would you do it serverside? I have a situation where I'd like to use it with a login script, so the user enters there username and password click submit sends the data to the server which checks a database to see if that username and password exist if it does it returns with modalpopup.show() but it doesn't work.

Code is like this

loginButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles LoginButton.click'Bunch of user auth stuffif userExists = true then modalPopup.show()Else Status.Text ="Incorrect Login!"End IfEnd Sub
 
one problem I have is that modalpopup control requires a targetcontrolID so I set it to my submit button but than my submit button doesn't do a postback, so I
changed it and made the targetcontrolID the same as the PopupControlID with no luck now it does a post back but the modalpopup never pops up.
Any ideas how to make this work? 

No comments:

Post a Comment