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

Need a clean solution to an asp Select case issue

I have a situation where I will display text boxes and labels depending on
the user type of the user using this form. In the asp version I used a
select case, but in the .net version I am putting all the code in the .vb
file. i don't want any code on the aspx page so how can do I this?

Select case usertype
case 1:
<input type=textfield name="TextField1" >
case 2:
<input type=textfield name="TextField2">
case 3:
<input type=textfield name="TextField3">
end case
Nov 18 '05 #1
2 1206
One way: From the code-behind, you can set the .Visible property of each
textbox control (TextField1.Visible = false;) or whatever. Setting the
visible property to false causes no HTML to be rendered to the browser for
the control. You could still have a SELECT CASE control which textboxes are
visible (or a switch structure in C#)... you're just executing it from your
code-behind.

HTH

"William Gower" <w_*****@hotmail.com> wrote in message
news:ec****************@tk2msftngp13.phx.gbl...
I have a situation where I will display text boxes and labels depending on
the user type of the user using this form. In the asp version I used a
select case, but in the .net version I am putting all the code in the .vb
file. i don't want any code on the aspx page so how can do I this?

Select case usertype
case 1:
<input type=textfield name="TextField1" >
case 2:
<input type=textfield name="TextField2">
case 3:
<input type=textfield name="TextField3">
end case

Nov 18 '05 #2
Hello William,

TextBox tb = new TextBox();

Select case usertype
case 1:
tb.Id = "TextxField1";
case 2:
tb.Id = "TextxField3";
case 3:
tb.Id = "TextxField3";
end case

this.Controls.Add(tb);
I have a situation where I will display text boxes and labels
depending on the user type of the user using this form. In the asp
version I used a select case, but in the .net version I am putting all
the code in the .vb file. i don't want any code on the aspx page so
how can do I this?

Select case usertype
case 1:
<input type=textfield name="TextField1" >
case 2:
<input type=textfield name="TextField2">
case 3:
<input type=textfield name="TextField3">
end case

--

--
Matt Berther
http://www.mattberther.com
Nov 18 '05 #3

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

Similar topics

17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
10
by: Lakshmi Narayanan.R | last post by:
Hi Experts, Using keyword "To" in select case giving error.The following code is got from www.microsrosoft.com itself. What is the wrong with this?. <% Dim Number1 Number1 = 7 ' Initialize...
7
by: Lauren Quantrell | last post by:
Is there any speed/resource advantage/disadvantage in using Select Case x Case 1 Case 2 etc. many more cases... End Select VS.
8
by: | last post by:
Hello, This is gonna sound real daft, but how do I test a Select Case statement for variants of a theme? Here's a snippet of my code... Select Case sUsr Case "Guest", "TsInternetUser",...
3
by: Nick Gilbert | last post by:
Hi, In my VS.NET 2005, if I choose Build Clean Solution, the BIN folder is not touched. Shouldn't it delete all the dll and pdb files in that folder first? Instead, I'm finding I have to do it...
1
by: microsoft.public.dotnet.languages.vb | last post by:
Hi All, I wanted to know whether this is possible to use multiple variables to use in the select case statement such as follows: select case dWarrExpDateMonth, dRetailDateMonth case...
18
by: nfenlon | last post by:
I'm new to VB express 2005 and am having some trouble with coding. I'm using a CASE structure in my program and i'm wondering if anyone can help me. Instead of Saying "Case 1,2,3,4" is there a way...
2
by: Bob Altman | last post by:
Hi, My VB project (VS 2005) has a post-build event that runs a program that creates an executable file in the target directory (that is, the same folder that contains the normal build results). ...
11
by: WannabePrgmr | last post by:
In access 2003, on a simple form, I am trying to base the recordsource of a combobox on two other combobox's data. Here is the code I've tried and it did not work (except for the PN Cross/Info). ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.