473,396 Members | 2,002 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,396 software developers and data experts.

Code Behind and IF statement on whether to display content

Ok, I have grown up on coding old ASP.
Now I am moving over to ASP.net and I need to understand...
I have a page where I am doing a post from an HTML page, to an aspx
page and doing the insert of the form to the database and redirecting
the user... that is all fine and good. Now I have a requirement to
test the state/zip against a table in my database before entering
their data in the db and redirecting the user. So in old ASP, I would
just put that code above the post... I can do that here too and do a
query against the database and then if it is valid state and zip I do
the insert and redirect, but if it is NOT a valid state/zip, I need to
display a form for them to put their state and zip in correctly, so I
need to add HTML to the aspx page... but I can't seem to write code in
the VB file and then do if statement in the aspx file to decide
whether or not to show the HTML.
Can anyone tell me how this is supposed to be done in ASP.Net?
Cause My brain is tooo stuck on old ASP.

thanks
Nov 18 '05 #1
1 1756
Sounds like a job for the CustomValidator

"igloogod" <tp********@mindspring.com> wrote in message
news:bd**************************@posting.google.c om...
Ok, I have grown up on coding old ASP.
Now I am moving over to ASP.net and I need to understand...
I have a page where I am doing a post from an HTML page, to an aspx
page and doing the insert of the form to the database and redirecting
the user... that is all fine and good. Now I have a requirement to
test the state/zip against a table in my database before entering
their data in the db and redirecting the user. So in old ASP, I would
just put that code above the post... I can do that here too and do a
query against the database and then if it is valid state and zip I do
the insert and redirect, but if it is NOT a valid state/zip, I need to
display a form for them to put their state and zip in correctly, so I
need to add HTML to the aspx page... but I can't seem to write code in
the VB file and then do if statement in the aspx file to decide
whether or not to show the HTML.
Can anyone tell me how this is supposed to be done in ASP.Net?
Cause My brain is tooo stuck on old ASP.

thanks

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Coco | last post by:
Hi! I managed to display chinese character in my web form (.aspx), in certain situation i need to to set the text of the label of my web form in chinese character programatically which is done in...
2
by: Vinitha | last post by:
I have been trying to display a resultset in atable format using the table object from the code behind page. Can anyone suggest whether i am in the right direction or do we have any other approach...
3
by: Christer | last post by:
Hi all! We're creating an administration for a web application. This includes severeal aspx pages. Our key entity in the web application is "Profile", which can have a certain type. Based on...
2
by: ntm | last post by:
I have this meta statement in the html for my aspx page: <meta http-equiv="Refresh" content="5"> Rather than hard code the content as 5 I want to set it to different values from the aspx.vb code...
5
by: Richard Dixson | last post by:
I created a new C# web application. Basically all I am trying to do is create a table that consists of a few rows with two columns in each. And then to set those columns to text values from my...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
4
by: David Thielen | last post by:
Hi; I have a page where the file.aspx.cs Page_Load() method writes the entire contents out directly. I use this to write a pdf or rtf file as the web page to display. In .net 1.1 the way I...
1
by: bradwoody | last post by:
ASP.Net and C# I am having trouble determining how to manipulate html controls via javascript AND access those same controls in the C# code behind. Here's the scoop: I am making an advanced...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.