Click here to Skip to main content
11,705,123 members (48,628 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0
My previous post on this topic have been answered successfully.However when i access the method in the master page a error pops up saying object reference not set to an instance of an object..Heres the code

public bool CheckErrors()
       Page.Validate(valSummary.ValidationGroup);//error is in this line
       if (!Page.IsValid)
           return false;
       return true;

my call to the method from the other form is

protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        SiteMaster master = (SiteMaster)this.Master;
        if (master.CheckErrors())
            GridView2.Visible = false;
            gvsearch.Visible = true;
            string search = txtsearch.Text.ToString();
            gvsearch.DataSource = DataBase2.myProcedureName(search);
Posted 29-Aug-12 18:27pm
Ravi Sant at 30-Aug-12 3:48am
can you debug or add breakpoint at check, if valSummary actually has a value. I guess it is null (thus not accesible at error line).
BillWoodruff at 31-Aug-12 7:32am
What on earth is ".Master" ? What is "Page" ? If this is an ASP.NET question, please tag the question.

You can also add a link to the previous question to this question in case the "successful," you say, answer might give us a clue what you are asking here.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 595
1 OriginalGriff 289
2 Andy Lanng 175
3 CPallini 162
4 ppolymorphe 126
0 OriginalGriff 8,958
1 Sergey Alexandrovich Kryukov 8,276
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 30 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100