Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 14th, 2007, 01:10 AM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generalized PopUp.aspx

Hello All,
In one of my project i was using a generalized popup.aspx page. In that i used to pass the select query and some other formatting argument to the page and in the page load of the popup.aspx i fire the query. All was working fine. I used showdialog() function of the javascript to call the popup.aspx.
I know we should not write sql query on aspx page.
Now we are in process of making a multiproject ERP intranet site.
and i have assigned the work to make a generalized popup page that all the project's page will use. I have two option
1. either i can pass the result set in session to the popup page and display result there. That i think is not the proper way.
2. Somehow i will pass the function written in some class that should fire when popup page is called. But i dont know how can i pass the class name and function name in querystring bcoz popup will treat it as string not the object.
Plz help me to come out this problem.

 
Old August 14th, 2007, 01:31 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

While your 2nd options isn't necessarily safe (you could change the query string and force things to run that you don't want run), here's a way to do it:

You can use reflection to load an instance of the class specified and then invoke the method specified. Of course, you'll run into a problem if you need to have the class already instantiated and in some certain state before you make the necessary call. For this you'll probably need to use the first option of session. I don't see using the session as "not the proper way". This kind of thing is what session is intended for. Just be careful how you use it and be sure to clean up after the use of the data otherwise you might end up chewing up lots of memory quickly.

I think the first option is best. Load the data into session then use it from there in the popup. This would be more secure and generally simpler to write.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generalized Report.aspx balesh.mind ASP.NET 2.0 Professional 1 August 30th, 2007 11:15 AM
New.aspx works but login.aspx fails Validation nigelhamilton BOOK: ASP.NET Website Programming Problem-Design-Solution 8 September 13th, 2004 02:29 AM
HowTo Pass Form data from Page1.aspx to Page2.aspx dati ASP.NET 1.0 and 1.1 Basics 6 January 27th, 2004 06:57 AM
Generalized Code psingh SQL Server 2000 6 June 24th, 2003 06:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.