Newbee asp.net problem. I looked at a lot of tutorials, and have not found one on this yet. Hopefully someone can help. Sorry for all the verbage. I posted this to another forum with less verbage and all I got was what are you wanting to do.
I have a dropdownlist control that is bound to a sqlDB.
I have a detailsview triggered by the onchange of the dropdowndlist. Both show on the same page. Populating the dropdownlist and triggering a record for the detailsview works great.. Problem is when I add a new record, or delete a record, I cannot get my dropdownlist to repopulated with the updated info. I used to connections to the same db because the dropdownlist combines two fields, (FirstName, Last Name as..)
The second connection for the detailsview keeps them seperate so both can be edited.
My dropdownlist is bound to a datasource called dropdownDataSource1.
The detailsview is bound to contactDataSource1.
A Details view Triggered to the onchange .. this part works great.
The codebehind:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
DetailsView1.PageIndex = DropDownList1.SelectedIndex
End Sub
I am using the standard DetailsView control. The insert/ update / delete buttons are the standard with the list control. Both are on the same rendered page.
If an Item is deleted, I would like the dropdownlist to be refreshed, or and item inserted refreshed.
I read your reply to bob and sounds like what I need to do, but all my efferts are not working. I too am used to asp and having to do everthing.
Thanks for your help and could you supply an example. BTW, the reason I use two datasources is that the data source for the dropdownlist has to combine first and last name to populated the Text value, and it also grabs the record ID for the value. The datasource for the Details view does not combine anything since each item needs to be editable.
I have a dropdownlist control that is bound to a sqlDB.
I have a detailsview triggered by the onchange of the dropdowndlist. Both show on the same page. Populating the dropdownlist and triggering a record for the detailsview works great.. Problem is when I add a new record, or delete a record, I cannot get my dropdownlist to repopulated with the updated info. I used to connections to the same db because the dropdownlist combines two fields, (FirstName, Last Name as..)
The second connection for the detailsview keeps them seperate so both can be edited.
My dropdownlist is bound to a datasource called dropdownDataSource1.
The detailsview is bound to contactDataSource1.
A Details view Triggered to the onchange .. this part works great.
The codebehind:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
DetailsView1.PageIndex = DropDownList1.SelectedIndex
End Sub
I am using the standard DetailsView control. The insert/ update / delete buttons are the standard with the list control. Both are on the same rendered page.
If an Item is deleted, I would like the dropdownlist to be refreshed, or and item inserted refreshed.
I read your reply to bob and sounds like what I need to do, but all my efferts are not working. I too am used to asp and having to do everthing.
Thanks for your help and could you supply an example. BTW, the reason I use two datasources is that the data source for the dropdownlist has to combine first and last name to populated the Text value, and it also grabs the record ID for the value. The datasource for the Details view does not combine anything since each item needs to be editable.