Talk About Network

Google





Software > Application Center Usage > usercontrol and...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 592 of 611
Post > Topic >>

usercontrol and gridview button event not firing

by =?Utf-8?B?Z3JlYXRkYW5l?= <greatdane@[EMAIL PROTECTED] > Jan 9, 2008 at 11:54 AM

I have an .aspx that opens an .ascx when a button is pressed.
The .asx has a gridview with a button to select a row.  When the row is 
selected the .asx closes automatically and the event onrowcommand is not 
fired.
Why is  this?

This is the button in the .aspx
 Protected Sub Button2_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles Button2.Click
        ctlLookUp = CType(Page.LoadControl("Controls\UserLookUp.ascx"), 
System.Web.UI.Control)
        pnlUser.Controls.Add(ctlLookUp)

        pnlUser.Visible = True
        TxtSampler.Text = strSampler
End Sub

This is the event in the .ascx

Protected Overridable Sub ViewRow_RowCommand(ByVal sender As Object, ByVal
e 
As GridViewCommandEventArgs) Handles GridLIMS.RowCommand
        Dim index As Integer = Convert.ToInt32(e.CommandArgument)
        Dim selectedRow As GridViewRow = GridLIMS.Rows(index)
        Dim contactCell As TableCell = selectedRow.Cells(1)
        Dim contact As String = contactCell.Text
        strSampler = contact
    End Sub

This is the html in the .ascx

 <asp:GridView ID="GridLIMS" runat="server"   EnableViewState=true 
      OnRowCommand="View_RowCommand"  AutoGenerateColumns="False" >
         <FooterStyle BackColor="White" ForeColor="#000066" />
          <RowStyle ForeColor="Black" BorderStyle="Solid" />
            <PagerStyle BackColor="White" ForeColor="#000066" 
HorizontalAlign="Left" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" 
ForeColor="White" />
            <Columns>
     <asp:CommandField ButtonType="Button" ShowSelectButton="True" 
SelectText="Select" />
</Columns>
        </asp:GridView>
 




 1 Posts in Topic:
usercontrol and gridview button event not firing
=?Utf-8?B?Z3JlYXRkYW5l?=   2008-01-09 11:54:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 21:23:44 PST 2009.