473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to add to asp.net code

36 New Member
I have a site which I need to modify and add phone numbers based on what branch is being displayed. I have NO clue what-so-ever on how to do this.

I have a .aspx file which is using another file as its code behind. My first question is: If I want to add "if statements" into this code, do I add them in the .aspx file or the code behind (aspx.vb) file? Next question is: A statement like
"<asp:Literal runat="server" ID="ltlBranch" /> Employees"
is using ltlBranch to place the branch name in front of Employees. Can I use ltlBranch as my lookup variable? In other words, is this valid coding for asp?

If ltlBranch="MainStreet"
show the rest of my code
Else
this code
EndIf

Or is there a different approach that would be better and more normalized? Should I be creating a sub-routine within the codebehind form and then calling that routine? I am clueless on how to go about this, and am just trying to get a starting point so I can look up more info on it. If I am off on the wrong track, please let me know.
Thank you for any help in making this easier for me...
May 19 '10 #1
1 1432
jhardman
3,406 Recognized Expert Specialist
Let me give you a few pointers, I see you are very new.
1) you are not talking about ASP, you are talking about ASP.NET. These are two incompatible technologies (ASP uses .asp file extension, and <%%> code tags, ASP.NET uses .aspx file extensions, and <asp: /> code tags). I will move your post to the appropriate forum.
2) even though you can edit these files just by opening them in notepad, most .NET developers use "Visual Web Developer" which has a free "express" version. Unless you were an experienced developer who had a ligitimate reason not to do so, I would recommend that you download that and get to use it
3) VWD will help you put the code in the right place, and even prompt you to code correctly, but I would recommend working through a simple tutorial to get your feet wet, get familiarized with the process.

Good luck with your project.

Jared
May 21 '10 #2

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

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
37
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes...
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)...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
4
by: KenFehling | last post by:
Hello. I am wondering if there exists a piece of software that takes multiple .js files that are nicely indented and commented and create one big tightly packed .js file. I'm hoping the one file...
3
by: pcol | last post by:
Does anyone know the code to insert into a standard AJAX Google News Bar code which would allow a user to input a name from which to have the News Bar search. Currently, the News Bar code only...
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
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...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.