Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have one modelpopup box contain one text box
and ok ,Cancel buttons. it is similar to a message box.

when ever i click on ok button it will show required field on that text box, even if that text box contains proper values. What am doing wrong? How can I make it workable
Posted
Updated 23-Mar-15 7:56am
v5
Comments
F-ES Sitecore 23-Mar-15 5:19am    
What are you using for your modal popup?
Parazival 23-Mar-15 7:24am    
ajax ModalPopupExtender

1 solution

As per my understanding on click if the ok button you want to validate the entire form

if so you can perform client side validation by calling a client side script function in the ModalPopupExtender properties

C#
<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
    TargetControlID="LinkButton1"
    PopupControlID="Panel1"
    BackgroundCssClass="modalBackground"
    DropShadow="true"
    OkControlID="OkButton"
    OnOkScript="onOk()"
    CancelControlID="CancelButton"
    PopupDragHandleControlID="Panel3" />



Where define a OnOk () java script and validate your form


Or else if you want to validate or perform server side operation then inside ur target control use html.beginform ('actionname','controllername')

In order to perform the action on ok of that form.

Hope it helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900