views:

216

answers:

1

I'm using prettypopin Modal(Stéphane Caron) to Edit my FormView. Looks like it's only working with regular submit button.

<input type="submit" value="Submit" id="buttSubmit" />

But it's not working with any .net buttons(asp:button, asp:LinkButton). Does anyone has any suggestions?

Or can you recomend any other jQuery Modals, for editing that works with asp.net controls?

Thanx.

A: 

This is because the modal is being removed from the DOM and replaced at the end of the document just before the </body> tag. you will need to modify the jQuery to place items before the </form> tag for this to work.

edit:
in the source for prettypopin in the buildpopin function, there is a line that looks like:

$('body').append('<div class="prettyPopin">...

you will want to change this to:

$('body form:first').append('<div class="prettyPopin">...

this is because jquery is removing the form within the modal dialog and replacing it AFTER the form tag, which is why it is not posting back. you will see this in action if you use firefox's "View Generated Source"

Russ Bradberry
When you submit with asp:button, it redirects entire page(not Modal) to page you submitting, which is the same, it NOT submitting inside Modal.Russ can you explain or show how would you modify form?Thanx.
pyccki
edited to elaborate and added some code examples
Russ Bradberry
I don't think this is IT. Not sure which div you referring to, i think it's the way he created this plugin, here's the code how he doing posting:$.post($theForm.attr('action'), $theForm.serialize(),function(responseText){This code is not getting triggered when you submit with asp.net controls, only when you call submit button. Let me see if i'll comeup with test page.
pyccki
how are you adding this code to the button? are you using onclientclick? or are you using jQuery to add a handle?
Russ Bradberry
It's generated code from <asp:linkButton>, Looks like this>>:<input type="submit" id="Button1" onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button1", "", true, "", "", false, false))' value="Update" name="Button1"/>
pyccki