ASPX templates
Version 5.x > ASPX templates > SQL Query + Form Control View modes: 
User avatar
Member
Member
homesick_alien13-hotmail - 9/20/2010 11:28:55 PM
   
SQL Query + Form Control
Hi all,
really need help on this.
i created one form control contain with dropdownlist. The dropdownlist will list artist name grab from database.

The problem is, i want after user select artist name from that dropdownlist, it will passing an id and after that another dropdownlist will listing song from that artist.

I'm already put an autopostback=true to artist name dropdownlist. i have no idea how to do that.

thanks in advance and sorry for my english

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 9/24/2010 3:56:40 AM
   
RE:SQL Query + Form Control
Hi,

There are some examples on how to make dropdownlist to autopostback on change over developers web communities.
What code are you using in your form control? You could use updatepanel for that action.

Quoting some example:

<asp:ScriptManager ID="smMain" runat="server" />

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true" >
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>item 1</asp:ListItem>
<asp:ListItem>item 2</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>

//and the handler method

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
// load the data for the second dropdown list
}



What issues are you having with your form control in particular?
Any errors or incorrect behavior?

Regards,
Zdenek

User avatar
Member
Member
homesick_alien13-hotmail - 9/26/2010 10:09:50 PM
   
RE:SQL Query + Form Control
solved by now.