Friday, January 28, 2005

Some days I depress myself...

Instead of Impress... Okay, Century Color Online forms, has been the bane of my existance in some regards. Never enough, always updating, never easy to work in. I was ready to hate ASP .Net simply because I never wanted to look at it again after working on these forms.

That's because I was being idiotic. (No, I'm not an idiot, just naive.)

For example, our Review order page. Basically, it was a simple page that used this:

Dim objRequest As System.Net.WebRequest = System.Net.HttpWebRequest.Create(url)
objResponse = objRequest.GetResponse()
Dim sr As New System.IO.StreamReader(objResponse.GetResponseStream())

Now, do you follow what that did? It did an HTTPWebRequest into a StreamReader. Then I stripped out all the form tags and other undesirable tags and other bad tags, and dumped the resulting huge string into a label control. At the time I thought it was pretty ingenious. Until of course I wanted that form to do stuff.

Today, in 2 lines of code, (and removing everything outside (and including) the form tags) I turned this page into a Usercontrol, I don't need to pull it through the HttpRequest string, and now, I can put functionality into it.

The only trick, and the reason I original went the way I did, is I want to be able to e-mail that form, and I was able to e-mail it just the way it was. Now I'll have to create a form that has this new usercontrol, and e-mail the new form. It'll still be easier than what I was doing.

No comments: