Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP 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 30th, 2006, 11:27 AM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to thechasboi Send a message via MSN to thechasboi Send a message via Yahoo to thechasboi
Default Conversion to ASP.NET

I am going out of my mind with this problem. I have Googled this till I can not find anything more. OK to the point. I am working at this company thas has a plethera of ald ASP pages. These pages have loeads of includes. This is not the problem though. I need to create a system to watermark and zip piuctures on the fly done and works in .NET. But I have problems integrating with the old system. I have tried literally twnety different ways in accomplishing this or trying at least. These attempts seem to work for months then stop working when a browser makes a change. OK the nitty gritty I have made the determination that the page that uses this function needs to be translated to .NET. I am running into loads of problems when it comes to this. If there is some one that can help I would most appreciate this. It has been a long and frustrating road.

Kind Regards and thanks in advance for the help.

Charley George
Programmer
Computer Engineer
just graduated
 
Old August 30th, 2006, 05:02 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Getting .NET and Classic to play nice together can be a task; as you undoubtedly have figured out Session Variables created in Classic can't be read in .NET and vice versa. (as well as many other things)

I am failing to see your problem though; I understand that you need a .NET system to watermark images and zip them (The former can be achieved through the GDI+ class and the latter through the System.IO classes (i think))

Is it that user navigates to page x.asp, enters a bunch of data and posts the form and then page y.aspx is called and somewhere in between the user data is lost?

If this is the case you can send the user data via querystring (x.aspx?id=nn&something=a etc) or, if there is alot of data you have to process, you can write all of that information to a database and just send the row id via querystring, have the .NET page pull the information from the database and viola.

Futher explination would be helpful.

"The one language all programmers understand is profanity."
 
Old August 30th, 2006, 05:44 PM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to thechasboi Send a message via MSN to thechasboi Send a message via Yahoo to thechasboi
Default

dparsons

Thanks for the reply.
The watermark function is programmed in GDI and is complete and working. I tried passing incookies but we have a problem with too many variables in some cases. So I just sent the info via duery. The way I called the page happened in several different manners. I first had the x.asp with all the choens picts do the calling but called the same pop-up over and over (named the pop-up). The problem with that is that not all browsers support that sort of behavior. I then tried to just pop-up the pages with a timed close function. But if the person had the pop-up blocker on it would disallow the pop-up therefore not allowing the watermark and zip to be created and Safari would not allow multiple pop-ups for some reason. I tried other methods that worked in one and not another but the last thing I came up with was to create an array in javascript that kept track of the information that is being passed to the page.
code for pop-up:
function openwindow(){
                for (i=0;i<numpics;i++) {
                    openWind[i] = window.open('watermarked_thumbnail2.aspx?username= <%= UserName %>&artistnumber=' + imagelist[i].substr(0, 3) + '&artist=' + artistlist[i] + '&imgnumber=' + imagelist[i] + '.jpg&zipname=<%= zipFileName %>','waterwindow'+i,'height=200,width=300');

                }
                setTimeout('closewindow()', 500);

        }
function to close the pop-ups:
function closewindow(){

            for (i=0;i<numpics;i++) {
                if (openWind[i] && !openWind[i].closed) openWind[i].close();
            }
            setTimeout('beginDownload()', 4000);
        }
the needed arrays created by the asp page itself. OK the nitty gritty is that this tested and worked with all the browsers and worked for like 6 months and now it is not working in Safari and some versions of IE. What a mess, so I just forget the whole darn thing and convert to asp.net. I knew it would be a little gruelling but man nothing prepared me for this one. My major problem is that the x.asp page has include files and the include files have their own included files. I did not create this mess just have to deal with it. So that is my dilemna.

Thanks in advance for the help
and sorry for the length

Charley George
Programmer
Computer Engineer
just graduated
 
Old August 30th, 2006, 05:59 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Personally, as far as the includes go, I would just break those out into seperate classes, more an annoyance then anything.

Why don't you just call the page into an IFRAME? Send in the values like you are in the javascript and then, instead of closing the window when the timer is up, just do something like this.location.href='about:blank'; or something like that.

(I don't know how strapped you are for page real estate on that particular page but that would allievate compatiablity issues that you seem to be having, since all browsers support the IFRAME tag.

hth.

"The one language all programmers understand is profanity."
 
Old August 31st, 2006, 08:38 AM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to thechasboi Send a message via MSN to thechasboi Send a message via Yahoo to thechasboi
Default

dparsons

Thanks again for the reply. I did unfortunately try the IFRAME trick. That in fact was the fourth attempt at this enigma. I did not realise I could make the inculdes as classes. Please elaborate on this if you will.

Kind regards and thanks for the reply

Charley George
Programmer
Computer Engineer
just graduated
 
Old August 31st, 2006, 08:51 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Well, I assume you are using VS 2003/2005, but in your project right click on your project and select Add New Item; in the window that pops up select 'Class' as the file you want to add and name it whatever. (Will have a .vb or .cs extension)

All you have in that file is something like this:

Public Class [Name]

End Class

or

public class [name]
{
}

So from here you create variables, methods, functions etc that will be reused throughout your application.

I do this alot for custom error checking logic and for Database calls; for example all of my projects have a class named DataAccess.cs so what I do in my pages is something like this:

DataAccess da = new DataAccess()

private void someMethod();
{
DataTable dt = new DataTable();
dt = da.getDataTable(sSql);
}

Essentially my DataAccess class redueces my redundancy of creating DataAdapters, SQL Connections, etc this central file handles all of that. (Especially nice when i need to make a change of some sort, its just one change that is then application wide)

In the above example, da.getDataTable is a function that takes a sql statement as an argument and returns a datatable.

If you would like any other insight please let me know.

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from .Net 2003 to .Net 2005 using VB.Ne coleenh Visual Basic 2005 Basics 0 September 19th, 2006 02:48 PM
Conversion of ASP.Net Project Coleen .NET Framework 2.0 2 September 18th, 2006 11:39 AM
Conversion to ASP.NET 2 sydneyausguy BOOK: ASP.NET Website Programming Problem-Design-Solution 8 April 20th, 2006 05:26 PM
asp.net to xml conversion imjigu General .NET 1 December 4th, 2004 06:16 AM
ASP to ASP.NET: GetRows() Conversion DolphinBay ASP.NET 1.0 and 1.1 Basics 3 March 21st, 2004 09:55 PM





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