Last post Apr 06, 2015 05:46 PM by AZMatt
Apr 06, 2015 05:07 AM|Claudio7810|LINK
does someone know why the following method causes errors to be fired if used in MasterPage?
Protected Sub LogIn(sender As Object, e As EventArgs)
If IsValid Then
Apr 06, 2015 01:11 PM|AZMatt|LINK
Try using Page.IsValid
Apr 06, 2015 03:29 PM|Claudio7810|LINK
thank you so much and it works. Before marking as answered, why the If IsValid method doesn't work on master pages while If Page.IsValid works?
Thanks so much again,
Apr 06, 2015 05:44 PM|AZMatt|LINK
An ASPX page automatically inherits the System.Web.UI.Page class. A master page inherits System.Web.UI.MasterPage class. You have to specify to look in the Page class or it will look in the wrong place. The MasterPage class does not have IsValid defined.
Apr 06, 2015 05:46 PM|AZMatt|LINK
You can see this in the code-behind file...
public partial class MyPage : System.Web.UI.Page
public partial class MyMaster : System.Web.UI.MasterPage