Erollisi Marr - The Nameless

Go Back   Erollisi Marr - The Nameless > EverQuest > Chit-Chat Lounge


Reply
 
Add/Share Add/Share Thread Tools Display Modes
Old 01-06-2003, 04:44 PM   #1
cnjmorris
Registered User
 
Join Date: Nov 2002
Posts: 925
Default More .ASP for Dummy

Okay, I'm still playing around with ASP though I took a break from it for a while.

I have a list of links loaded from a database into an .asp page. Beside each link there is a button for "modify" and for "delete"

When you click delete next to one of them it asigns an ID and calls the delete page which check the database for that ID and then asks you if you are sure you want to delete the link.

I don't know how to handle the "yes" and "no"...

You can check out the full page here:
http://www.sixanswers.com/asp/deletelinks.txt

The only things I changed are the database name and password.

I have tried calling a Sub, with no luck, and I have tried recalling the same form but must be doing it wrong. If anyone can point me in the right direction it would be great.
cnjmorris is offline   Reply With Quote
Old 01-07-2003, 07:46 AM   #2
Panidwen
Registered User
 
Join Date: Nov 2002
Location: Seattle
Posts: 143
A small disclaimer. I am learning ASP under the gun right now. I am working on a large project for a company so I am learning ASP this way.

I have a similar function on our program. If you have the form submit to a new asp page you can perform If Statements on the input button. If you name them both "cmdOpt" you should be able to write code that executes different code.

<input type=submit name="cmdOpt" value="Yes">
<input type=submit name="cmdOpt" value="No">

So

If cmdOpt = "Yes" Then
response.write "Delete this Stuff"
ElseIf cmdOpt = "No" Then
response.write "Don't Delete this stuff"
End If

That should work. Or maybe you could do two radio buttons and one input button and check for the value of the radio buttons being yes or no. You can also play around with hidden input fields. You can pass values around that way too.

Hope this helps.

Panidwen Starblazer
Panidwen is offline   Reply With Quote
Old 01-07-2003, 11:39 AM   #3
Martigan
Supporter
 
Martigan's Avatar
 
Join Date: Nov 2002
Location: San Juan Bautista, CA
Posts: 4,461
Send a message via AIM to Martigan
I have created pages like this before. What I do is call a function on the "onClick" event for the delete button. Example:

This will be the event placed in the input (button) tag...
onClick="JavaScript: return confirmAndDelete('<%=lngImgID%>','<%=strImagePath%>');"

The following JavaScript will be placed in the scripts...

function confirmAndDelete(imgID,imgPath){

if(confirm('Are you sure you want to delete the image ' + imgPath + '?')){
window.location='deleteimage.asp?imgID=' + imgID;
}

return false;

}


This is the preferred way since you want to make sure they make the right choice before proceeding.

Last edited by Martigan; 01-07-2003 at 11:42 AM.
Martigan is offline   Reply With Quote
Old 01-07-2003, 11:25 PM   #4
cnjmorris
Registered User
 
Join Date: Nov 2002
Posts: 925
Default Dummy figured it out....

Well it works beautifully. Thanks for the input. If you want to see how I did it you can check out my code here:

http://www.sixanswers.com/asp/deletelinks.txt

(I changed the database name, password, and field names for security reasons)

Thanks again.
cnjmorris is offline   Reply With Quote
Old 01-07-2003, 11:33 PM   #5
Ssetti
Registered User
 
Join Date: Nov 2002
Posts: 342
Send a message via MSN to Ssetti
God, I'd forgotten what a clumsy, ugly little language ASP is ...
Ssetti is offline   Reply With Quote
Old 01-07-2003, 11:54 PM   #6
cnjmorris
Registered User
 
Join Date: Nov 2002
Posts: 925
Default Ugly?

How so? I like it actually. I hate java but I love vbscript.. so .ASP can be nice.

What do you use if you don't like .ASP?
cnjmorris is offline   Reply With Quote
Old 01-08-2003, 01:45 AM   #7
Andredien
Registered User
 
Join Date: Nov 2002
Location: Switzerland
Posts: 141
Zope - or failing that, PHP
__________________
Andredien Sto Helit,
Virtuoso of the 60th missed note
Officer of Les Irréductibles

"Nobody notices what I do - until I stop doing it." -- Ancient Bard Motto
Andredien is offline   Reply With Quote
Old 01-08-2003, 01:56 AM   #8
cnjmorris
Registered User
 
Join Date: Nov 2002
Posts: 925
Default Why PHP

Never heard of Zope. Is it new or is it like Mac and only intended for people who don't like to go with the flow?

As far as PHP.. why is it better than .asp? I don't know enough at first glance to know how it would matter.
cnjmorris is offline   Reply With Quote
Old 01-08-2003, 02:33 AM   #9
Andredien
Registered User
 
Join Date: Nov 2002
Location: Switzerland
Posts: 141
Zope's been around for a number of years. It's an object-oriented application server written in Python. Very modular, extensible, and runs on everything (Windows, Linux, Unix, etc). It's what I prefer to use now for web development, because it makes the code so much more reusable. Maybe it's just because I'm used to it, though.

I'm not saying PHP is necessarily better than ASP (after all, they are so functionally equivalent that you get tools like asp2php that can convert entire sites from ASP to PHP practically with no hand-recoding of anything). But I prefer PHP because I prefer my web servers to run Linux than Windows, and PHP integrates nicely with Apache. Oh and it's multi-platform, too, which gives you more freedom if you ever switch hosting companies and they provide the "other" OS from what you were using before.

In the end it boils down to using the tool you're most comfotable with, I guess.
__________________
Andredien Sto Helit,
Virtuoso of the 60th missed note
Officer of Les Irréductibles

"Nobody notices what I do - until I stop doing it." -- Ancient Bard Motto
Andredien is offline   Reply With Quote
Old 01-08-2003, 06:10 AM   #10
cnjmorris
Registered User
 
Join Date: Nov 2002
Posts: 925
Default Clarification.

Thats cool. I appreciate the input.

A few years ago (6 or more) I saw some cool "progies" on AOL. I think that is what people called them back then. They were custom made hacks for AOL. I wasn't impressed with what they did, but I saw potential to write my own programs for more practical uses.

I asked around and they were all written in Visual Basic 3. Later I found out that is because while Visual Basic isn't as powerful as C and other lower level programming languages it is so simple a moron could learn it. Most people on AOL fall into that category hence the popularity of VB 3.

I went to a local store and looked at a starter kit but I got lucky and met a sales associate who was going to school and learning Visual Basic 5. He told me that he could buy the accademic version at school for $100. That was much better than the $500 the store wanted. Visual Basic 5 academic even came with Windows NT free.

I devoured all the code I could find eventually finding that I really enjoyed DAO databases and field manipulation. Most people find that weird but for a while I actually made some professional contacts online who I managed to teach a lot to (only on the subject of DAO). Of course it wasn't long before ADO came a long and others... I was too busy to learn everything and since I was only using small applications and never online I didn't see the need for ADO.

Anyway I don't want to excessively bore you but long story short I was really happy when I realized that I can use my Visual Basic experience (vbscript was similar) and play with databases using .ASP

I said all that JUST to say this... I appreciate the input because you look at languages from a professional standpoint. I look at them from a casual standpoint. I am, however, in school for computer science and I will soon need to start looking at programming from a "what will this add to my toolbox" point if view instead of a "what will be fun and build off my current knowledge" point of view. I kick myself for tecahing myself bad habits (DAO when ADO was available) and I am trying to learn from that... so I take all input seriously.

Oh, and I love OOP stuff too. I haven't had much time to learn it but I did make a custom multiple choice .ocx for a learning application I made. SO Zope might be something I should look into.
cnjmorris is offline   Reply With Quote
Old 01-08-2003, 11:17 AM   #11
Ssetti
Registered User
 
Join Date: Nov 2002
Posts: 342
Send a message via MSN to Ssetti
For web backend stuff I primarily use Perl. There's a myth amongst the corporate Microsoft-bitches that it's out of date, but the truth is that it's massively powerful, easy to learn, blindingly fast for an interpreted language, works perfectly cross-platform, and is simply a joy to write code in.

I've tinkered a bit with Ruby, which is a Perl/Smalltalk hybrid and been impressed.

JSP (Java Server Pages) have a very good reputation for speed and robustness, but although I've written a lot of Java for college courses, I find it too restrictive and over-engineered for my own tastes.

I haven't encountered Zope, but if it's written in Python then it's probably pretty damned good

As for PHP ... well, it's ok ... but really it's just a subset of Perl so I've never quite seen the point. Also, the idea of embedding code inside markup always struck me as a little silly and confusing.

Ssetti
Ssetti is offline   Reply With Quote
Old 01-08-2003, 11:23 AM   #12
Martigan
Supporter
 
Martigan's Avatar
 
Join Date: Nov 2002
Location: San Juan Bautista, CA
Posts: 4,461
Send a message via AIM to Martigan
>>I find it too restrictive and over-engineered for my own tastes.

Yeah, but the speed tradeoff is well worth it.
Martigan is offline   Reply With Quote
Old 01-08-2003, 03:21 PM   #13
Ssetti
Registered User
 
Join Date: Nov 2002
Posts: 342
Send a message via MSN to Ssetti
I'm not so sure ... for most web backend stuff, speed isn't an issue at all from what I've seen. I've had a site running over 15,000 lines of Perl and maybe 100 database queries every time a page was called, and that took about half a second. Sure, that's slow, but it's so short anyway as to not matter.

Meanwhile for non-web stuff, especially programs with a GUI, Java is hopelessly, pathetically, comically slow. SWING is a joke.

Ssetti
Ssetti is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:36 AM.


Powered by: vBulletin. Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.