How to add to asp.net code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brat33
    New Member
    • Jan 2010
    • 36

    How to add to asp.net code

    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:Liter al 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="Main Street"
    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...
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    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

    Comment

    Working...