I am trying to update the datasource of a drop-down box Options

0 views
Skip to first unread message

stapes

unread,
May 12, 2008, 12:11:24 PM5/12/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi

I thought I would try this question again as I didn't get a
satisfactory reply first time.

Within a Form View (fvSingleLineOrders), I have two DropDownLists.
The
first, ddSiteTypes, contains a selection of Site Types. The second
(ddDestinations), is to contain a different selection based on the
choice of Site Type.
Here is my code:


protected void ddSiteTypes_SelectedIndexChanged(object sender,
EventArgs e)
{
DropDownList myList =
(DropDownList)fvSingleLineOrders.FindControl("ddSiteTypes");
int number = Convert.ToInt32(myList.SelectedValue);
Session["siteTypeID"] = number;
fvSingleLineOrders.DataBind();
}


Unfortunately, this resets all the other fields on the form.
How can I make it so it only updates ddDestinations?
fvSingleLineOrders is a Form View Control. It has its own databinding
code. I only want to update one field on the form - ddDestinations

Stapes

Crisatunity (blog.crisatunity.com)

unread,
May 12, 2008, 3:33:06 PM5/12/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
What basis do you have that posting the same question twice will yield
different results? Your first premise reads: "please let me waste
your time". Regardless, it is a simple sort of thing you are asking
so can't believe wasn't answered satisfactorily the first time you
asked it.

#1 make sure you are only binding to your first dropdown data source
when !IsPostback, and
#2 make sure that dropdown causes postbacks (not the default behavior
on the property pages)

Am I missing something?

stapes

unread,
May 13, 2008, 4:35:04 AM5/13/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting


On 12 May, 20:33, "Crisatunity (blog.crisatunity.com)"
<cleveridea....@gmail.com> wrote:
> What basis do you have that posting the same question twice will yield
> different results?  Your first premise reads: "please let me waste
> your time".  Regardless, it is a simple sort of thing you are asking
> so can't believe wasn't answered satisfactorily the first time you
> asked it.

http://groups.google.co.uk/group/DotNetDevelopment/browse_thread/thread/3c29e7b83a6e81ee/590caa3e600a240f?hl=en&lnk=gst&q=stapes#590caa3e600a240f

>
> #1 make sure you are only binding to your first dropdown data source
> when !IsPostback, and
> #2 make sure that dropdown causes postbacks (not the default behavior
> on the property pages)
>
> Am I missing something?
>

I don't know how to do that, that is why I am asking. Here is the
field I want binding to:

</asp:DropDownList>destination / site:<asp:DropDownList
ID="ddDestination" runat="server" DataSourceID="SqlDestinations"
DataTextField="destinationName"
DataValueField="siteID" SelectedValue='<%# Bind("destinationID") %>'
Width="264px" >
</asp:DropDownList><br />

Gomerbiz

unread,
May 13, 2008, 10:20:52 AM5/13/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Or in other words:

I'm better than you so let me be condescending and belittle you. Then
and only then will I agree to be helpful.

On May 12, 2:33 pm, "Crisatunity (blog.crisatunity.com)"
> > Stapes- Hide quoted text -
>
> - Show quoted text -

Andrew Badera

unread,
May 13, 2008, 1:24:31 PM5/13/08
to DotNetDe...@googlegroups.com
1. Not really. The list is noisy. The list has rules. The OP is making it noisier, and violating a rule.
2. So what was YOUR purpose here? Just to stop in, take a pee on someone's leg, and leave, also without being helpful?

OP: please regard the rules of the forum. By breaking the rules, you make the experience less pleasant for us all, and will tend to incline yourself towards getting less help.
--
--
--Andy Badera
http://higherefficiency.net
http://flipbitsnotburgers.blogspot.com/
http://andrew.badera.us/
http://changeroundup.com/
and...@badera.us
(518) 641-1280
Google me: http://www.google.com/search?q=andrew+badera

stapes

unread,
May 14, 2008, 4:31:42 AM5/14/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Still no solution to my initial problem. What is wrong with you guys?
If you can't give me a straightforward answer, then shut up.
> --Andy Baderahttp://higherefficiency.nethttp://flipbitsnotburgers.blogspot.com/http://andrew.badera.us/http://changeroundup.com/
> and...@badera.us
> (518) 641-1280
> Google me:http://www.google.com/search?q=andrew+badera- Hide quoted text -

Crisatunity (blog.crisatunity.com)

unread,
May 14, 2008, 1:56:42 PM5/14/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
You will always get grief for spreading a single question across
multiple threads; deal with it. -- Improve *yourself* in this regard
before you do it again.

And, I gave you a straightforward answer. You are too stupid or lazy
or both to try and understand it. Good luck.

Andrew Badera

unread,
May 14, 2008, 3:19:59 PM5/14/08
to DotNetDe...@googlegroups.com

adityo dwiarto

unread,
May 14, 2008, 10:17:03 PM5/14/08
to DotNetDe...@googlegroups.com
If you can't give me a straightforward answer, then shut up.

Dear Stapes,

as I learn from my 2 weeks stay in this forum, some of the most active people here (maybe moderators) are actually sharp-tongued people, plain ignorant with the level of your urgency, or just having fun teasing their inferiors. but all of it does not matter 'coz you shouldn't rely on everything (your actual problem to be solved) here in the forum. this forum can actually be a great place to learn -or at least to motivate yourself to learn elsewhere.

and no, those people will not shut up, 'coz they DO give solutions, sometimes as crystal clear, (never straight-up to the codes as far to my knowledge), but most of the time just talking about the concepts, where it gets back to yourself on building the solution out of the scraps. though about being straightforward or not, I'm afraid that's a one relative statement that different people may feel depending on your programming level/skills..

loosen up and have a little sense of humor, I hope you'd enjoy your stay here as much as I have.

ps: as a newbie I'd use temporary variables to reload all fields and make sure they do not resets while one or two fields (DropDownList) being updated. hope it helps

stapes

unread,
May 15, 2008, 6:13:56 AM5/15/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Your straightforward answer was irrelevant. If you had read the
question you would have seen that. Or perhaps you were too stupid or
lazy. Anyway, I got my answer on another forum - within an hour. You
guys have been dicking me around with your smart alec comments for
days. Get a life.

On 14 May, 18:56, "Crisatunity (blog.crisatunity.com)"
> > If you can't give me a straightforward answer, then shut up.- Hide quoted text -

Andrew Badera

unread,
May 15, 2008, 12:59:47 PM5/15/08
to DotNetDe...@googlegroups.com
We have lives. They involve, among other things, writing elegant code, and just plain knowing our shit. You, on the other hand, apparently have little better to do than troll around the 'tubes, making demands and failing to observe the traditions and rules of the communities you've come to while begging for help.

Crisatunity (blog.crisatunity.com)

unread,
May 15, 2008, 3:18:35 PM5/15/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting

> plain ignorant with the level of your urgency

You are confusing the forum's *ignorance* with *apathy*. What free
forum *anywhere* cares about the urgency of the OP? Why should they?
If the issue is urgent, they should pay a professional or buy
professional support services. This is a *learning* (and social)
forum not anyone's personal helpdesk service.

If you don't get that and don't like enough of what goes on here,
don't let the door hit your ass on the way out.

Crisatunity (blog.crisatunity.com)

unread,
May 15, 2008, 3:20:30 PM5/15/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Since my answer was spot on, I think I can guess whether it is
laziness or stupidity on your part. Post your before and after code
and demonstrate how my advice was irrelevant or STFU and go away.
> > - Show quoted text -- Hide quoted text -

stapes

unread,
May 16, 2008, 4:58:43 AM5/16/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
In case any of you are interested, I found my answers here:

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/CCDWithDB.aspx

I didn't realize I had joined another fight club.

Stapes

P.S. Who is the OP?

On 15 May, 20:20, "Crisatunity (blog.crisatunity.com)"

Andrew Badera

unread,
May 16, 2008, 1:01:21 PM5/16/08
to DotNetDe...@googlegroups.com
Wow, congratulations, you were able to discover widely-available, well-indexed-by-Google information. Your cookie's at the desk downstairs.

You realize you could avoided the rigmarole by simply doing due diligence to begin with?

OP == "Original Poster" == you in this case
Reply all
Reply to author
Forward
0 new messages