|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
getting the current page from inside a web controlI have a class on my Intranet site that provides me with a crash popup type page, and sends me an email containing bug information, etc. This works fine, from any page I can call my class with an error code and a reference to the current System.Web.UI.Page, like so... ACR crash = new ACR("error_code", this); The overridden ACR function is defined as... public ACR(string e, System.Web.UI.Page this) The problem comes when I try and call this from a WebControl inside another page. Obviously the webcontrol isnt a System...Page, so it won't compile. When I'm in the webcontrol, how can I pass the current System.Web.UI.Page that the control is residing on? Thanks! Dan Hi Dan,
Every control has a property called Page which will return the page instance that its on. The Page is itself inherited from Control. Therefore I suggest you use: public ACR(string e, Control ctl) { Page p = ctl.Page; ... Let me know if this answers your question. Thanks. Sincerely, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. If you are using Outlook Express, please make sure you clear the check box "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Hi Dan,
Just want to make sure you've seen my reply, would you please let me know the status of this post? Thanks! Regards, Walter Wang (waw***@online.microsoft.com, remove 'online.') 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.
GridView DDL and Label
hyperlink in a ListItem Getting the generated name attribute for use in JavaScript zorder problem with menu and combobox TreeNodePopulate - InvalidCastException hyperlink on template header gridView Viewstate Control Position Panel Border Problems Missing cell borders in Table control |
|||||||||||||||||||||||