Google Groups Home
Help | Sign in
Message from discussion DropDownList + dane z SQL + reczne dodanie wiersza
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Taptuś  
View profile
 More options Dec 1 2006, 11:36 am
Newsgroups: alt.pl.comp.lang.csharp
From: "Taptuś" <pu...@poczta.onet.pl>
Date: Fri, 1 Dec 2006 17:36:53 +0100
Local: Fri, Dec 1 2006 11:36 am
Subject: DropDownList + dane z SQL + reczne dodanie wiersza
Witam,

gdzie popelniam blad - bo sam nie wiem:

this.EnableViewState = false;
this.Init += new System.EventHandler(this.UcWyborLokalizacji_Init);
DropDownList1.Items.Clear();
DropDownList1.DataSource = f. SQL -< dziala i wypelnia
DropDownList1.DataTextField = "Opis";
DropDownList1.DataValueField = "Location";
DropDownList1.DataBind();

// reczne dodanie 1 wartosci - zeby wymusic wybor

DropDownList1.Items.Insert(0, "<-- Wybierz -->");
DropDownList1.Items[0].Value = "nie wybrano";

i dalej:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs
e)
{
string wybrana_lokalizacja = DropDownList1.SelectedValue.ToString();
Session["aktualna_lokalizacja"] = wybrana_lokalizacja;

}

przy zmianie w obrebie calej listy dziala - po wejsciu na <-- Wybierz -->
echo - breakpoint nie lapie zmiany indeksu

co jest nie tak ?

wszystkie dane poprawnie figuruja na liscie + jak zmienie na "Wybierz" to w
kodzie strony przy podgladzie mam: selected - czyli niby lapie
ale nie odpala debuggera + nie zmienia wartosci: wybrana_lokalizacja

pzdr.
Taptuś


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google