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> </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 & 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 & 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 & 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 & 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> </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> </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> </td> </tr> <tr> <td style="width: 100px"> </td> </tr> </table> </asp:Content>
No one said it was gonna be easy, then again, nothing worth doing ever is.
![]() |
1 |
![]() |
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 |
![]() |
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 IntegerTotal = communicatingtotal + businesstotal + closuretotaltb.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 |
![]() |
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 appreciated1 <%@ 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 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> 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 & 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> 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 & 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> 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> 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> 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> 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 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 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 216 217 </td> 218 </tr> 219 <tr> 220 <td style="width: 100px"> 221 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 |
![]() |
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 best1 <%@ 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 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> 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 & 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> 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 & 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> 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> 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> 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> 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 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 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 215 216 </td> 217 </tr> 218 <tr> 219 <td style="width: 100px"> 220 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 |
![]() |