Postback is accounted for on page_load
What's driving me nuts is I've narrowed it down to the action is being
handled, but nothing is coming out of the datagrid, see code:
Private Sub dgPatients_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
dgPatients.SelectedIndexChanged
Dim pID As String
pID = dgPatients.SelectedItem.Cells(1).Text
Response.Write(("PID=" & pID))
....
pID (yes, there is a number in the cell in the datagrid) is coming out
blank, even though I get a SelectedItem.ItemIndex in the handler.
Datagrid is as follows:
<asp:datagrid id="dgPatients" runat="server"
AutoGenerateColumns="False">
<AlternatingItemStyle
BackColor="PaleGoldenrod"></AlternatingItemStyle>
<ItemStyle BackColor="LightGoldenrodYellow"></ItemStyle>
<HeaderStyle BackColor="Tan"></HeaderStyle>
<Columns>
<asp:ButtonColumn Text="Select" ButtonType="PushButton"
CommandName="Select">
<HeaderStyle Width="60px"></HeaderStyle>
</asp:ButtonColumn>
<asp:TemplateColumn HeaderText="Patient ID">
<HeaderStyle HorizontalAlign="Center" Height="50px"
Width="85px"></HeaderStyle>
<ItemStyle Wrap="False" HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:label runat="server" Width="85px" Text='<%#
DataBinder.Eval(Container, "DataItem.patient_id") %>' >
</asp:label>
</ItemTemplate>
</asp:TemplateColumn>
....
</Columns>
Keep in mind, another webform is set up identically, as near as I can
tell, and and works.
Thought for the day: "Do programmers swear more than persons of any
other occupation?"
"Sonali.NET[MVP]" <> wrote in message news:<#>...
> Are you handling PostBack
> "Richard Adams" <> wrote in message
> news: ...
> > I've got two pages, each displaying a datagrid with a Select button
> > column.
> > With one the Select command is handled in the codebehind and works
> > fine.
> >
> > The second page is a very similar setup, but designed after upgrading
> > to Visual Studio 2003/Framework 1.1 Select evidently does something,
> > but the event handling routine in codebehind doesn't execute. I've
> > stripped away almost eveything on the form and even rebuilt the page
> > from scratch and the Select button still is not handled.
> >
> > Checked document and form properties and all are identical to the
> > first page, except meta tags (first page still refers to being created
> > in VS.NET 7.0, rather than 7.1)
> >
> > Any ideas why the inconsistent behavior? How to see what the browser
> > is attempting to send back to the server?
> >
> > I'm currently residing at No. 1 Witt's End.
> >
> > Richard
|