ModalPopupExtender Problem [Resolved]

Posted by Vuyiswamb under ASP.NET AJAX on 12/2/2010 | Points: 10 | Views : 3516 | Status : [Member] [MVP] [Administrator] | Replies : 3
Good Day All

I have 20 Textboxes and when there are duplicates in those textboxes , i store them in a List<string> and on fly i build a CheckBoxList and display that as a modal and in that i have a close button to allow the user to correct the duplicate item. My Function is working and it is defined like this

[code]
private void ShowAjaxModalDynamic(List<string> lstItems, String Message)
{

CheckBoxList lstchecks = new CheckBoxList();

for (int i = 0; i < lstItems.Count; i++)
{
lstchecks.Items.Add("Unit" + lstItems[i]);
}

AjaxControlToolkit.ModalPopupExtender modalPop = new AjaxControlToolkit.ModalPopupExtender();
modalPop.ID = "popUp";
modalPop.PopupControlID = "ModalPanel"; //The Panel must exist on the markup
modalPop.TargetControlID = "btnComplete"; //the Button must exist on the markup
modalPop.DropShadow = true;
modalPop.CancelControlID = "btnCancel"; //The Button must exist on the markup
modalPop.BackgroundCssClass = "modalBackground";
this.Panel1.Controls.Add(modalPop);
this.ModalPanel.Controls.Add(lstchecks);
lblPanelMessage.Text = Message;
modalPop.Show();

}
[/code]


as you can see i will pass the List and the Message to be displayed. Now this is working Perfect.

My Problem is that when the user clicks the close Button to correct the duplicate in those textbox, and re-click the button that will check for Duplicate , the Modal comes back again even if the duplicate has been removed and the break point to the start part that does the validation does not get fired.


I have attached the Example Project , it is a .net 4 web project


Example Project

www.vuyiswamaseko.com/ExampleProblem/ExampleProblem.zip

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Vuyiswamb on: 12/2/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 50

Up
0
Down

Resolved
Hi all
I did not really resolve the problem. But i had twigged my code to resolve the problem.
What i did is that i have added another button and obviously give it another name and kept the same caption and gave it a click event that has the same code as the other one. I have change the visibility via css to be invisible when the page loads and when the first "complete" button is click , it will be hidden via css and the second button will show , and after the user has removed the duplicate if he clicks the Complete button that is available it will go to my break point and event the test for duplicate again.

Thanks Guys


Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 12/6/2010 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Thank you so much for sharing the answer it helped me.

Thanks,
Radha Srikanth

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 12/6/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Thank you for being part of Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response