Hello Michael,
Could you help me out on this little problem…
I created a spinoff from your linq to sql tutorial for dnn. I developed a View page with 4 controls; LinqDataSource1, GridView1, LinqDataSource2, and formView1. Nothing special, just a typical Linq to Sql, using formView1 for Insert and Edit. The Select Button from the Command Field on the GridView1 to pass the selected value to formView1 to Edit (Where="ItemID == @ItemID" GridView1.SelctedValue). Protected Sub GridView1_SelectedIndexChanged… enabled formView1.ChangeMode(formViewMode.Edit) for editing. Sweet…pretty simple…works great.
Well it did, until I decieded to develop the Edit.ascx page and moved LinqDataSouce2 and formView1 to the Edit.ascx. The Response.Redirect… works fine… I just can’t figure out how to pass the “GridView1.SelctedValue” ItemID from View.ascx to Edit.ascx and into LinqDataSource2/formView1 in the Edit.ascx page.
So, my questions are…
1) Can you tell me how to write the code for the “GridView1_SelectedIndexChanged Sub” in View.ascx.vb to pass the Selected ItemID from GridView1?
2) How do I write the code for the “Page_Load Sub” in Edit.ascx.vb to pass the Selected GridView1 ItemID into LinqDataSource2/formView1 for editing?
===============================================
Partial Public Class View
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Implements Entities.Modules.IActionable
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
‘Just can’t get anything to work…
End Sub
=================================================
Partial Class Edit
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Private itemID As Integer = -1
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim objModules As New Entities.Modules.ModuleController
If Not (Request.QueryString("ItemId") Is Nothing) Then
itemID = Int32.Parse(Request.QueryString("ItemId"))
End If
formView1.ChangeMode(formViewMode.Edit)
formView1.DataBind()
End Sub
=====================================================
Thanks,
Steve
If Not something Is Nothing Then doSomething Else doNothing End IF