Click here to Skip to main content
15,891,184 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionQueried result from cotroller to PartialView into Listbox Pin
sunsher28-Mar-17 2:45
sunsher28-Mar-17 2:45 
AnswerRe: Queried result from cotroller to PartialView into Listbox Pin
F-ES Sitecore28-Mar-17 6:18
professionalF-ES Sitecore28-Mar-17 6:18 
QuestionNuGet Installation of EntityFramework Pin
xiecsuk27-Mar-17 22:34
xiecsuk27-Mar-17 22:34 
AnswerRe: NuGet Installation of EntityFramework Pin
Richard Deeming28-Mar-17 1:54
mveRichard Deeming28-Mar-17 1:54 
AnswerRe: NuGet Installation of EntityFramework Pin
xiecsuk28-Mar-17 3:07
xiecsuk28-Mar-17 3:07 
Questiondynamically change css theme does not apply on all pages Pin
prog.sidra27-Mar-17 19:44
prog.sidra27-Mar-17 19:44 
AnswerRe: dynamically change css theme does not apply on all pages Pin
ZurdoDev28-Mar-17 1:19
professionalZurdoDev28-Mar-17 1:19 
QuestionData organization problem Pin
samflex27-Mar-17 11:25
samflex27-Mar-17 11:25 
Since we are creating rows dynamically, we would like to ensure that when a user creates more than one row of records for a particular form field, that the results are laid out correctly.

The following is an example of a row being created dynamically in GridView:

PHP
<asp:gridview ID="Gridview1" gridlines="None" runat="server" ShowFooter="true" AutoGenerateColumns="false" OnRowDeleting="Gridview1_RowDeleting">
            <Columns>
            <asp:BoundField DataField="RowNumber" Visible="false" HeaderText="Row Number" />
            <asp:TemplateField HeaderText="Name">
                <ItemTemplate>
                <asp:RequiredFieldValidator id="RequiredFieldValidator5" Font-Bold="true" 
                    BorderColor="Red" BorderWidth="1" SetFocusOnError="true" runat="server" 
                Height="16px" ErrorMessage="REQUIRED FIELD" ControlToValidate="txtsourcename" /><br />
                    <asp:TextBox ID="txtsourcename" placeholder="Name..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Adress">
                <ItemTemplate>
                <asp:RequiredFieldValidator id="soaddress" Font-Bold="true" 
                    BorderColor="Red" BorderWidth="1" SetFocusOnError="true" runat="server" 
                Height="16px" ErrorMessage="REQUIRED FIELD" ControlToValidate="txtsourceaddress" /><br />
                    <asp:TextBox ID="txtsourceaddress" placeholder="Address..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Income">
                <ItemTemplate>
                <asp:RequiredFieldValidator id="soincome" Font-Bold="true" 
                    BorderColor="Red" BorderWidth="1" SetFocusOnError="true" runat="server" 
                Height="16px" ErrorMessage="REQUIRED FIELD" ControlToValidate="txtsourceincome" />
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ValueToCompare="100000" ControlToValidate="txtsourceincome" ErrorMessage="Nust be greater than $100,000.00" Operator="GreaterThan" Type="Integer"></asp:CompareValidator>
                    <br />
                     <asp:TextBox ID="txtsourceincome" placeholder="Income..." runat="server" style="width:250px;" class="form-control"></asp:TextBox>
                </ItemTemplate>
                       </asp:TemplateField>
            <asp:TemplateField HeaderText=" ">
                <ItemTemplate>
                 <asp:Button ID="ButtonAdd" runat="server" Text="Add More" 
                        onclick="ButtonAdd_Click" CssClass="grvAddButton" OnClientClick="return ValidateEmptyValue();" />
                </ItemTemplate>
            </asp:TemplateField>
           <asp:CommandField ShowDeleteButton="True"><ControlStyle CssClass="grvDelButton" /></asp:CommandField>
            </Columns>
          </asp:gridview>


However, before they are submitted to the database, they are presented to the user to review his/her information before submitting to the database and code that does that is below (relevant code, I think).
If dtCurrentTable.Rows.Count > 0 Then
                '//Next collection. Spouse Information
                For Each row As DataRow In dtCurrentTable.Rows

                    Dim txtsourcen As String = TryCast(row.ItemArray(1), String)
                    Dim txtsourcea As String = TryCast(row.ItemArray(2), String)
                    Dim txtsourcei As String = TryCast(row.ItemArray(3), String)


                    lblPreviewSourceName.Text += txtsourcen & "<br />"
                    lblPreviewSourceAddress.Text += txtsourcea & "<br />"
                    lblPreviewIncomeSource.Text += txtsourcei & "<br />"


                    'get the values from the TextBoxes

                    'then add it to the collections with a comma "," as the delimited values

                    sc.Add(lblPreviewSourceName.Text + "," + lblPreviewSourceAddress.Text + "," + lblPreviewIncomeSource.Text)
                    rowIndex += 1
                Next


The issue is when we preview the data being presented, it looks like this:


Name: Ivory West
Indiana Jones

Address: 20 Ivory Street
65 Kay Dr

Income: 1000001
5820000


Is there a way to modify the codebehind I posted so data is laid out in the following format:

Name: Ivory West
Address: 20 Ivory Street
Income: 1000001

Name: Indiana Jones
Address: 65 Kay Dr
Income: 5820000


Many thanks for your help.
AnswerRe: Data organization problem Pin
Richard Deeming28-Mar-17 1:51
mveRichard Deeming28-Mar-17 1:51 
GeneralRe: Data organization problem Pin
samflex28-Mar-17 8:39
samflex28-Mar-17 8:39 
GeneralRe: Data organization problem Pin
Richard Deeming28-Mar-17 8:41
mveRichard Deeming28-Mar-17 8:41 
Question[Solved] ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209427-Mar-17 4:29
Member 1299209427-Mar-17 4:29 
AnswerRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
ZurdoDev27-Mar-17 5:50
professionalZurdoDev27-Mar-17 5:50 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209427-Mar-17 6:27
Member 1299209427-Mar-17 6:27 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
ZurdoDev27-Mar-17 7:52
professionalZurdoDev27-Mar-17 7:52 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209427-Mar-17 7:55
Member 1299209427-Mar-17 7:55 
AnswerRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
ZurdoDev27-Mar-17 7:56
professionalZurdoDev27-Mar-17 7:56 
AnswerRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
John C Rayan28-Mar-17 1:06
professionalJohn C Rayan28-Mar-17 1:06 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209428-Mar-17 4:15
Member 1299209428-Mar-17 4:15 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
John C Rayan28-Mar-17 9:27
professionalJohn C Rayan28-Mar-17 9:27 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209428-Mar-17 10:32
Member 1299209428-Mar-17 10:32 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
John C Rayan28-Mar-17 9:28
professionalJohn C Rayan28-Mar-17 9:28 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209428-Mar-17 10:34
Member 1299209428-Mar-17 10:34 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209428-Mar-17 10:37
Member 1299209428-Mar-17 10:37 
GeneralRe: ASP.NET MVC 5, IIS 10 express 404.17 error Pin
Member 1299209428-Mar-17 8:41
Member 1299209428-Mar-17 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.