ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 9th, 2003, 07:30 PM
Miss K. Miss K. is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Australia
Posts: 20 Miss K. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 32 sec
Reputation Power: 0
Conditional Compilation

One of my asp pages can be loaded in two ways - it may be submitted to itself (and therefore contains user data) or it can be loaded by clicking on a link on my menu, and consequently all fields are empty.

If the fields contain values (ie. the submit button was pressed), i want to load data from my database into an array, but if it is accessed via a link, i don't want this data to be loaded.

So essentially, i want to know if there is some form of conditional compilation or something in asp (i know it technically shouldn't be called that, but i'm coming from a c++ background, so...) similar to the #if and #elif type directives in C

I can't place the code in a subprogram and selectively call it, because I want the arrays to be global so all my client-side scripts can access the data

I'm using VBScript for the asp scripting. Any help here would be greatly appreciated.
Comments on this post
JimmyGosling agrees!

Reply With Quote
  #2  
Old February 10th, 2003, 03:03 AM
tosurender tosurender is offline
Techincal Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: New Delhi India
Posts: 12 tosurender User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
plz calrify u'r Problem mam

hi mam
i m working in ASP in india from last 2+ yrs
but it hard 2 understand u'r prob. after reading u'r thread(don't mind mam).
but after reading u'r prob. i came to know
u wanna display DB value on SUBMIT BUTTON and an blank values on a click of A LINK
right mam
so u can do thins by the use of just only a hidden button
u have to make one hidden form element in u'r form and put its value to blank and on click on the SUBMIT BUTTON call one javascript function by the help of this function just assign some value to the hidden form element and submit the form to desired action.
and on click of the LINK don't assign any value but submit the form on desired action.
after form submision just chk the value of hidden fields if it contains value thn do one operation which u wanna and if hidden is blank thn do other operation u wanna
i hope this will make sense to u
else feel free to ask any thing again
bye
Sur
Comments on this post
JimmyGosling agrees!

Reply With Quote
  #3  
Old February 10th, 2003, 06:54 PM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
There are a few options available.

There first is test if all fields are empty after submission if they are assume that the menu link was pressed. This does not allow you to determine if a blank form was submitted so I gues you have already thought of that.

The next on the list is to put a hidden input in the form, something like this.

<input type="hidden" name="wasform" value="true">

now you can test
If Request("wasform") = "true" Then
...
Else
...
End If

But my choice would be to make sure your form is submitting with method="post" ie.
<form action="myasp.asp" method="post" name="myForm">
If your menu link is an <a href="myasp.asp"> tag or an onClick="location.href=myasp.asp" event as long as it doesn't do a myForm.submit() that is as long a http get you can use the following code.

If Request.ServerVariable("REQUEST_METHOD") = "POST" Then
' my database code
Else
' somebody selected page from menu code
End IF
Comments on this post
JimmyGosling agrees!
__________________
--

ngibsonau

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Conditional Compilation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway