Archive for the 'ASP.NET' Category

Going To A New URL Via A Drop-Down List: JavaScript And DOM, PHP, ASP.NET

Recently, a visitor to this site asked me to expand on changing URLs via JavaScript, after reading my post on changing an IFRAME’s source via a drop-down list.

As a quick aside, I’ll do my best to answer any question that is posted in Yahoo! Answers if you e-mail it to me. There’s an envelope icon in the question; just use that to get to Yahoo! Answers’ e-mail form, send your question to dhvrm@yahoo.com and I’ll check your question out as soon as I can.

I won’t answer questions privately, meaning I will not e-mail an answer; I’ll only respond in Yahoo! Answers, on this Web site or in my Geocities adjunct site.

I answer questions because when I started out in programming, I needed a lot of help and I got it on the Internet. Now, I’m putting information back out on the Internet for other people who need it. Therefore, if you’d like my help, you need to share it with others. No private questions and no private answers, thank you.

That said, I got the person who asked me to post this question in Yahoo! Answers:

HTML code on How to link a drop down box item to a web page?

Check this url {snipped}
When somebody clicks on the name, it need to be linked to a existing web page in the site.
please provide me help.

It appears from the sample URL provided that this person only wants to go from one static HTML page to another. Which is easy enough, if we simply pirate the earlier iframe code and make some minor modifications. But to be thorough, I’m also going to address how to do this with server-side technologies, too.

Read the rest of this entry »

Update On SourceForge.net Projects: One New, One Moved

I’ve made some changes to my sourceforge.net projects.

I deleted my old SourceForge user name and changed it to the same identity I use for Yahoo!: dhvrm

The NWS Parsing Script for PHP has been reassigned to my new user name and will be modified to include several other Web scripting technologies. While I will continue to update the PHP 5 script, I will also be including a custom control for ASP.NET, additional support for ASP.NET, and possibly an AJAX library.

The revised PHP library will also resolve a bug reported in the PHP 5 class. Unfortunately, I was never notified by e-mail about the bug; SourceForge kind of dropped the ball on that one, and I’ve kind of dropped the ball by ignoring the project for so long.

I have also created a new project, for working with the free GeoLiteCity IP geolocation database from MaxMind.com.

At this stage, the project consists of a PHP 5 class that imports into a MySQL database the CSV files provided by MaxMind. It will eventually include additional classes for working with the binary data file they provide, as well as ASP.NET and AJAX components.

The GeoLiteCity project is awaiting SourceForge approval as of this writing.

Good, Free Web Hosting Companies

A common question on Yahoo! Answers is where to find good, free Web hosting companies. More often than not, the request is that they also be ad-free.

I can recommend the following Web hosts because I have used them all for various purposes. Each has its limitations, but remember, you get what you pay for, even on the Internet.

A quick aside on free domain names: There are no free domain names. At least, none that are worth the aggravation. (For total n00bs, a “domain name” is like this site’s dougv.com, or yahoo.com, youtube.com, whatever.com.)

Read the rest of this entry »

Retaining The LastWriteTime Value For A File About To Be Overwritten Via FTP / FileUpload By Using ASP.NET’s FileInfo Class

Recently asked on Yahoo! Answers:

Preserving last modified date when uploading (asp.net)?

I need to preserve (or change) the last modified date in the file headers when uploading via ftp. When I upload a file via ftp, the last modified date will be the date of upload. Creation date would be fine too. I just need to have the original date attached somewhere in the attributes.

Does anyone have a creative solution. For instance, can I create a container with custom attributes and then stream the data into it? If so how would I do it? Links and/or code would be greatly appreciated. Also, I am using vb.net but C# is fine too.

Keep in mind I must pass credentials to the remote server.

This is actually fairly straightforward, thanks to the FileInfo class in .NET — it’s a subclass of the FileSystemInfo class, which is a replacement of the FileSystemObject of yore.

And much like the old FileSystemObject class, FileInfo not only allows us to do some basic things with files — open, close, read, write and delete, for example — it also allows us to get or set certain properties within a file, including LastWriteTime. We’ll exploit that to achieve what this questioner wants.

Read the rest of this entry »

An ASP.NET 2.0 Script To Share Files Among Users

Recently asked on Yahoo! Answers:

How could I enable user to upload and download file from server using asp.net 2?

How could I enable a user to upload file to the server and then view link to download this file from the server to anthor user i when he enters the site using ASP.NET 2?

The problems here could be handled very easily simply by using the built-in FileUpload class and the DirectoryInfo / FileInfo classes to display the files in the targeted directory.

So, let’s run that simple code today.

Read the rest of this entry »