473,327 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

I'm just learning, please help - using VBScript within .aspx body

Beverly
I have created an .aspx page called ORIValidate.aspx. I want to use an IF/THEN/ELSE/ENDIF VBScript option within the body/HTML section. I am quite sure my problem is with the single or double quotes usage (or lack there of). Here is the code. Could someone please tell me what is wrong here? Thanks much.

<% IF Session("sessOriValid") = "FALSE" THEN %>

<asp:Label id="AgencyORIInfoInvalid" style="Z-INDEX: 109; LEFT: 160px; POSITION: absolute; TOP: 272px; TEXT-ALIGN: center" runat="server" Width="632px" Font-Names="Arial" Font-Size="10pt" Height="40px">Your <a href="AgencyORI.aspx" target="_blank"><b>AGENCY</b></a> ORI Number is invalid! Please re-enter!<br>(Click the 'Agency' link above for the description of an Agency ORI.)</asp:Label>

<% ELSE %>

<asp:Label id="AgencyORIInfo" style="Z-INDEX: 109; LEFT: 160px; POSITION: absolute; TOP: 272px; TEXT-ALIGN: center" runat="server" Width="632px" Font-Names="Arial" Font-Size="10pt" Height="40px">To continue the online registration process, please enter your <a href="AgencyORI.asp" target="_blank"><b>AGENCY</b></a> ORI Number below:<br>(Click the 'Agency' link above for the description of an Agency ORI.)</asp:Label>

<% END IF %>

The single quotes around the word 'Agency' appear to be throwing this off because that code is turning GREEN (everything after it). Also, the word "is" in the first <asp:label> tag, before the word invalid! is BLUE. So is the word "To" in the second <asp:label> tag where it starts: To continue... And, of course, the IF, THEN, ELSE, and END IF are all BLUE.

Hope I've given enough info.

Thanks for your help!
Jan 18 '07 #1
4 5415
I have created an .aspx page called ORIValidate.aspx. I want to use an IF/THEN/ELSE/ENDIF VBScript option within the body/HTML section. I am quite sure my problem is with the single or double quotes usage (or lack there of). Here is the code. Could someone please tell me what is wrong here? Thanks much.

<% IF Session("sessOriValid") = "FALSE" THEN %>

<asp:Label id="AgencyORIInfoInvalid" style="Z-INDEX: 109; LEFT: 160px; POSITION: absolute; TOP: 272px; TEXT-ALIGN: center" runat="server" Width="632px" Font-Names="Arial" Font-Size="10pt" Height="40px">Your <a href="AgencyORI.aspx" target="_blank"><b>AGENCY</b></a> ORI Number is invalid! Please re-enter!<br>(Click the 'Agency' link above for the description of an Agency ORI.)</asp:Label>

<% ELSE %>

<asp:Label id="AgencyORIInfo" style="Z-INDEX: 109; LEFT: 160px; POSITION: absolute; TOP: 272px; TEXT-ALIGN: center" runat="server" Width="632px" Font-Names="Arial" Font-Size="10pt" Height="40px">To continue the online registration process, please enter your <a href="AgencyORI.asp" target="_blank"><b>AGENCY</b></a> ORI Number below:<br>(Click the 'Agency' link above for the description of an Agency ORI.)</asp:Label>

<% END IF %>

The single quotes around the word 'Agency' appear to be throwing this off because that code is turning GREEN (everything after it). Also, the word "is" in the first <asp:label> tag, before the word invalid! is BLUE. So is the word "To" in the second <asp:label> tag where it starts: To continue... And, of course, the IF, THEN, ELSE, and END IF are all BLUE.

Hope I've given enough info.

Thanks for your help!


Ok, it's me again....

Here are the changes I made in my code. Everything 'appears' to look ok in the HTML; however, in Design mode, the TEXT value in Properties will only let me put in ONE label value. I can't put in the entire 'code' for if this else this. So, now I'm wondering.....in this case, is using a label the right thing to do? Or, should I maybe use a <div> tag? Suggestions???

Here is the latest code....

'<%# IF Session("sessOriValid") = "FALSE" THEN %>'

<asp:Label id="AgencyORIInfoInvalid" style="Z-INDEX: 109; LEFT: 160px; POSITION: absolute; TOP: 272px; TEXT-ALIGN: center" runat="server" Width="632px" Font-Names="Arial" Font-Size="10pt" Height="40px">Your <a href="AgencyORI.aspx" target="_blank"><b>AGENCY</b></a> ORI Number is invalid! Please re-enter!<br>(Click the 'Agency' link above for the description of an Agency ORI.)</asp:Label>

'<%# ELSE %>'

<asp:Label id="AgencyORIInfo" style="Z-INDEX: 109; LEFT: 160px; POSITION: absolute; TOP: 272px; TEXT-ALIGN: center" runat="server" Width="632px" Font-Names="Arial" Font-Size="10pt" Height="40px">To continue the online registration process, please enter your <a href="AgencyORI.aspx" target="_blank"><b>AGENCY</b></a> ORI Number below:<br>(Click the 'Agency' link above for the description of an Agency ORI.)</asp:Label>

'<%# END IF %>'

If I use labels here, do I need to place a second label on the Design screen OVER the first label? How would this work?

Thanks for any assistance you can give.
Jan 18 '07 #2
kenobewan
4,871 Expert 4TB
I worry about the design of this, when the IF THEN ELSE END IF can all be in the vb.net code. You could have the labels visibility set to false and then set one to true depending the outcome. I would have one label and change the text depending on the result.

If you don't want to redesign I understand - try single quotes for the href and target...

Hope that this helps.
Jan 18 '07 #3
I worry about the design of this, when the IF THEN ELSE END IF can all be in the vb.net code. You could have the labels visibility set to false and then set one to true depending the outcome. I would have one label and change the text depending on the result.

If you don't want to redesign I understand - try single quotes for the href and target...

Hope that this helps.

Thanks for your feedback. As this is my FIRST .NET transition (transitioning a website designed in ASP to ASP.NET) and being a 'newbie' to web design as a whole (.NET, ASP.NET, VB.NET, ADO.NET), I am extremely wet behind the ears right now and just trying to learn best methods/practices and keep my head above water. So, any 'redesign' is not a problem, if it is going to make this site work/flow better.

This site has an initial page (thus the Session variable) that will not allow the user to get past unless a valid number is entered into a textbox. The session variable is being set so the user can't type in the url for the subsequent pages directly from the address line. Therefore, when the page is first loaded, on value needs to appear in the label area that could change. Upon entering in a value in the text box, it will either change that label value, indicating what they entered is invalid, or it will advance them to the next .aspx page, if the value the entered is valid. So, I guess what I could do is put the IF THEN ELSE statement in the .vb page and on the ON PAGE LOAD, check the Session value to see what she be placed in the label and then on the Submit button, check the validity of the entry to see what value should be placed in the label. Is this what you were thinking?

Thanks for your help.
Jan 19 '07 #4
kenobewan
4,871 Expert 4TB
Exactly - you are a fast learner :). Give it a go and post the result...
Jan 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Martin | last post by:
Hi, I've got a funny and wanted to know if there is a fix out there for this. I display a jsp inside a frame that monitors the database and reloads itself via the setTimeout js function. To...
2
by: ChucRock | last post by:
Hi, I have the following code where there is some client side VBScript that does something and needs to pass a variable back to the ASP.NET page. When the page is updated through a postback, the...
3
by: prabhupr | last post by:
Hi Folks Not sure if this is the right group, if not please re-direct me to the right one. Here is my question =============== When I compile my ASP.NET WEB project from VS 2005 (.NET...
28
by: Tim_Mac | last post by:
hi, i'm new to .net 2.0, and am just starting to get to grips with the gridview. my page has autoEventWireUp set to true, which i gather is supposed to figure out which handlers to invoke when...
6
by: momo | last post by:
Guys I need your help on this. I have this one problem and I admitted I am a novice at this. This is a Code Behind in an aspx page. You will see where I have the plus signs below in...
8
by: Jimbo | last post by:
Hello I am currently designing an internal ordering system for IT equipment. I am designing it in ASP.NET (vb) using Visual Studio 2003 and using Microsoft SQL Server I have got the system...
11
by: simon | last post by:
Hello, I'm helping write a .net app, we are using VS2005 and asp/vb.net for code we are using the "masterPage.master" technique, within the masterpage we have an asp:contentplaceholder that is...
1
by: Steven Cheng [MSFT] | last post by:
Hi Tony, As for .NET /C# learning materials, I seldom see any audiobooks. However, there does exists many video sessions or online webcast which you can subscribe or download. Here are some: ...
2
by: monsalvo | last post by:
What's so wrong with my code? This line is part of a VBScript soap client part of a DTS wich is functional in a 90 percent. strText = .responseXML.selectSingleNode("//" login "loginReturn") ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.