Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Event Firing??

Event Firing??

Scheduled Pinned Locked Moved Web Development
csharpasp-netdatabasehelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tadhg88
    wrote on last edited by
    #1

    Hi i am developing a web app using asp.net and c#, on a page i have 2 cols of dropdown lists the left filled with player names and right filled with possible heights. when a player is selected theres a postback to find and select the appropriate height for the selected player but the problem is there are 14 players ddls and 14 heights ddls all linked to the same function. but the problem is if no height is available for the selected player then N/A is selected in the heights ddl and the user can then choose the correct date from the ddl available but when i try to save the players details to the database the event to find the correct height is fired and then players height is reset to N/A... if anyone has an ideas or suggestions i would really appreciate them thanks in advance Tim private void player_SelectedIndexChanged(object sender, System.EventArgs e) { DropDownList ddlPlayer = sender as DropDownList; string number = ddlPlayer.ID.Substring(ddlPlayer.ID.IndexOf("homeName")+8); //*** create person object for height details DAL.ObjectAccess.Person oPerson = new DAL.ObjectAccess.Person(); oPerson.ID = new SqlInt32(Convert.ToInt32(ddlPlayer.SelectedValue.Substring(0, ddlPlayer.SelectedValue.LastIndexOf(":")))); oPerson.SelectOne(); //*** select correct height from ddl DropDownList ddlHeight = (DropDownList)this.FindControl("height" + number); if(ddlHeight != null) { ddlHeight.SelectedValue = oPerson.Height.Value.ToString(); } //*** display age on label Label lblAge = (Label)this.FindControl("homeSquad" + number); if(lblAge != null) { lblAge.Text = ddlPlayer.SelectedValue.Substring(ddlPlayer.SelectedValue.LastIndexOf(":")+1); } }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups