Hi,
I want to make a link to my "deleteBlogBlog(ByVal blogID as String)" function from each asp:linkbutton in my repeater. Unfortunately this doesn't seem to work. I can make it call sub procedures but not functions with parameters.
This is my code:
MyBlogs.aspx
MyBlogs.aspx.vb
At this point i can't even call deleteBlog(2) with a set parameter. If anyone could help me on this one it would be greatly appreciated.
-Mark
I want to make a link to my "deleteBlogBlog(ByVal blogID as String)" function from each asp:linkbutton in my repeater. Unfortunately this doesn't seem to work. I can make it call sub procedures but not functions with parameters.
This is my code:
MyBlogs.aspx
VB.NET:
<asp:Repeater ID="rptMyBlogs" runat="server">
<ItemTemplate>
<b>DataBinder.Eval(Container.DataItem, "title")</b>
[B]<asp:LinkButton ID="deleteBlog" runat="server" Text="delete"
OnClientClick="return confirm('Are you sure you want to delete record?');"
OnClick='<%# deleteBlog(Cstr(DataBinder.Eval(Container.DataItem, "blogID")) %>' />[/B]
<br />
</ItemTemplate>
</asp:Repeater>
VB.NET:
Partial Class MyBlogs
Protected Sub deleteBlog(ByVal blogID As String)
Dim dbConn As New DbConnection
Dim parameters As IList(Of DbParameter) = New List(Of DbParameter)
parameters.Add(New DbParameter("BlogID", blogID.ToString))
dbConn.ExecuteNonQueryOnStoredProcudure("sp_DeleteBlog", parameters)
End Sub
End Class
At this point i can't even call deleteBlog(2) with a set parameter. If anyone could help me on this one it would be greatly appreciated.
-Mark