The objective of this system is to click button in main page, then the modal popup will display, in modal popup got text area to paste the value from excel. after paste the value, the value will be display above the text area to do checking if the value inserted correct or not, if correct there’s submit button to direct to db.
Dim dtResult As New DataTable()
dtResult.Columns.AddRange(
New DataColumn(0) {
New DataColumn("tabd", GetType(String))})
Dim copiedContent As String = Request.Form(txtCopied.UniqueID)
For Each row As String In copiedContent.Split(ControlChars.Lf)
If Not String.IsNullOrEmpty(row) Then
dtResult.Rows.Add()
Dim i As Integer = 0
For Each cell As String In row.Split(ControlChars.Tab)
dtResult.Rows(dtResult.Rows.Count - 1)(i) = cell
i += 1
Next
End If
Next
Try
If txtCopied.Text <> "" Then
If dtResult.Rows.Count = k * 2 Then
For i = 0 To dt2.Rows.Count - 1
dt2.Rows(i)("tabd") = dtResult.Rows(i)("tabd")
Next
APIModule.SendEventDISC(dt2, iGID, strCassID, strEquipType, strKittingCode, strOperation, strSampleType, strShift, strSampleDate, strCandela)
Else
lblMessage.Text = "Key in wrong result qty"
txtCopied.Text = ""
Exit Sub
End If
'To refresh the grid by calling search button function
SearchData()
txtCopied.Text = ""
Else
End If
<asp:Panel ID="pnlEdit" runat="server" CssClass="modalPopup" Style="text-align:center">
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:BoundField DataField="tabd" HeaderText="Tabd Result" ItemStyle-Width="30" />
</Columns>
</asp:GridView>
<asp:TextBox ID="txtCopied" runat="server" TextMode="MultiLine" AutoPostBack="true"
Height="200px" Width="507px" />
<br />
<asp:Button ID="btnProcess" runat="server" Text="Process" OnClick="PasteToGridView" />
<asp:Button ID="btnClose" runat="server" Text="Close" />
</asp:Panel>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtCopied" />
</Triggers>
i refer to this sample code, but i quite confuse..please help