G
Guest
I am using a datalist control (dlist_myfavorites) and this control is bound
to a sqldatareader source. Datalist is basicly populated by the following sp.
CREATE PROCEDURE [select_favorites_bymguid]
(
@mguid as nvarchar(50) -- member guid id
)
AS
SELECT
cat.acname 'category',
adds.aid 'refno',
adds.miname 'image',
adds.teaseline1 'tl1',
adds.teaseline2 'tl2',
adds.teaseline3 'tl3',
adds.displayguid 'displayguid',
fav.entrydate 'entrydate',
adds.aguid 'aguid'
FROM tbl_adds_whole adds join tbl_member_favorites fav
ON(fav.aguid= adds.aguid) join tbl_add_categories cat
ON(adds.category=cat.acid)
WHERE fav.mguid = @mguid and cat.aclanguage =1
I have a hidden label inside the datalist that hold "aguid" data as below:
<asp:label id="aguid" visible=false runat=server><%#
databinder.eval(container.dataitem, "aguid") %></asp:label>
I am using a check box control with "delete" id in my datalist control, in
order to find out which items will be deleted. Once the user clicks on a
"btn_delete_selected" button process the following code:
Private Sub btn_delete_selected_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn_delete_selected.Click
Dim isdeleted As Boolean
Dim anitem As DataListItem
Dim mguid As String = context.User.Identity.Name
Dim aguid As String
Dim mymf As memberfunctions = New memberfunctions
For Each anitem In dlist_myfavorites.Items
isdeleted = CType(anitem.FindControl("delete"), CheckBox).Checked
If isdeleted Then
aguid = CType(anitem.FindControl("aguid"), Label).Text
mymf.delete_tbl_member_favorites(aguid, mguid)
End If
Next
End Sub
The problem is aguid in the above sub always returns "" value eventhough I
have some rows selected on the page. On the other hand isdeleted variable
always returns right values either true or false. What am I doing wrong here?
Thank you in advance.
to a sqldatareader source. Datalist is basicly populated by the following sp.
CREATE PROCEDURE [select_favorites_bymguid]
(
@mguid as nvarchar(50) -- member guid id
)
AS
SELECT
cat.acname 'category',
adds.aid 'refno',
adds.miname 'image',
adds.teaseline1 'tl1',
adds.teaseline2 'tl2',
adds.teaseline3 'tl3',
adds.displayguid 'displayguid',
fav.entrydate 'entrydate',
adds.aguid 'aguid'
FROM tbl_adds_whole adds join tbl_member_favorites fav
ON(fav.aguid= adds.aguid) join tbl_add_categories cat
ON(adds.category=cat.acid)
WHERE fav.mguid = @mguid and cat.aclanguage =1
I have a hidden label inside the datalist that hold "aguid" data as below:
<asp:label id="aguid" visible=false runat=server><%#
databinder.eval(container.dataitem, "aguid") %></asp:label>
I am using a check box control with "delete" id in my datalist control, in
order to find out which items will be deleted. Once the user clicks on a
"btn_delete_selected" button process the following code:
Private Sub btn_delete_selected_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn_delete_selected.Click
Dim isdeleted As Boolean
Dim anitem As DataListItem
Dim mguid As String = context.User.Identity.Name
Dim aguid As String
Dim mymf As memberfunctions = New memberfunctions
For Each anitem In dlist_myfavorites.Items
isdeleted = CType(anitem.FindControl("delete"), CheckBox).Checked
If isdeleted Then
aguid = CType(anitem.FindControl("aguid"), Label).Text
mymf.delete_tbl_member_favorites(aguid, mguid)
End If
Next
End Sub
The problem is aguid in the above sub always returns "" value eventhough I
have some rows selected on the page. On the other hand isdeleted variable
always returns right values either true or false. What am I doing wrong here?
Thank you in advance.