0

It's possible do something like this

Load an ASP.NET 2.0 aspx page using System.Reflection?

But access to a public shared member (propertie) instead of create an instance of the the webForm ?

I guess I can achieve my goal using the instance of the aspx page, but it's kind of unnecessary to get the instance, because i just need a propertie.

Thanks !

Community
  • 1
  • 1
Allende
  • 1,480
  • 2
  • 22
  • 39
  • Wouldn't it be better to have the property has a property of an independent business object, so that you don't have to do these types of shenanigans against Page objects? – asawyer Mar 02 '12 at 18:34
  • It's a problem of my "super" (I mean bad) design, I will need to explain the entire requirements of my webSystem to let you know, why I end up trying to do something like this "shenanigans", I know is "bad", in short I need access to reports of at least 3 DataBases, every dataBase has N enterprises information, then we have the "enterprise" table with enterpriseID field, to split results in reports, I mean inventory from A, dosen't needs to appear in the inventory report of B. Then we decide to have a report.aspx page (with the forms to filter report result)for every enterprise. – Allende Mar 02 '12 at 19:22
  • we have an additional webForm (loadReport.aspx) that load a crystal report and flush it to the browser, but almost every (maybe all) needs the enterpriseID for the query to the DataBase, so I need to send it, actually I can use queryStrings and get it from a property of every reports.aspx, my question it's 1.- to learn and 2.- just to know if it's possible. I mean, I know isn't a good idea, but, just in case I would like to know if it's possible, cause from loadReport.aspx I know whats the webForm (the reports.aspx) that it's asking for load a report. – Allende Mar 02 '12 at 19:27
  • This could be avoid it with a better architecture/design but I'guess, I'm not such a good to do it, because this was my best :) – Allende Mar 02 '12 at 19:30
  • Stick it in the Session cache dude. – asawyer Mar 02 '12 at 19:49
  • Let's say that the user "Jhon" access to reportsX.aspx, then I set a Session("enterpriseID)=1 in the load event for those reports, then I can use that var from my loadreport.aspx to send the paremeter to the report, but then, our friend "Jhon" open a new Tab, and access to reportsY.aspx, and set the Session("enterpriseID")=2 in the load event, If Jhon switch to the tab of reportsX.aspx without reload the page, the I'll be using a wrong enterpriseID in the loadreport.aspx, probably It can be achieve it using Session vars, but I'm not pretty sure about it (because of my "architecture"). – Allende Mar 02 '12 at 20:33
  • Two users would have seperate session's – asawyer Mar 02 '12 at 20:35
  • Yeap, two users would do, but I mean the same user, at least in chrome/firefox/ie9 if the same user "knows" or browse to the other page in a new tab (in the same instance of the browser until I test), still have the same session – Allende Mar 02 '12 at 20:58
  • I think you should ask a new question, include all the criteria you identified in the comments here, and please include any relevant code. – asawyer Mar 02 '12 at 21:05
  • Well that's true, we just lost the way here, thanks anyway :) – Allende Mar 02 '12 at 21:33
  • There is just some vital information in the comments that should have been in the question. A new question better written will get you more attention, and hopefully, some better answers. SOrry I wasn't more help. – asawyer Mar 02 '12 at 21:37

0 Answers0