Click here to Skip to main content
15,895,370 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After successfully solving all the previous issue now im stuck on the final line of code.That is from the master page :
C#
public bool CheckErrors()
{
    //Page x=new System.Web.UI.Page();
    ValidationSummary sum= new ValidationSummary();
    Page.Validate(sum.ValidationGroup);
    if (!Page.IsValid)
    {

        //this.EnsureChildControls();
        UpdatePanel update = new UpdatePanel();
        update.ID = "update";
        update.UpdateMode = UpdatePanelUpdateMode.Conditional;
        update.Update();

        modalPopupEx.Show();//error is in this line
        return false;
    }
    return true;
}

Error say Object reference not set to an instance of an object.This is the last line of code to display the popup...Help needed

Thanks
Posted
Updated 30-Aug-12 16:31pm
v2
Comments
AmitGajjar 30-Aug-12 22:32pm    
if this is asp.net issue then please tag it.
AmitGajjar 30-Aug-12 22:33pm    
Where you have created Modelpopup control? is it in design view?

1 solution

Thanks I have solved it.

It should have been

public bool CheckErrors()
{
//Page x=new System.Web.UI.Page();
ValidationSummary sum= new ValidationSummary();
Page.Validate(sum.ValidationGroup);
if (!Page.IsValid)
{

//this.EnsureChildControls();
UpdatePanel update = new UpdatePanel();
update.ID = "update";
update.UpdateMode = UpdatePanelUpdateMode.Conditional;
update.Update();
modalPopupEx = new AjaxControlToolkit.ModalPopupExtender();

modalPopupEx.Show();
return false;
}
return true;
}
Thank you all for your time.
 
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