Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-24-2004, 02:17 PM   #1 (permalink)
JCode
Registered User
 
Join Date: Aug 2004
Posts: 1
JCode is on a distinguished road
NEED Help, new to ASP and C#

I am trying to get a handle on ASP and C#. I am very familiar with php, and i'm trying to do some stuff that i can easily do in php. first
i'm trying to diplay a dropdownlist with numbers 1 through 5 in them, then i would like to display a textbox as many times as the numbers selected on the dropdown. my code looks like this.

<asp:dropdownlist id="num_items" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 360px"runat="server" AutoPostBack="True">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="5">5</asp:ListItem>
</asp:dropdownlist>

<asp:textbox id="txt_spec_name" style="Z-INDEX: 107; LEFT: 24px; POSITION: absolute; TOP: 432px"runat="server" Width="376px"></asp:textbox>

Now from the number selected in the num_items dropdownlist, i want it to display the textbox that many times, and make sure i know exactly which one is which, kind of like a variable in the id. can anyone help
JCode is offline   Reply With Quote
Old 08-24-2004, 02:37 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,490
sde is on a distinguished road
this isn't going to be much help, but i love c#, but i hate asp.net!
wouldn't it be something like this?
Code:
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
  {
    txt_spec_name.Text = num_items.SelectedItem.ToString();
  }
}
</script>
i'm not 100% sure on this one, and i can't test it right now.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Tutorials: ASP Strings, and Visual Studio/VB.NET sde Code Newbie News 0 03-25-2004 06:37 PM
New Java and ASP Tutorials sde Code Newbie News 2 03-15-2004 08:02 PM
Php Vs. Asp sde PHP 6 06-06-2003 06:02 PM


All times are GMT -8. The time now is 05:14 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting