Converted this code from C but having a problem. probably something really stupid.
The Error I am getting is
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
Line 138:
Line 139: Dim String1 = arg(0)
Line 140: Dim String2 = arg(1)
Line 141:
I first thought it might be a null or empty value, but I don't think that's the case
Here is the code
Expand|Select|Wrap|Line Numbers
- <asp:LinkButton ID="LinkButtonWebsiteURL" runat="server" Text='<%# Container.DataItem("CompanyWebsiteName")%>' CommandName="WebsiteClick" OnCommand="Btn_WebClick" CommandArgument='<%#Eval("UserAccountsID") + ";" +Eval("CompanyWebsiteURL")%>'/>
- Protected Sub Btn_WebClick(ByVal sender As Object, ByVal e As CommandEventArgs)
- Dim commandArgs As LinkButton = CType(sender, LinkButton)
- Dim info As String = commandArgs.CommandArgument
- Dim arg() As String = New String(2) {}
- Dim splitter() As Char = {";"c}
- arg = info.Split(splitter)
- Dim String1 = arg(0)
- Dim String2 = arg(1)
- Response.Write("Worked: " & String1 & " " & String2)
- End