C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Dropdownlist+Sqldatasource+controlparameter


Posted Date: 04 Nov 2009      Posted By: RAHMAT RAUP      Member Level: Bronze     Points: 1   Responses: 0



[html]
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=10.1.2.68;Database=e-IRS;User ID=sa;Password=sa;" SelectCommand="SELECT [DetailID],[DetailDesc] FROM [e-IRS].[dbo].[View_MainCase]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="Data Source=10.1.2.68;Database=e-IRS;User ID=sa;Password=sa;" SelectCommand="SELECT '-1' AS [DetailID],'Choose Sub' AS [DetailDesc] UNION SELECT [DetailID],[DetailDesc] FROM [e-IRS].[dbo].[CaseDetail] WHERE [ParentID] = @DetailID">
<SelectParameters>
<asp:ControlParameter Name="DetailID" ControlID="ddMain1" PropertyName="SelectedValue" Type="Int32" DefaultValue="" />
</SelectParameters>
</asp:SqlDataSource>
[/html]
I have two dropdownlist(ddMain1,ddSub1)
I have two SqlDataSource(SqlDataSource1,SqlDataSource2)
SqlDataSource1 for ddMain1
SqlDataSource2 for ddSub1
each time ddMain1 selectedindexchange and postback
SqlDataSource2 with controlparameter, set to ddMain1 will bind data to ddSub1
My question is: what should I do if my script change the selectedvalue of both(ddMain1,ddSub1) which its return error because of the autopostback of ddmain1
not execute the ddmain1 selectedindexchange
..at the end i get invalid value for ddSub1 selectedvalue error





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.
Next : Encryption-Decryption
Previous : Database to gridview using dropdown-vb.net
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use