ASP.NET and IsNew at the page level

Never seen this before in ASP.NET development. I am trying to refactor 40 pages of one ASP.NET page for code style.

What does this code do?

// Validate required parameters (if "new", then nothing is required)
if (!this.IsNew())
{
  if (string.IsNullOrEmpty(_billId))
  {
    responseErrorNo = 4;
    Utils.SendError(respErrNum);
  }
}

      

On an ASP.NET single page page, the pages are in a block in the Page_Load method.

On the code page below, this code (.IsNew) is not recognized. What am I missing here? Is there an MSDN page on IsNew "pages"?

Update OK. This is my movement to the dead end of the day. At the bottom of the server side, there was a small method that was protected by bool IsNew ()

see comments about inheritance point. http://msdn.microsoft.com/en-us/library/015103yb.aspx

+2


a source to share


3 answers


Have you searched all source files for IsNew?



Some possibilities
1. This is a method inherited from the base class, if you have of course
2. IsNew can be an extension method. http://msdn.microsoft.com/en-us/library/bb383977.aspx
3. IsNew is a member of the class

+2


a source


If your code file inherits from a custom page class like in a class like PageBase instead of the default System.Web.UI.page, IsNew might be there, and maybe your page should implement it ... ALtneratively it might be a method extensions for the page class as well as the lack of a namespace reference to include it ...



NTN.

+1


a source


This is puzzling as the class System.Web.UI.Page

definitely doesn't have a method IsNew()

. The only way to get this is if the page inherits from the base page , or perhaps if it has an extension method that extends the page.

Can I right click on a method in Visual Studio and find the definition?

+1


a source







All Articles