hi
I am having this error:
Object reference not set to an instance of an object.
This is my aspx code:
This is my Code-Behind:
Room No is not a primary key. How do I get the value of the room no when click?. Thanks
I am having this error:
Object reference not set to an instance of an object.
This is my aspx code:
| <asp:DataList ID="DataList1" runat="server" |
| DataSourceID="sdsRoomSelect" RepeatColumns="7" |
| RepeatDirection="Horizontal"> |
| <ItemTemplate> |
| <br /> |
| <p/> |
| <asp:Button ID="Button1" CommandName="select" runat="server" Text='<%# Eval("Room_No") %>' Width="50px" Height="50px" /> |
| <br /> |
| <br /> |
| </ItemTemplate> |
| </asp:DataList> |
| Protected Sub DataList1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.ItemCommand |
| If e.CommandName = "select" Then |
| Dim ddl As Button = TryCast(DataList1.FindControl("Button1"), Button) |
| Dim strValue As String = ddl.Text |
| Response.Cookies("roomno").Value = strValue |
| End If |
| End Sub |