I have a asp.net page titled EstMaterials.aspx with a gridview that fills from a SQL table based on a parameter passed to it. The code for calling the form is below.
<asp:UpdatePanel ID="upAddMaterials" runat="server">
<ContentTemplate>
<div id="AddMaterials" style="text-align:center">
<asp:Button ID="btnDecoy" runat="server" Text="Decoy" style="display:none" />
<asp:LinkButton ID="lbAddMaterials" runat="server" Text="Add Materials"></asp:LinkButton>
<asp:ModalPopupExtender ID="mdeAddMaterials" runat="server"
TargetControlID="btnDecoy" PopupControlID="pnAddMaterials"
BackgroundCssClass="modalBackground"></asp:ModalPopupExtender>
<br />
<asp:Label ID="lblAddMaterials" runat="server" Text="Selected Materials" style="text-align:center"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnAddMaterials" runat="server" CssClass="modalPopup">
<iframe id="frmAddMaterials" src="EstMaterials.aspx" height="600px" width="500px"></iframe>
<asp:Button ID="btnMaterialsOkay" runat="server" Text="Okay" />
<asp:Button ID="btnMaterialsCancel" runat="server" Text="Cancel" />
</asp:Panel>
I have an a button field set as a link in a gridview. When the user clicks on the link it should open the "EstMaterials.aspx" page with a gridview listing the materials required for this job. If I do not have a parameter i.e, ScheduleWeek.oJob.JobSeqNbr, the gridview fills fine. However, with the parameter listed the gridview does not fill. It appears the form opens without ever looking at the parameter being passed.
The page load event is below.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If Not IsNothing(ScheduleWeek.oJob) Then
Dim tbl As New DataTable
tbl = tblMaterials.SiteMaterials(ScheduleWeek.oJob.JobSeqNbr)
gvMaterials.DataSource = tbl
gvMaterials.DataBind()
End If
End If
End Sub
What do i need to correct?