Link to home
Start Free TrialLog in
Avatar of JAMES
JAMES

asked on

this.Page.GetPostBackEventReference(this.Button1) not working for a Modeless Dialog

Hi,

I am trying to perform "this.Page.GetPostBackEventReference(this.Button1)" within a Modeless Dialog box but I receive the following error :-

"Microsoft JScript runtime error: 'this.Page' is null or not an object"

I think I understand that this.Page may only work in a "proper" window but is there any way of performing my GetPostBackEventReference within the dialog?

Thanks.

James.
Avatar of mmarinov
mmarinov

Hi JAMES,

can you post the entire code ?

Regards!
B..M
mmarinov
Avatar of JAMES

ASKER

Hi,

Here is the code from the Page_Load method in c#

      string strButton;
      strButton = "if (typeof(Page_ClientValidate) == 'function') { ";
      strButton += "if (Page_ClientValidate() == false) { return false; }};";
      strButton += "this.value = 'Please wait...';";
      strButton += "this.disabled = true;";
      strButton += "this.Page.GetPostBackEventReference(this.Button1);";
      Button1.Attributes.Add("onclick", strButton.ToString());

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JAMES

ASKER

You are of course correct - how silly of me - thanks.