• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1066
  • Last Modified:

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.
0
JAMES
Asked:
JAMES
  • 2
  • 2
1 Solution
 
mmarinovCommented:
Hi JAMES,

can you post the entire code ?

Regards!
B..M
mmarinov
0
 
JAMESAuthor Commented:
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.
0
 
mmarinovCommented:
JAMES,

the
GetPostBackEventReference
is a server-side method not a client side
so this
strButton += "this.Page.GetPostBackEventReference(this.Button1);";
may be should be
strButton += this.Page.GetPostBackEventReference(this.Button1);

Regards!
B..M
mmarinov
0
 
JAMESAuthor Commented:
You are of course correct - how silly of me - thanks.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now