Hi Alex,
As for the ClientScript property, it is specific to the Page class, and as
for the HttpContext, it could be established for different httphandlers,
not only Page, but also other general httphandlers, that's why it doesn't
expose a Page property. However, we still could use the
HttpContext.Handler property to access the current request's processing
handler instance, if the request is a page request, the handler is just the
page instance. e.g:
Page page = HttpContext.Current.Handler as Page;
if (page != null)
{
page.ClientScript.RegisterStartupScript(page.GetTy pe(),
"msgbox", "alert('hello.');", true);
}
In addition, if the utility class is mostly used directly in page code, I
suggest you consider Steve's suggestion on passing the page instance as
input parameter of the utility functions.
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)