Showing posts with label validation. Show all posts
Showing posts with label validation. Show all posts

Wednesday, March 28, 2012

modal popup and login

i have a login link, upon clicking it, the modalpopup extender will appear, the problem is the validation of the data...when i click on the login buton, nothing is happening..im very new in using asp.net ajax and not that familiar with javscript. should i create a javascript to pass the validation?or is there any other easy way to do this?

thank you.Smile

Hi,

According to my test, the validation in the login control works when it's placed in a modal popup panel.

Here is my code:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Button3_Click(object sender, EventArgs e) { TextBox tb = new TextBox(); Panel1.Controls.Add(tb); ModalPopupExtender1.Show(); } protected void Page_Load(object sender, EventArgs e) { } protected void Button6_Click(object sender, EventArgs e) { ModalPopupExtender1.Hide(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function changeID(newOkControlID) { var ext = $find("ModalPopupExtender1"); if (ext._OkControlID) { $removeHandler($get(ext._OkControlID), 'click', ext._okHandler); ext._okHandler = Function.createDelegate(ext, ext._onOk); ext._OkControlID = newOkControlID; $addHandler($get(ext._OkControlID), 'click', ext._okHandler); } } </script></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:Button ID="Button1" runat="server" Text="Popup via client" /> <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Popup via Server" />  <input id="Button5" type="button" value="Change OK Button ID" onclick="changeID('button4');" /> <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <asp:Panel ID="Panel2" runat="server" Style="cursor: move;background-color:#DDDDDD;border:solid 1px Gray;color:Black"> <div> <p>Choose the paragraph style you would like:</p> </div> </asp:Panel> This is popup control<asp:Login ID="Login1" runat="server"> </asp:Login> <br /> <input id="Button2" type="button" value="button" /> <input id="Button4" type="button" value="button" /> <asp:Button ID="Button6" runat="server" OnClick="Button6_Click" Text="Hide via Server" /></asp:Panel>     <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" OkControlID="Button2" PopupDragHandleControlID="Panel2" PopupControlID="Panel1" runat="server" TargetControlID="Button1"> </ajaxToolkit:ModalPopupExtender> <script type="text/javascript"> Sys.Application.add_load(modalSetup); function SetFocusOnControl() { $get("Login1_UserName").focus(); } function modalSetup() { var modalPopup = $find('ModalPopupExtender1'); modalPopup.add_shown(SetFocusOnControl); // modalPopup.show(); }</script> </form></body></html>

modal popup and validation control problem

Good day to all,

i,m currently having problems with modal popup with validation control in it. i'm currently using the modal popup for insert. but if enableclientscript of the validation control inside the modal popup is set to true, during modalpopupextender.show(), the page just freeze/hangs even the other controls in the page stops responding... can someone help me on this one?

thanks in advance,

jay

I've figured it out... I'm not sure why, but if your using a dummy button as a targetcontrol for the modal popup, it freezes/hangs if you'll set the enableclientscript of the validator inside the modal popup to true. but if u'll put the modal popup in one update panel together with the targetcontrol (not using a dummy) it will work.

Modal Popup Extender and validation

Hi All,

I have a page utilising the ModalPopupExtender and was hoping that someone could give me some guidance as to how I can get, if it is possible, the client side validation to fire before the ModalExtender does?

I.e. I would like the Modal Popup to only display if validation passes.

Any thoughts would be greatly appreciated

Pete

Is there a way to set the event firing order or a dependecy for an ajax event event? e.g. before you do B you must successfully do A first.

Surely the validation rules must be honoured?


I just answered a very similar question:http://forums.asp.net/ShowPost.aspx?PostID=1505722

Hi

The above link no longer works - any chance of reposting the solution to this please?

Thanks

Ben

Saturday, March 24, 2012

Modal Popup Validation

I have 2 required field validators in an update panel in my modal popup panel. I use Matt Gibson's Validator dll and tag mapping for validators inside update panels. However, in this modal popup, postback is not prevented. As you can see, I give the modal popup no control over the save button. Yes, the validation group is the same on the validators and the button. Yes, the validation appears onblur. With the errormessage displayed, if I click on the save button, the postback goes through. How do I fix this?

<ajaxToolkit:ModalPopupExtender runat="server" ID="mpe_fix"BackgroundCssClass="modalBackground"CancelControlID="btn_Cancel"PopupControlID="pnl_fix"TargetControlID="hdn_dummy" /><asp:Button runat="server" ID="btn_save"Text="Save"ValidationGroup="fix"CausesValidation="true" />

Bump.

Wednesday, March 21, 2012

ModalPopUp & ValidatorCalloutExtender Issue

I have required fields that are contained within the ModalPopUp, the problem arises when I submit the form the validation popup appears behind the modal form.

Has anyone encountered this before and if so have they come up with a solution?

Help would be appreciated on this!!

This is a valid scenario and we have seen issues where it would be reasonable to not have the modal popup to have the highest z-index. If you could open an issue to track this that would be great:http://www.codeplex.com/AtlasControlToolkit/WorkItem/Create.aspx. We will investigate possible solutions to make your scenario and other similar scenarios regarding the modal popup z-index.

I am having the same issue.

Any help would be appreciated.


I'm having the same issue. I have a required validator in modal popup, but OK button on the ModalPopup control ignores that required validator.


asp.net_programmer:

I'm having the same issue. I have a required validator in modal popup, but OK button on the ModalPopup control ignores that required validator.

I opened anissue for this on Codeplex, hopefully someone can give us an answer for this soon. If not updated ModalPopup control, then some kind of workaround would be helpfull. Thanks.


Any update on this issue?

Thanks in Advance.


Well I don't know if this adds to this discussion or not. I can not no matter what get it to center. I have no idea why it will not but all I see is the lower left corner and cancel button of my popup in the upper right corner. So I figured I would specify the X and Y properties to possition it. So I specified X=250 and y=250 and this was the only change the modal was visible now but in possition maybe 50,50 however now it was not active and greyed out with the background. Remove the X and the Y and it goes back so I can only see the cancel button but it is active again.

Selam Aleyk,

If location of the validatorcalloutextender control is in modal popup panel, it is working ok.

Oznur