Got and Issue ... New VS2005 User ...
I have this code which works great except:
Now, Everything mostly works just fine ... The SQL Database gets connected to properly, the input from the textbox is run in the query and the proper data is returned in a DetailView.
The detail view shows this information all packaged up nice and neatly:
The problem I'm having is trying to get the information from these three fields above, as well as the hidden fields that follow them passed via the submit button.
I had a hidden field for each of the 3 returned BoundFields above but wasn't sure how to write the VB to say:
"HiddenField1's Value is EQUAL to BoundField's Value which was returned from the database."
I am thinking that I could write it in the VB file attached to my ASPX page ... Can I just submit the information right from the boundfields ... Does anybody have any thoughts?
The old way was familar, I used VBScript and an ASP Form to submit the information.
Question #2:
Is there a way to keep the second button hidden until after the first search button is clicked? Kind of like how the DetailView doesn't display until after the search button is clicked ...
Thanks,
MojoZig
I have this code which works great except:
Code:
<div style="text-align:center;">
<hr style="width:75%" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=ServerName;User ID=UserName" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [TableName] WHERE ([Cust_ID] = @Cust_ID)" EnableCaching="True">
<SelectParameters>
<asp:ControlParameter ControlID="txtCust_ID" Name="Cust_ID" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<table>
<tr>
<td>
Please Input your Account Number:
</td>
<td>
<asp:TextBox ID="txtCust_ID" runat="server" MaxLength="10"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="Button1" runat="server" Text="Search for your Account Information!" />
</td>
</tr>
</table>
<br />
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" BackColor="White"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1"
ForeColor="Black" GridLines="Vertical" Height="50px">
<FooterStyle BackColor="#CCCC99" />
<EditRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F7DE" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<Fields>
<asp:BoundField DataField="Cust_Name" HeaderText="Customer Name" SortExpression="Cust_Name" />
<asp:BoundField DataField="Cust_ID" HeaderText="Account Number" SortExpression="Cust_ID" />
<asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
</Fields>
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:DetailsView>
<br />
<br />
<asp:HiddenField ID="ClientID" runat="server" Value="66665555" />
<asp:HiddenField ID="Password" runat="server" Value="55556666" />
<asp:HiddenField ID="emailConfirmation" runat="server" Value="true" />
<asp:HiddenField ID="PaymentFor" runat="server" Value="Oue Business Name" />
<asp:HiddenField ID="UName" runat="server" Value="UNameInfo" />
<asp:HiddenField ID="Redirect" runat="server" Value="[URL unfurl="true"]http://www.ourbusiness.com"[/URL] />
<asp:Button ID="FullButton" runat="server" EnableViewState="False" Text="Click here to make a FULL payment!" PostBackUrl="[URL unfurl="true"]https://www.paymentportalsite.com/onlinepayment/redirect"[/URL] />
</div>
Now, Everything mostly works just fine ... The SQL Database gets connected to properly, the input from the textbox is run in the query and the proper data is returned in a DetailView.
The detail view shows this information all packaged up nice and neatly:
Code:
<Fields>
<asp:BoundField DataField="Cust_Name" HeaderText="Customer Name" SortExpression="Cust_Name" />
<asp:BoundField DataField="Cust_ID" HeaderText="Account Number" SortExpression="Cust_ID" />
<asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
</Fields>
The problem I'm having is trying to get the information from these three fields above, as well as the hidden fields that follow them passed via the submit button.
I had a hidden field for each of the 3 returned BoundFields above but wasn't sure how to write the VB to say:
"HiddenField1's Value is EQUAL to BoundField's Value which was returned from the database."
I am thinking that I could write it in the VB file attached to my ASPX page ... Can I just submit the information right from the boundfields ... Does anybody have any thoughts?
The old way was familar, I used VBScript and an ASP Form to submit the information.
Question #2:
Is there a way to keep the second button hidden until after the first search button is clicked? Kind of like how the DetailView doesn't display until after the search button is clicked ...
Thanks,
MojoZig