VB.net add textbox values together to get total

Hi Guys

Im using visual studio 2005 vb.net. sql express, im a newbie and im basically trying to create a customer calculator. 

Ive got this code, basically i want to add the integer values of each of my text boxes together and then display them in a textbox called textbox1.  I think i have the code write to do the calculation but im stuck on how to get it to display the total in the textbox once ive hit the calculate button, ive tried several ways, the page posts back, i get no errors but nothing in textbox1 too

can you take a look and help me out please.

Thanks and Kind Regards

 

1    <%@ Page Langua 
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<script runat="server">
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        dim greetingtotal as integer
        Dim problemtotal As Integer
        Dim communicatingtotal As Integer
        Dim customertotal As Integer
        Dim businesstotal As Integer
        Dim closuretotal As Integer
        Dim total As Integer
        Dim TextBox1 As TextBox = CType(detailsview1.FindControl("TextBox1"), TextBox)
        
        greetingtotal = Convert.ToInt32(CType(detailsview1.FindControl("greetingtotal"), TextBox).Text)
        problemtotal = Convert.ToInt32(CType(detailsview1.FindControl("problemtotal"), TextBox).Text)
        communicatingtotal = Convert.ToInt32(CType(detailsview1.FindControl("communicatingtotal"), TextBox).Text)
        customertotal = Convert.ToInt32(CType(detailsview1.FindControl("customertotal"), TextBox).Text)
        businesstotal = Convert.ToInt32(CType(detailsview1.FindControl("businesstotal"), TextBox).Text)
        closuretotal = Convert.ToInt32(CType(detailsview1.FindControl("closuretotal"), TextBox).Text)
        total = greetingtotal + communicatingtotal + businesstotal + closuretotal
        TextBox1.Text = total
           
    End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table border="0" cellpadding="0" cellspacing="0" style="vertical-align: middle;
        width: 700px; text-align: center">
        <tr>
            <td align="center" style="height: 400px" valign="middle">
                <asp:DetailsView ID="detailsview1" runat="server" AutoGenerateRows="False" CssClass="calculator"
                    DataKeyNames="id" DataSourceID="getCurrentSalesSupportScore" GridLines="None" DefaultMode="edit">
                    <Fields>
                        <asp:TemplateField HeaderText="Create Profile">
                            <HeaderTemplate>
                                &nbsp;
                            </HeaderTemplate>
                            <EditItemTemplate><table style="width: 550px">
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Greeting:</td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="greetingtxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
                                            ReadOnly="True" Text='<%# Bind("greetingScore") %>'></asp:TextBox></td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="greetingScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="greetingScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Greeting Score field"
                                            ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="greetingScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                            ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="textbox1" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                            Text='<%# Bind("greetingScore", "{0:N}") %>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Problem Solving &amp; Decision Making:</td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="probsolvetxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
                                            ReadOnly="True" Text='<%# Bind("problemAndDecisionScore") %>'></asp:TextBox></td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="problemsolvingScoreInput" runat="server" CssClass="textboxstyle"
                                            MaxLength="1"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="problemsolvingScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Problem Solving & Decision Making Score field"
                                            ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="problemsolvingScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                            ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="TextBox2" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                            Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Communicating &amp; Influencing:</td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="communicatetxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                            ReadOnly="True" Text='<%# Bind("communicateAndInfluenceScore") %>'></asp:TextBox></td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="communicatingScoreInput" runat="server" CssClass="textboxstyle"
                                            MaxLength="1"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="communicatingScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Communicating & Influencing Score field"
                                            ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="communicatingScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                            ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="TextBox3" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                            Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Customer Focus:</td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="customerfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                            ReadOnly="True" Text='<%# Bind("customerFocusScore") %>'></asp:TextBox></td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="customerfocusScoreInput" runat="server" CssClass="textboxstyle"
                                            MaxLength="1"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="customerfocusScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Customer Focus Score field"
                                            ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="customerfocusScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                            ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="TextBox4" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                            Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Business Focus</td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="businessfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                            ReadOnly="True" Text='<%# Bind("businessFocusScore") %>'></asp:TextBox></td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="businessfocusScoreInput" runat="server" CssClass="textboxstyle"
                                            MaxLength="1"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="businessfocusScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Business Focus Score field"
                                            ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator5" runat="server" ControlToValidate="businessfocustxtbox"
                                            CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                            ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="TextBox5" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                            Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Closure:</td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="closuretxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                            ReadOnly="True" Text='<%# Bind("closureScore") %>'></asp:TextBox></td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        <asp:TextBox ID="closureScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="closureScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Closure Score field"
                                            ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator6" runat="server" ControlToValidate="closureScoreInput"
                                            CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                            ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="TextBox6" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                            Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" style="width: 350px; height: 30px">
                                    </td>
                                    <td align="center" style="width: 350px; height: 30px">
                                    </td>
                                    <td align="center" style="width: 350px; height: 30px">
                                        Total:</td>
                                    <td align="center" style="width: 150px; height: 30px">
                                        <asp:TextBox ID="TextBox20020" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="4" style="height: 30px">
                                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="errorMsgstyle"
                                                ForeColor="" />
                                        <br />
                                        <asp:Button ID="Button1" runat="server" CssClass="buttonstyle" Text="Button" /></td>
                                </tr>
                            </table>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <table style="width: 550px">
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Greeting:</td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="greetingtxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
                                                ReadOnly="True" Text='<%# Bind("greetingScore") %>'></asp:TextBox></td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="greetingScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="greetingScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Greeting Score field"
                                                ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="greetingScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                                ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="greetingtotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                                Text='<%# Bind("greetingScore", "{0:N}") %>'></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Problem Solving &amp; Decision Making:</td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="probsolvetxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
                                                ReadOnly="True" Text='<%# Bind("problemAndDecisionScore") %>'></asp:TextBox></td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="problemsolvingScoreInput" runat="server" CssClass="textboxstyle"
                                                MaxLength="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="problemsolvingScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Problem Solving & Decision Making Score field"
                                                ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="problemsolvingScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                                ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="problemtotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                                Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Communicating &amp; Influencing:</td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="communicatetxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                                ReadOnly="True" Text='<%# Bind("communicateAndInfluenceScore") %>'></asp:TextBox></td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="communicatingScoreInput" runat="server" CssClass="textboxstyle"
                                                MaxLength="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="communicatingScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Communicating & Influencing Score field"
                                                ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="communicatingScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                                ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="communicatingtotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                                Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Customer Focus:</td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="customerfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                                ReadOnly="True" Text='<%# Bind("customerFocusScore") %>'></asp:TextBox></td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="customerfocusScoreInput" runat="server" CssClass="textboxstyle"
                                                MaxLength="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="customerfocusScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Customer Focus Score field"
                                                ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="customerfocusScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                                ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="customertotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                                Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Business Focus</td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="businessfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                                ReadOnly="True" Text='<%# Bind("businessFocusScore") %>'></asp:TextBox></td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="businessfocusScoreInput" runat="server" CssClass="textboxstyle"
                                                MaxLength="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="businessfocusScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Business Focus Score field"
                                                ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="RangeValidator5" runat="server" ControlToValidate="businessfocustxtbox"
                                                CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                                ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="businesstotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                                Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Closure:</td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="closuretxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
                                                ReadOnly="True" Text='<%# Bind("closureScore") %>'></asp:TextBox></td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            <asp:TextBox ID="closureScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="closureScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="You must enter a value in the Closure Score field"
                                                ForeColor="" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            <asp:RangeValidator ID="RangeValidator6" runat="server" ControlToValidate="closureScoreInput"
                                                CssClass="errorMsgstyle" ErrorMessage="Only a number between 0 & 9 is allowed"
                                                ForeColor="" MaximumValue="9" MinimumValue="0" SetFocusOnError="True" Type="Integer">*</asp:RangeValidator></td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="closuretotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"
                                                Text='<%# Bind("problemAndDecisionScore", "{0:N}") %>'></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="width: 350px; height: 30px">
                                        </td>
                                        <td align="center" style="width: 350px; height: 30px">
                                        </td>
                                        <td align="center" style="width: 350px; height: 30px">
                                            Total:</td>
                                        <td align="center" style="width: 150px; height: 30px">
                                            <asp:TextBox ID="textbox1" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True" OnDataBinding="Button1_Click"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="4" style="height: 30px">
                                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="errorMsgstyle"
                                                ForeColor="" />
                                            <br />
                                            <asp:Button ID="Button1" runat="server" CssClass="buttonstyle" Text="Calculate" OnClick="Button1_Click" /></td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <EditItemTemplate>
                                &nbsp;
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="True" CommandName="Insert"
                                    Text="Insert"></asp:LinkButton>
                                <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="Cancel"></asp:LinkButton>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                &nbsp;
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Fields>
                </asp:DetailsView>
                <asp:SqlDataSource ID="getCurrentSalesSupportScore" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT [id], [problemAndDecisionScore], [greetingScore], [communicateAndInfluenceScore], [customerFocusScore], [businessFocusScore], [closureScore], [isCurrent] FROM [salesSupportScoringTable] WHERE ([isCurrent] > @isCurrent)">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="0" Name="isCurrent" Type="Int16" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</td>
        </tr>
        <tr>
            <td style="width: 100px">
                &nbsp; &nbsp;&nbsp;
            </td>
        </tr>
    </table>
</asp:Content>


No one said it was gonna be easy, then again, nothing worth doing ever is.
1
teddymeu4u
2/18/2008 8:21:17 PM
asp.net.web-forms 93655 articles. 3 followers. Follow

4 Replies
981 Views

Similar Articles

[PageSpeed] 23

Hi,

First you need to convert your total to a string in order to feed the text property of your TextBox1. Do this: TextBox1.Text = Convert.ToString(total)

Then remove the binding in your asp:TextBox text property : Text='<%# Bind("greetingScore", "{0:N}") %>' should be Text=""

 

Let me know if it works.




Don't forget to click "Mark as Answer" on the post that helped you.
-1
amensi
2/18/2008 9:06:33 PM

 Have you tried and debug it if the TexBoxes returns any value? Anyway try

Dim tb As TextBox1 = DirectCast(DetailsView1.Rows(0).Cells(0).FindControl("TextBox1"), TextBox)  ' try to specify the index or rows and cells to where you textbox was reside

communicatingtotal = Convert.ToInt32(DirectCast(DetailsView1.Rows(0).Cells(1).FindControl"communicatingtotal"), TextBox).Text)
businesstotal = Convert.ToInt32(DirectCast(DetailsView1.Rows(0).Cells(1).FindControl("businesstotal"), TextBox).Text)
closuretotal = Convert.ToInt32(DirectCast(DetailsView1.Rows(0).Cells(1).FindControl("closuretotal"), TextBox).Text)
Dim Total As Integer
Total =  communicatingtotal + businesstotal + closuretotal 
tb.Text = Total.ToString()
Since you wanted to displat the Total in a TextBox then you need to parse it to a String since its an integer type 

 

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/18/2008 9:30:58 PM

Hi Alex


Thanks for your help, i now have the following code, your were right, i copied the text boxes and had them bound which was a mistake first off, and thanks to you i now have the calculator semi working.  Basically as you will see from my code each time a value is entered into a text box it takes the value of the corresponding bound textbox, multiplies it and displays in the corresponding total field, however i now need to total up all the total fields and get a grand total when i click the calculate button, however this is still not working even though the rest is 

Your help would be greatly appreciated

1    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
2    <script runat="server">
3        Protected Sub greetingScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
4            Dim greetingScoreInput As Integer
5            Dim greetingtxtbx As Integer
6            Dim total As Integer
7            Dim greetingtotal As TextBox = CType(detailsview1.FindControl("greetingtotal"), TextBox)
8            greetingScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("greetingScoreInput"), TextBox).Text)
9            greetingtxtbx = Convert.ToInt16(CType(detailsview1.FindControl("greetingtxtbx"), TextBox).Text)
10           total = Integer.Parse(greetingtxtbx) * Integer.Parse(greetingScoreInput)
11           greetingtotal.Text = Convert.ToString(total)
12       End Sub
13       Protected Sub problemsolvingScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
14           Dim problemsolvingScoreInput As Integer
15           Dim probsolvetxtbx As Integer
16           Dim total As Integer
17           Dim problemtotal As TextBox = CType(detailsview1.FindControl("problemtotal"), TextBox)
18           problemsolvingScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("problemsolvingScoreInput"), TextBox).Text)
19           probsolvetxtbx = Convert.ToInt16(CType(detailsview1.FindControl("probsolvetxtbx"), TextBox).Text)
20           total = Integer.Parse(probsolvetxtbx) * Integer.Parse(problemsolvingScoreInput)
21           problemtotal.Text = Convert.ToString(total)
22       End Sub
23       Protected Sub communicatingScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
24           Dim communicatingScoreInput As Integer
25           Dim communicatetxtbox As Integer
26           Dim total As Integer
27           Dim communicatingtotal As TextBox = CType(detailsview1.FindControl("communicatingtotal"), TextBox)
28           communicatingScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("communicatingScoreInput"), TextBox).Text)
29           communicatetxtbox = Convert.ToInt16(CType(detailsview1.FindControl("communicatetxtbox"), TextBox).Text)
30           total = Integer.Parse(communicatetxtbox) * Integer.Parse(communicatingScoreInput)
31           communicatingtotal.Text = Convert.ToString(total)
32       End Sub
33       Protected Sub customerfocusScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
34           Dim customerfocusScoreInput As Integer
35           Dim customerfocustxtbox As Integer
36           Dim total As Integer
37           Dim customertotal As TextBox = CType(detailsview1.FindControl("customertotal"), TextBox)
38           customerfocusScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("customerfocusScoreInput"), TextBox).Text)
39           customerfocustxtbox = Convert.ToInt16(CType(detailsview1.FindControl("communicatetxtbox"), TextBox).Text)
40           total = Integer.Parse(customerfocustxtbox) * Integer.Parse(customerfocusScoreInput)
41           customertotal.Text = Convert.ToString(total)
42       End Sub
43       Protected Sub closureScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
44           Dim closureScoreInput As Integer
45           Dim closuretxtbox As Integer
46           Dim total As Integer
47           Dim closuretotal As TextBox = CType(detailsview1.FindControl("closuretotal"), TextBox)
48           closureScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("closureScoreInput"), TextBox).Text)
49           closuretxtbox = Convert.ToInt16(CType(detailsview1.FindControl("closuretxtbox"), TextBox).Text)
50           total = Integer.Parse(closuretxtbox) * Integer.Parse(closureScoreInput)
51           closuretotal.Text = Convert.ToString(total)
52       End Sub
53       Protected Sub businessfocusScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
54           Dim businessfocusScoreInput As Integer
55           Dim businessfocustxtbox As Integer
56           Dim total As Integer
57           Dim businesstotal As TextBox = CType(detailsview1.FindControl("businesstotal"), TextBox)
58           businessfocusScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("businessfocusScoreInput"), TextBox).Text)
59           businessfocustxtbox = Convert.ToInt16(CType(detailsview1.FindControl("businessfocustxtbox"), TextBox).Text)
60           total = Integer.Parse(businessfocustxtbox) * Integer.Parse(businessfocusScoreInput)
61           businesstotal.Text = Convert.ToString(total)
62       End Sub
63       Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
64           Dim greetingtotal As Integer
65           Dim problemtotal As Integer
66           Dim communicatingtotal As Integer
67           Dim customertotal As Integer
68           Dim businesstotal As Integer
69           Dim closuretotal As Integer
70           Dim total As Integer
71           Dim TextBox1 As TextBox = CType(detailsview1.FindControl("TextBox1"), TextBox)
72           
73           greetingtotal = Convert.ToInt16(CType(detailsview1.FindControl("greetingtotal"), TextBox).Text)
74           problemtotal = Convert.ToInt16(CType(detailsview1.FindControl("problemtotal"), TextBox).Text)
75           communicatingtotal = Convert.ToInt16(CType(detailsview1.FindControl("communicatingtotal"), TextBox).Text)
76           customertotal = Convert.ToInt16(CType(detailsview1.FindControl("customertotal"), TextBox).Text)
77           businesstotal = Convert.ToInt16(CType(detailsview1.FindControl("businesstotal"), TextBox).Text)
78           closuretotal = Convert.ToInt16(CType(detailsview1.FindControl("closuretotal"), TextBox).Text)
79           total = Integer.Parse(greetingtotal) + Integer.Parse(customertotal) + Integer.Parse(problemtotal) + Integer.Parse(communicatingtotal) + Integer.Parse(businesstotal) + Integer.Parse(closuretotal)
80           TextBox1.Text = Convert.ToString(total)
81              
82       End Sub
83   </script>
84   <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
85       <table border="0" cellpadding="0" cellspacing="0" style="vertical-align: middle;
86           width: 700px; text-align: center">
87           <tr>
88               <td align="center" style="height: 400px" valign="middle">
89                   <asp:DetailsView ID="detailsview1" runat="server" AutoGenerateRows="False" CssClass="calculator"
90                       DataKeyNames="id" DataSourceID="getCurrentSalesSupportScore" GridLines="None" DefaultMode="edit">
91                       <Fields>
92                           <asp:TemplateField HeaderText="Create Profile">
93                               <HeaderTemplate>
94                                   &nbsp;
95                               </HeaderTemplate>
96                               <EditItemTemplate><table style="width: 550px">
97                                   <tr>
98                                       <td align="center" style="width: 350px; height: 30px">
99                                           Greeting:</td>
100                                      <td align="center" style="width: 350px; height: 30px">
101                                          <asp:TextBox ID="greetingtxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
102                                              ReadOnly="True" Text='<%# Bind("greetingScore") %>'></asp:TextBox></td>
103                                      <td align="center" style="width: 350px; height: 30px">
104                                          <asp:TextBox ID="greetingScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1" OnTextChanged="greetingScoreInput_TextChanged" AutoPostBack="True"></asp:TextBox>&nbsp;
105                                      </td>
106                                      <td align="center" style="width: 150px; height: 30px">
107                                          <asp:TextBox ID="greetingtotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"></asp:TextBox></td>
108                                  </tr>
109                                  <tr>
110                                      <td align="center" style="width: 350px; height: 30px">
111                                          Problem Solving &amp; Decision Making:</td>
112                                      <td align="center" style="width: 350px; height: 30px">
113                                          <asp:TextBox ID="probsolvetxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
114                                              ReadOnly="True" Text='<%# Bind("problemAndDecisionScore") %>'></asp:TextBox></td>
115                                      <td align="center" style="width: 350px; height: 30px">
116                                          <asp:TextBox ID="problemsolvingScoreInput" runat="server" CssClass="textboxstyle"
117                                              MaxLength="1" AutoPostBack="True" OnTextChanged="problemsolvingScoreInput_TextChanged"></asp:TextBox>&nbsp;
118                                      </td>
119                                      <td align="center" style="width: 150px; height: 30px">
120                                          <asp:TextBox ID="problemtotal" runat="server" CssClass="textboxstyle" MaxLength="2" AutoPostBack="True"></asp:TextBox></td>
121                                  </tr>
122                                  <tr>
123                                      <td align="center" style="width: 350px; height: 30px">
124                                          Communicating &amp; Influencing:</td>
125                                      <td align="center" style="width: 350px; height: 30px">
126                                          <asp:TextBox ID="communicatetxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
127                                              ReadOnly="True" Text='<%# Bind("communicateAndInfluenceScore") %>'></asp:TextBox></td>
128                                      <td align="center" style="width: 350px; height: 30px">
129                                          <asp:TextBox ID="communicatingScoreInput" runat="server" CssClass="textboxstyle"
130                                              MaxLength="1" AutoPostBack="True" OnTextChanged="communicatingScoreInput_TextChanged"></asp:TextBox>&nbsp;
131                                      </td>
132                                      <td align="center" style="width: 150px; height: 30px">
133                                          <asp:TextBox ID="communicatingtotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"></asp:TextBox></td>
134                                  </tr>
135                                  <tr>
136                                      <td align="center" style="width: 350px; height: 30px">
137                                          Customer Focus:</td>
138                                      <td align="center" style="width: 350px; height: 30px">
139                                          <asp:TextBox ID="customerfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
140                                              ReadOnly="True" Text='<%# Bind("customerFocusScore") %>'></asp:TextBox></td>
141                                      <td align="center" style="width: 350px; height: 30px">
142                                          <asp:TextBox ID="customerfocusScoreInput" runat="server" CssClass="textboxstyle"
143                                              MaxLength="1" AutoPostBack="True" OnTextChanged="customerfocusScoreInput_TextChanged"></asp:TextBox>&nbsp;
144                                      </td>
145                                      <td align="center" style="width: 150px; height: 30px">
146                                          <asp:TextBox ID="customertotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"></asp:TextBox></td>
147                                  </tr>
148                                  <tr>
149                                      <td align="center" style="width: 350px; height: 30px">
150                                          Business Focus</td>
151                                      <td align="center" style="width: 350px; height: 30px">
152                                          <asp:TextBox ID="businessfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
153                                              ReadOnly="True" Text='<%# Bind("businessFocusScore") %>'></asp:TextBox></td>
154                                      <td align="center" style="width: 350px; height: 30px">
155                                          <asp:TextBox ID="businessfocusScoreInput" runat="server" CssClass="textboxstyle"
156                                              MaxLength="1" AutoPostBack="True" OnTextChanged="businessfocusScoreInput_TextChanged"></asp:TextBox>&nbsp;
157                                      </td>
158                                      <td align="center" style="width: 150px; height: 30px">
159                                          <asp:TextBox ID="businesstotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"></asp:TextBox></td>
160                                  </tr>
161                                  <tr>
162                                      <td align="center" style="width: 350px; height: 30px">
163                                          Closure:</td>
164                                      <td align="center" style="width: 350px; height: 30px">
165                                          <asp:TextBox ID="closuretxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
166                                              ReadOnly="True" Text='<%# Bind("closureScore") %>'></asp:TextBox></td>
167                                      <td align="center" style="width: 350px; height: 30px">
168                                          <asp:TextBox ID="closureScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1" AutoPostBack="True" OnTextChanged="closureScoreInput_TextChanged"></asp:TextBox>&nbsp;
169                                      </td>
170                                      <td align="center" style="width: 150px; height: 30px">
171                                          <asp:TextBox ID="closuretotal" runat="server" CssClass="textboxstyle" MaxLength="2" ReadOnly="True"></asp:TextBox></td>
172                                  </tr>
173                                  <tr>
174                                      <td align="center" style="width: 350px; height: 30px">
175                                      </td>
176                                      <td align="center" style="width: 350px; height: 30px">
177                                      </td>
178                                      <td align="center" style="width: 350px; height: 30px">
179                                          Total:</td>
180                                      <td align="center" style="width: 150px; height: 30px">
181                                          <asp:TextBox ID="textbox1" runat="server" CssClass="textboxstyle" MaxLength="2"></asp:TextBox></td>
182                                  </tr>
183                                  <tr>
184                                      <td align="center" colspan="4" style="height: 30px">
185                                          <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="errorMsgstyle"
186                                                  ForeColor="" />
187                                          <br />
188                                          <asp:Button ID="Button1" runat="server" CssClass="buttonstyle" Text="Button" /></td>
189                                  </tr>
190                              </table>
191                              </EditItemTemplate>
192                          </asp:TemplateField>
193                          <asp:TemplateField ShowHeader="False">
194                              <EditItemTemplate>
195                                  &nbsp;
196                              </EditItemTemplate>
197                              <InsertItemTemplate>
198                                  <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="True" CommandName="Insert"
199                                      Text="Insert"></asp:LinkButton>
200                                  <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
201                                      Text="Cancel"></asp:LinkButton>
202                              </InsertItemTemplate>
203                              <ItemTemplate>
204                                  &nbsp;
205                              </ItemTemplate>
206                          </asp:TemplateField>
207                      </Fields>
208                  </asp:DetailsView>
209                  <asp:SqlDataSource ID="getCurrentSalesSupportScore" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
210                      SelectCommand="SELECT [id], [problemAndDecisionScore], [greetingScore], [communicateAndInfluenceScore], [customerFocusScore], [businessFocusScore], [closureScore], [isCurrent] FROM [salesSupportScoringTable] WHERE ([isCurrent] > @isCurrent)">
211                      <SelectParameters>
212                          <asp:Parameter DefaultValue="0" Name="isCurrent" Type="Int16" />
213                      </SelectParameters>
214                  </asp:SqlDataSource>
215                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
216                  &nbsp; &nbsp; &nbsp; &nbsp;
217                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</td>
218          </tr>
219          <tr>
220              <td style="width: 100px">
221                  &nbsp; &nbsp;&nbsp;
222              </td>
223          </tr>
224      </table>
225  </asp:Content>
226  
227  
 
No one said it was gonna be easy, then again, nothing worth doing ever is.
1
teddymeu4u
2/18/2008 10:19:24 PM

Hi all, ive figured out why my last function wasnt working, the button was just posting back the page, somehome the assignment of the code to the onclick got lost, anyway thanks to everyone who helped and incase another newbie like me needs it here my code, basically its pulling values from my db table into one set ox textboxes, it then allows input into the second set of textboxes and upon the text changed action, uses this input to multiply the value of the first textbox with your input into the respective second text box to then display the total in the third text box.

On click it adds all totals into a grand total score, maybe this will help another newbie like me oneday

All the best  

1    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
2    <script runat="server">
3        Protected Sub greetingScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
4            Dim greetingScoreInput As Integer
5            Dim greetingtxtbx As Integer
6            Dim total As Integer
7            Dim greetingtotal As TextBox = CType(detailsview1.FindControl("greetingtotal"), TextBox)
8            greetingScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("greetingScoreInput"), TextBox).Text)
9            greetingtxtbx = Convert.ToInt16(CType(detailsview1.FindControl("greetingtxtbx"), TextBox).Text)
10           total = Integer.Parse(greetingtxtbx) * Integer.Parse(greetingScoreInput)
11           greetingtotal.Text = Convert.ToString(total)
12       End Sub
13       Protected Sub problemsolvingScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
14           Dim problemsolvingScoreInput As Integer
15           Dim probsolvetxtbx As Integer
16           Dim total As Integer
17           Dim problemtotal As TextBox = CType(detailsview1.FindControl("problemtotal"), TextBox)
18           problemsolvingScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("problemsolvingScoreInput"), TextBox).Text)
19           probsolvetxtbx = Convert.ToInt16(CType(detailsview1.FindControl("probsolvetxtbx"), TextBox).Text)
20           total = Integer.Parse(probsolvetxtbx) * Integer.Parse(problemsolvingScoreInput)
21           problemtotal.Text = Convert.ToString(total)
22       End Sub
23       Protected Sub communicatingScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
24           Dim communicatingScoreInput As Integer
25           Dim communicatetxtbox As Integer
26           Dim total As Integer
27           Dim communicatingtotal As TextBox = CType(detailsview1.FindControl("communicatingtotal"), TextBox)
28           communicatingScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("communicatingScoreInput"), TextBox).Text)
29           communicatetxtbox = Convert.ToInt16(CType(detailsview1.FindControl("communicatetxtbox"), TextBox).Text)
30           total = Integer.Parse(communicatetxtbox) * Integer.Parse(communicatingScoreInput)
31           communicatingtotal.Text = Convert.ToString(total)
32       End Sub
33       Protected Sub customerfocusScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
34           Dim customerfocusScoreInput As Integer
35           Dim customerfocustxtbox As Integer
36           Dim total As Integer
37           Dim customertotal As TextBox = CType(detailsview1.FindControl("customertotal"), TextBox)
38           customerfocusScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("customerfocusScoreInput"), TextBox).Text)
39           customerfocustxtbox = Convert.ToInt16(CType(detailsview1.FindControl("communicatetxtbox"), TextBox).Text)
40           total = Integer.Parse(customerfocustxtbox) * Integer.Parse(customerfocusScoreInput)
41           customertotal.Text = Convert.ToString(total)
42       End Sub
43       Protected Sub closureScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
44           Dim closureScoreInput As Integer
45           Dim closuretxtbox As Integer
46           Dim total As Integer
47           Dim closuretotal As TextBox = CType(detailsview1.FindControl("closuretotal"), TextBox)
48           closureScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("closureScoreInput"), TextBox).Text)
49           closuretxtbox = Convert.ToInt16(CType(detailsview1.FindControl("closuretxtbox"), TextBox).Text)
50           total = Integer.Parse(closuretxtbox) * Integer.Parse(closureScoreInput)
51           closuretotal.Text = Convert.ToString(total)
52       End Sub
53       Protected Sub businessfocusScoreInput_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
54           Dim businessfocusScoreInput As Integer
55           Dim businessfocustxtbox As Integer
56           Dim total As Integer
57           Dim businesstotal As TextBox = CType(detailsview1.FindControl("businesstotal"), TextBox)
58           businessfocusScoreInput = Convert.ToInt16(CType(detailsview1.FindControl("businessfocusScoreInput"), TextBox).Text)
59           businessfocustxtbox = Convert.ToInt16(CType(detailsview1.FindControl("businessfocustxtbox"), TextBox).Text)
60           total = Integer.Parse(businessfocustxtbox) * Integer.Parse(businessfocusScoreInput)
61           businesstotal.Text = Convert.ToString(total)
62       End Sub
63   
64       Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
65           Dim greetingtotal As Integer
66           Dim problemtotal As Integer
67           Dim communicatingtotal As Integer
68           Dim customertotal As Integer
69           Dim businesstotal As Integer
70           Dim closuretotal As Integer
71           Dim total As Integer
72           Dim grandtotal As TextBox = CType(detailsview1.FindControl("grandtotal"), TextBox)
73           greetingtotal = Convert.ToInt16(CType(detailsview1.FindControl("greetingtotal"), TextBox).Text)
74           problemtotal = Convert.ToInt16(CType(detailsview1.FindControl("problemtotal"), TextBox).Text)
75           communicatingtotal = Convert.ToInt16(CType(detailsview1.FindControl("communicatingtotal"), TextBox).Text)
76           customertotal = Convert.ToInt16(CType(detailsview1.FindControl("customertotal"), TextBox).Text)
77           businesstotal = Convert.ToInt16(CType(detailsview1.FindControl("businesstotal"), TextBox).Text)
78           closuretotal = Convert.ToInt16(CType(detailsview1.FindControl("closuretotal"), TextBox).Text)
79           total = Integer.Parse(greetingtotal) + Integer.Parse(customertotal) + Integer.Parse(problemtotal) + Integer.Parse(communicatingtotal) + Integer.Parse(businesstotal) + Integer.Parse(closuretotal)
80           grandtotal.Text = Convert.ToString(total)
81       End Sub
82   </script>
83   <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
84       <table border="0" cellpadding="0" cellspacing="0" style="vertical-align: middle;
85           width: 700px; text-align: center">
86           <tr>
87               <td align="center" style="height: 400px" valign="middle">
88                   <asp:DetailsView ID="detailsview1" runat="server" AutoGenerateRows="False" CssClass="calculator"
89                       DataKeyNames="id" DataSourceID="getCurrentSalesSupportScore" GridLines="None" DefaultMode="edit">
90                       <Fields>
91                           <asp:TemplateField HeaderText="Create Profile">
92                               <HeaderTemplate>
93                                   &nbsp;
94                               </HeaderTemplate>
95                               <EditItemTemplate><table style="width: 550px">
96                                   <tr>
97                                       <td align="center" style="width: 350px; height: 30px">
98                                           Greeting:</td>
99                                       <td align="center" style="width: 350px; height: 30px">
100                                          <asp:TextBox ID="greetingtxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
101                                              ReadOnly="True" Text='<%# Bind("greetingScore") %>'></asp:TextBox></td>
102                                      <td align="center" style="width: 350px; height: 30px">
103                                          <asp:TextBox ID="greetingScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1" OnTextChanged="greetingScoreInput_TextChanged" AutoPostBack="True"></asp:TextBox>&nbsp;
104                                      </td>
105                                      <td align="center" style="width: 150px; height: 30px">
106                                          <asp:TextBox ID="greetingtotal" runat="server" CssClass="textboxstyle" MaxLength="2"></asp:TextBox></td>
107                                  </tr>
108                                  <tr>
109                                      <td align="center" style="width: 350px; height: 30px">
110                                          Problem Solving &amp; Decision Making:</td>
111                                      <td align="center" style="width: 350px; height: 30px">
112                                          <asp:TextBox ID="probsolvetxtbx" runat="server" CssClass="textboxstyle" MaxLength="1"
113                                              ReadOnly="True" Text='<%# Bind("problemAndDecisionScore") %>'></asp:TextBox></td>
114                                      <td align="center" style="width: 350px; height: 30px">
115                                          <asp:TextBox ID="problemsolvingScoreInput" runat="server" CssClass="textboxstyle"
116                                              MaxLength="1" AutoPostBack="True" OnTextChanged="problemsolvingScoreInput_TextChanged"></asp:TextBox>&nbsp;
117                                      </td>
118                                      <td align="center" style="width: 150px; height: 30px">
119                                          <asp:TextBox ID="problemtotal" runat="server" CssClass="textboxstyle" MaxLength="2" AutoPostBack="True"></asp:TextBox></td>
120                                  </tr>
121                                  <tr>
122                                      <td align="center" style="width: 350px; height: 30px">
123                                          Communicating &amp; Influencing:</td>
124                                      <td align="center" style="width: 350px; height: 30px">
125                                          <asp:TextBox ID="communicatetxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
126                                              ReadOnly="True" Text='<%# Bind("communicateAndInfluenceScore") %>'></asp:TextBox></td>
127                                      <td align="center" style="width: 350px; height: 30px">
128                                          <asp:TextBox ID="communicatingScoreInput" runat="server" CssClass="textboxstyle"
129                                              MaxLength="1" AutoPostBack="True" OnTextChanged="communicatingScoreInput_TextChanged"></asp:TextBox>&nbsp;
130                                      </td>
131                                      <td align="center" style="width: 150px; height: 30px">
132                                          <asp:TextBox ID="communicatingtotal" runat="server" CssClass="textboxstyle" MaxLength="2"></asp:TextBox></td>
133                                  </tr>
134                                  <tr>
135                                      <td align="center" style="width: 350px; height: 30px">
136                                          Customer Focus:</td>
137                                      <td align="center" style="width: 350px; height: 30px">
138                                          <asp:TextBox ID="customerfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
139                                              ReadOnly="True" Text='<%# Bind("customerFocusScore") %>'></asp:TextBox></td>
140                                      <td align="center" style="width: 350px; height: 30px">
141                                          <asp:TextBox ID="customerfocusScoreInput" runat="server" CssClass="textboxstyle"
142                                              MaxLength="1" AutoPostBack="True" OnTextChanged="customerfocusScoreInput_TextChanged"></asp:TextBox>&nbsp;
143                                      </td>
144                                      <td align="center" style="width: 150px; height: 30px">
145                                          <asp:TextBox ID="customertotal" runat="server" CssClass="textboxstyle" MaxLength="2"></asp:TextBox></td>
146                                  </tr>
147                                  <tr>
148                                      <td align="center" style="width: 350px; height: 30px">
149                                          Business Focus</td>
150                                      <td align="center" style="width: 350px; height: 30px">
151                                          <asp:TextBox ID="businessfocustxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
152                                              ReadOnly="True" Text='<%# Bind("businessFocusScore") %>'></asp:TextBox></td>
153                                      <td align="center" style="width: 350px; height: 30px">
154                                          <asp:TextBox ID="businessfocusScoreInput" runat="server" CssClass="textboxstyle"
155                                              MaxLength="1" AutoPostBack="True" OnTextChanged="businessfocusScoreInput_TextChanged"></asp:TextBox>&nbsp;
156                                      </td>
157                                      <td align="center" style="width: 150px; height: 30px">
158                                          <asp:TextBox ID="businesstotal" runat="server" CssClass="textboxstyle" MaxLength="2"></asp:TextBox></td>
159                                  </tr>
160                                  <tr>
161                                      <td align="center" style="width: 350px; height: 30px">
162                                          Closure:</td>
163                                      <td align="center" style="width: 350px; height: 30px">
164                                          <asp:TextBox ID="closuretxtbox" runat="server" CssClass="textboxstyle" MaxLength="1"
165                                              ReadOnly="True" Text='<%# Bind("closureScore") %>'></asp:TextBox></td>
166                                      <td align="center" style="width: 350px; height: 30px">
167                                          <asp:TextBox ID="closureScoreInput" runat="server" CssClass="textboxstyle" MaxLength="1" AutoPostBack="True" OnTextChanged="closureScoreInput_TextChanged"></asp:TextBox>&nbsp;
168                                      </td>
169                                      <td align="center" style="width: 150px; height: 30px">
170                                          <asp:TextBox ID="closuretotal" runat="server" CssClass="textboxstyle" MaxLength="2"></asp:TextBox></td>
171                                  </tr>
172                                  <tr>
173                                      <td align="center" style="width: 350px; height: 30px">
174                                      </td>
175                                      <td align="center" style="width: 350px; height: 30px">
176                                      </td>
177                                      <td align="center" style="width: 350px; height: 30px">
178                                          Total:</td>
179                                      <td align="center" style="width: 150px; height: 30px">
180                                          <asp:TextBox ID="grandtotal" runat="server" CssClass="textboxstyle" Rows="3"></asp:TextBox></td>
181                                  </tr>
182                                  <tr>
183                                      <td align="center" colspan="4" style="height: 30px">
184                                          <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="errorMsgstyle"
185                                                  ForeColor="" />
186                                          <br />
187                                          <asp:Button ID="Button1" runat="server" CssClass="buttonstyle" Text="Button" OnClick="Button1_Click" /></td>
188                                  </tr>
189                              </table>
190                              </EditItemTemplate>
191                          </asp:TemplateField>
192                          <asp:TemplateField ShowHeader="False">
193                              <EditItemTemplate>
194                                  &nbsp;
195                              </EditItemTemplate>
196                              <InsertItemTemplate>
197                                  <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="True" CommandName="Insert"
198                                      Text="Insert"></asp:LinkButton>
199                                  <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
200                                      Text="Cancel"></asp:LinkButton>
201                              </InsertItemTemplate>
202                              <ItemTemplate>
203                                  &nbsp;
204                              </ItemTemplate>
205                          </asp:TemplateField>
206                      </Fields>
207                  </asp:DetailsView>
208                  <asp:SqlDataSource ID="getCurrentSalesSupportScore" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
209                      SelectCommand="SELECT [id], [problemAndDecisionScore], [greetingScore], [communicateAndInfluenceScore], [customerFocusScore], [businessFocusScore], [closureScore], [isCurrent] FROM [salesSupportScoringTable] WHERE ([isCurrent] > @isCurrent)">
210                      <SelectParameters>
211                          <asp:Parameter DefaultValue="0" Name="isCurrent" Type="Int16" />
212                      </SelectParameters>
213                  </asp:SqlDataSource>
214                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
215                  &nbsp; &nbsp; &nbsp; &nbsp;
216                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</td>
217          </tr>
218          <tr>
219              <td style="width: 100px">
220                  &nbsp; &nbsp;&nbsp;
221              </td>
222          </tr>
223      </table>
224  </asp:Content>
225  
226  
  
No one said it was gonna be easy, then again, nothing worth doing ever is.
1
teddymeu4u
2/19/2008 11:00:36 AM
Reply:

Similar Artilces:

How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Send e-mail with web form values (vb.net)
I'm sure this is very simple but;I have a form with numerous (<50) textbox controls and related Label controls; ie: <asp:Label ID="Label1" runat="server" Text="Last Name: "></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>When the form is submitted I want to loop through each label control and textbox control and get their Text values for the e-mail without specifying each control. Anyone have suggestions on the best way to do this?Any assistance appreciated greatly!   Here is a solution for you in VB.net:http://www.extremeexperts.com/...

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

How to add several form field values to email being sent in vb.net?
I have a form that sends an email when the submit button is clicked.  I'd like to include the values from the form into the text of the email, but I don't know how to do that.  Below is the code I have to send the email... How do I add all the form values to the message text  (mm.Body) and include line breaks or spacing to layout the form values for easy reading?  Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.ClickConst ToAddress As String = "foo@foo.com"Dim mm As New MailMessage("foo@foo.com&q...

How to get the value of a textbox that has been added to a template field in a gridview. VB.Net
I have a gridview that shows products, description, price. I have added a Buttonfield and a TemplateField that has a Textbox with the id QuantityTextBox.What I am trying to do is get the value of the Quantity TextBox in the RowCommand event of the gridview. I can get the price but need to get the quantity also. To get the price I used ItemPrice = Server.HtmlDecode(row.Cells(5).Text) My template field is cell 6 but the above routine does'nt work. Any help would be greatly appreciated.Dan5150www.5150creations.com Hiuse this: VB:  Protected Sub GridView1_RowCommand(ByVal ...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Converting Web Site from Vb.Net 2003 to Vb.Net 2005
I have a web site in vb.net 2003 that I what to convert to vb.net 2005. I open my web site in the visual studio 2005 by Local IIS option. I follow the steps of the visual studio conversion wizard.In the conversion report I received the following warning 'Referencepath' settings have not been converted.  Can anyone tell what I have to do to make this warning disappear? Best regards,Sérgio 'Referencepath'  is a property you can set with with VS2003 project file, sothat when ever you to do Add reference this path is serached for class libraries.  We do not  have that ...

add/change name/delete server files via vb.net web form
I have the add(upload) part of this page figured out. I have an application with an "Images" sub directory. I know how to access the getfiles() method from the system.IO namespace. I am using a while loop to create a table with an edit button (so that you can change the name of the file) and a delete button so you can remove the file from the server. Each file is on a new line much like it would look if it was bound to a datalist or datagrid. Here is where I am clueless. Can anyone point me in the right direction? I am not looking for someone to write this for me, beca...

Get value of primary key after INSERT statement using Web Matrix (VB.NET)
I am using the following function developed using Web Matrix to insert a record into a table when the user clicks the submit button.  How can i get the "primary key" or value of the inserted record back to the application.  The following is my insert statement:Sub btnSubmit_Click(sender As Object, e As EventArgs)      CreateMyRecord("98", "UU1")       '==> need the primary key of the inserted record here.......End SubFunction CreateMyRecord(ByVal streetNumber As Integer, ByVal authorityRef As String) As Integer&nbs...

how to design vb.net form with two fields that need to have ability to add a limitless number of values.
I have a form with 5 textboxes and 2 fields that need to have an endless number of options and I just don't know how to deal with this all on one form.  Questions 1-5 are basic demo graphic questions about a person (Name, address, etc) Question 6 asks you to provide insurance beneficiaries and their percentage, and there is no limit to the number of insurance beneficiaries you can have.  (You could list 100 beneficiaries, with each getting 1%) Question 7 asks the user to provide 401k benficiaries and their percentage, and again, there is no limit to the number you can have, ...

How to get RS (From VB6) to .NET (VB.NET)
Hi Friends,         I have requirement, there is one function in VB6 it returns a RS, I need to call that function in  VB.NET, how to get those values into .NET, if can any body can help (pass me some code snippets), that will be greate, Thank you.Madhu... -Madhu hey guys i got this one just by using fill method.-Madhu...

Web resources about - VB.net add textbox values together to get total - asp.net.web-forms

PM Modi at ASEAN Summit: Need global resolve, strategies to combat terrorism
Modi called for a new global resolve and new strategies to combat terrorism, without balancing it against political considerations and said no ...

Obama administration assures dissenting governors on refugee vetting
The Obama administration is assuring governors that refugees who come to the United States in its resettlement program undergo a “rigorous security ...

How Good a Dealmaker Is Donald Trump, Anyway?
Donald Trump on who he listens to on economic issues: Honestly, I feel that I have such a vast feeling for it that I really—you know, Milton ...

Democrats celebrate victory in Louisiana governor's race
NEW ORLEANS (AP) — Democrats in Louisiana rejoiced as they reclaimed the governor's mansion for the first time in eight years, while the state's ...

Bronx woman, 22, charged with stabbing expectant mother to death: NYPD - New York's PIX11 / WPIX-TV
THE BRONX– Police have arrested a 22-year-old woman who stabbed an expectant mother to death in her Bronx apartment yesterday afternoon. Ashleigh ...

Justin Bieber’s Exes: One On Tinder, Another Reveals She’s 6 Months Pregnant
Justin Bieber’s new album “Purpose” awaits its official release in just a matter of days, while Biebs has already made available a half dozen ...

ASEAN creates new economic community that’s larger than EU
Prime Minister Narendra Modi was in the audience, seated next to his Chinese counterpart Li Keqiang, as 10 leaders of the Association of Southeast ...

No. 9 Michigan State beats No. 2 Ohio State 17-14 on late FG
COLUMBUS, Ohio (AP) — The last place Michael Geiger, all 5-foot-8 and 185 pounds of him, wanted to end up was at the bottom of a pile of Michigan ...

No explosives found on diverted Turkish Airlines flight
Irish Times No explosives found on diverted Turkish Airlines flight Irish Times No explosives were found on board a Turkish Airlines flight ...

John Hancock Center Fire Extinguished, 5 People Injured Downtown
DNAinfo John Hancock Center Fire Extinguished, 5 People Injured Downtown (VIDEO) DNAinfo CHICAGO — Five people were injured, including one ...

Resources last updated: 11/22/2015 2:12:33 PM