ok this is my scenario. I've never coded in asp.net. I can manipulate it a
little bit because I have some coding knowledge but I don't know what I
am doing so I need help figuring out how to do this.

This is what I'm trying to do...I have this drop down menu that has US jobs in it. I want when a person clicks a state the jobs available in that state appear. The jobs also have to be links. I just want the job title to appear. I have the descriptions and such on individual pages and I don't want to utilize a DB.

Is there a way, when the user selects the state the results are posted back to the user?

For instance I saw the code attached online. Is there a way I can manipulate this and say if the state is Florida print out florida jobs?

<%@ Page Language="C#" %>
<script runat="server">

    void page_Load()
    {
         if(Page.IsPostBack)
         {
             if(chkIsMember.Checked==true){
                 lblOut.Text = "Members get a free ticket";
                 lblOut.BackColor=System.Drawing.Color.LightPink;
             }
             else if(Convert.ToInt32(txtAge.Text)<=18) {
                 lblOut.Text = "Students get a free ticket";
                 lblOut.BackColor=System.Drawing.Color.LightPink;
             }else {
                 lblOut.Text = "Price is 500";
                 lblOut.BackColor=System.Drawing.Color.LightSeaGreen;
             }
         }
    }

</script>
<html>
<head>
</head>
<body>
    <br />
    <form runat="server">
        Please enter your age 
        <asp:TextBox id="txtAge" runat="server"></asp:TextBox>
        <br />
        Are you a member? 
        <asp:CheckBox id="chkIsMember" runat="server"></asp:CheckBox>
        <asp:Button id="Button1" runat="server" Text="Submit"></asp:Button>
        <br />
        <asp:Label id="lblOut" runat="server"></asp:Label>
        <br />
    </form>
</body>
</html>

Set ur dropdownlists AutoPostback property to True, and write code on the SelectedIndexChanged property.

for ex.,
you have items ABC,XYZ in your dropdownlist, then on SelectedIndexChanged event write a code something like this,

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
      
       if(DropDownList1.SelectedItem.Value=="ABC")
       {
            //code to display statewise jobs..
       }
       if(DropDownList1.SelectedItem.Value=="XYZ")
       {
            //same code..
        }
}

which control ur using to display all the jobs?

hope that helps...

I just have a label...

<asp:Label id="lblOut" runat="server"></asp:Label>

Is that ok?

I just have a label...

<asp:Label id="lblOut" runat="server"></asp:Label>

Is that ok?

i dint get u..u said u have to display all jobs for that state, right? then how u r goin to display multiple jobs in a single label? u can either show it in a grid or in another dropdown list.

I actually have it working using a loop. This is alot of code but here goes....

protected void state_SelectedIndexChanged(object sender, EventArgs e)
{        
	lblOut.Text="";
	ArrayList linkCollection = GetLinksForState(state.SelectedValue);
	//ArrayList title = GetLinksForState(state.SelectedValue);
        
        //Aksh: This method would do everything for you.
        //Following loop can be done in better way. You may modify the text the way you wanted to display
        for (int i = 0; i < linkCollection.Count; i++)
        {
            lblOut.Text += "<a href='" + linkCollection[i] + "'>" + linkCollection[i] + "</a> <br />";
        }
	
}
	 public ArrayList GetLinksForState(string stateValue)
    {
        ArrayList linksCollection = new ArrayList();
        switch (state.SelectedValue)
        {
           case "Alabama":
                linksCollection.Add("http://www.susanfschulz.com/employment/AL-College-Academic-Dean-Montgomery.aspx");
                break;
            case "Arkansas":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
            case "American Samoa":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
            case "Arizona":
                linksCollection.Add("http://www.susanfschulz.com/employment/AZ-College-Director-of-Education.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/AZ-College-Pharmacy-Tech-Program-Director.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/AZ-College-Physical-Therapy-Program-Director.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/AZ-College-Surgical-Tech-Program-Director.aspx");
                break;
            case "California":
                linksCollection.Add("http://www.susanfschulz.com/employment/CA-College-Campus-Director.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/CA-College-Chief-Operating-Officer.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/CA-College-Regional-Director-of-FA.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/CA-College-Regional-Director-of-HS-Admissions.aspx");
                linksCollection.Add("http://www.susanfschulz.com/employment/CA-Director-of-Financial-Aid.aspx");
                break; 
 	        case "Colorado":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
	        case "Connecticut":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
            case "District of Columbia":
                linksCollection.Add("http://www.susanfschulz.com/employment/DOC-College-Director-of-Admissions.aspx");
                break; 
		    case "Delaware":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Florida":
                linksCollection.Add("http://www.susanfschulz.com/employment/FL-College-Campus-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/FL-College-Director-of-Financial-Aid.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/FL-College-Online-Admissions-Manager.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/FL-College-Vice-President-Compliance.aspx");
                break;
			case "Federated States of Micronesia":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Georgia":
                linksCollection.Add("http://www.susanfschulz.com/employment/GA-College-Director-of-Education.aspx");
                break;
			case "Guam":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
		    case "Hawaii":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Iowa":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Idaho":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Illinois":
                linksCollection.Add("http://www.susanfschulz.com/employment/IL-College-Director-of-FA.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/IL-College-President-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/IL-College-School-Director.aspx");
                break;
			case "Indiana":
                linksCollection.Add("http://www.susanfschulz.com/employment/IN-College-Site-Coordinator.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/IN-College-Site-Coordinator2.aspx");
                break;
			case "Kansas":
                linksCollection.Add("http://www.susanfschulz.com/employment/KS-College-Site-Coordinator.aspx");
                break;
			case "Kentucky":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Louisiana":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Massachusetts":
                linksCollection.Add("http://www.susanfschulz.com/employment/MA-College-Corporate-Director-of-Compliance.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/MA-College-Director-of-Education.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/MA-College-Director-of-Placement.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/MA-College-DOA.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/MA-College-Executive-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/MA-College-Regional-VP-of-Admissions.aspx");
                break;
			case "Maine":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Maryland":
                linksCollection.Add("http://www.susanfschulz.com/employment/ML-Associate-College-Campus-Director.aspx");
                break;
			case "Marshall Islands":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Michigan":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Minnesota":
                linksCollection.Add("http://www.susanfschulz.com/employment/MN-College-Director-of-Admissions.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/MN-College-President-Campus-Director.aspx");
                break;
			case "Missouri":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Northern Marina Islands":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Mississippi":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Montana":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "North Carolina":
                linksCollection.Add("http://www.susanfschulz.com/employment/NC-College-Director-of-BA.aspx");
                break;
			case "North Dakota":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Nebraska":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "New Hampshire":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "New Jersey":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "New Mexico":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Nevada":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "New York":
                linksCollection.Add("http://www.susanfschulz.com/employment/NY-College-Corporate-Director-of-FA.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/NY-College-Director-of-Admissions.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/NY-College-Director-of-Education.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/NY-College-Director-of-Education2.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/NY-College-Executive-Director-of-Education.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/NY-College-Telemarketing-Director.aspx");
                break;
			case "Ohio":
                linksCollection.Add("http://www.susanfschulz.com/employment/OH-College-Admissions-Training-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/OH-College-Director-of-Marketing-and-Business-Development.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/OH-College-Executive-Director-of-Education.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/OH-College-Executive-Director-of-Education2.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/OH-College-Regional-VP-of-Admissions.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/OH-College-Site-Coordinator.aspx");
                break;
			case "Okalahoma":
                linksCollection.Add("http://www.susanfschulz.com/employment/OK-College-Site-Coordinator.aspx");
                break;
			case "Oregon":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Pennsylvania":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Puerto Rico":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Palau":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Rhode Island":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "South Carolina":
                linksCollection.Add("http://www.susanfschulz.com/employment/SC-College-Campus-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/SC-College-DOA.aspx");
                break;
			case "South Dakota":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Southeast":
                linksCollection.Add("http://www.susanfschulz.com/employment/SE-College-Campus-President.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/SE-College-Cosmetology-Program-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/SE-College-Director-of-Career-Services.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/SE-College-DOA.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/SE-College-Respiratory-Therapy-Program-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/SE-College-School-Directors.aspx");
                break;
			case "Tennessee":
                linksCollection.Add("http://www.susanfschulz.com/employment/TN-College-Campus-Director.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/TN-College-Director-of-Surgical-Tech-Depart.aspx");
                break;
			case "Texas":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Utah":
                linksCollection.Add("http://www.susanfschulz.com/employment/UT-College-Director-of-Education.aspx");
                break;
			case "Virgin Islands":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Vermont":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Virginia":
                linksCollection.Add("http://www.susanfschulz.com/employment/VA-College-Compliance-and-Accreditation-Officer.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/VA-College-Corporate-Academic-Deans.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/VA-College-Director-of-Education.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/VA-College-Director-of-Nursing-Ed.aspx");
				linksCollection.Add("http://www.susanfschulz.com/employment/VA-College-School-Director.aspx");
                break;
			case "Washington":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Wisconsin":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "West Virginia":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
			case "Wyoming":
                linksCollection.Add("http://www.susanfschulz.com/employment/none.aspx");
                break;
//Aksh: Build for every state
		}
        return linksCollection;
    }

I've had some help with this but my help has left me. Now what I'm trying to do print out some text and make it a url using the key and value of an array. If you can help with this is would be greatly appreciated...
This is crashing on me and I don't do asp.net so I can't really say why or ahy not. Can you help with this?

protected void state_SelectedIndexChanged(object sender, EventArgs e)
{        
    lblOut.Text="";
    NameValueCollection linkCollection = GetLinksForState(state.SelectedValue);
    //ArrayList title = GetLinksForState(state.SelectedValue);

        //Aksh: This method would do everything for you.
        //Following loop can be done in better way. You may modify the text the way you wanted to display
        foreach (string key in linkCollection)
        {
            string keyName = key;
            string keyValue = linkCollection[key];
            lblOut.Text += "<a href='" + keyValue + "'>" + keyName + "</a><br />";
        }

}

public ArrayList GetLinksForState(string stateValue)
    {
        //ArrayList linksCollection = new ArrayList();
        NameValueCollection links = new NameValueCollection();
        switch (state.SelectedValue)
        {
           case "Alabama":
                links.Add("College Academic Dean","http://www.blank.com/employment/AL-College-Academic-Dean-Montgomery.aspx");
                break;

}
        return links;
    }   

ok this is my scenario. I've never coded in asp.net. I can manipulate it a
little bit because I have some coding knowledge but I don't know what I
am doing so I need help figuring out how to do this.

This is what I'm trying to do...I have this drop down menu that has US jobs in it. I want when a person clicks a state the jobs available in that state appear. The jobs also have to be links. I just want the job title to appear. I have the descriptions and such on individual pages and I don't want to utilize a DB.

Is there a way, when the user selects the state the results are posted back to the user?

For instance I saw the code attached online. Is there a way I can manipulate this and say if the state is Florida print out florida jobs?

<%@ Page Language="C#" %>
<script runat="server">

    void page_Load()
    {
         if(Page.IsPostBack)
         {
             if(chkIsMember.Checked==true){
                 lblOut.Text = "Members get a free ticket";
                 lblOut.BackColor=System.Drawing.Color.LightPink;
             }
             else if(Convert.ToInt32(txtAge.Text)<=18) {
                 lblOut.Text = "Students get a free ticket";
                 lblOut.BackColor=System.Drawing.Color.LightPink;
             }else {
                 lblOut.Text = "Price is 500";
                 lblOut.BackColor=System.Drawing.Color.LightSeaGreen;
             }
         }
    }

</script>
<html>
<head>
</head>
<body>
    <br />
    <form runat="server">
        Please enter your age 
        <asp:TextBox id="txtAge" runat="server"></asp:TextBox>
        <br />
        Are you a member? 
        <asp:CheckBox id="chkIsMember" runat="server"></asp:CheckBox>
        <asp:Button id="Button1" runat="server" Text="Submit"></asp:Button>
        <br />
        <asp:Label id="lblOut" runat="server"></asp:Label>
        <br />
    </form>
</body>
</html>

I feel you should use a div for this which would appear on dropdown change event and will display whatever you want dynamically

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.