Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Add a value to a Text='

$
0
0

I am trying to add a value to 

<asp:TextBox ID="case_numTextBox" runat="server"
Text='<%# Bind("txt_case_num") %>' />

The value I would like to add is: generatePassword(6) which displayes a random case number. 

I can get it to show in the text box when I use Text='<%# generatePassword(6) %>'  /> but it does not write to the database

<asp:SqlDataSource ID="SqlDataSource_Test" runat="server"
ConnectionString="<%$ ConnectionStrings:Officeclip_ConnectionString %>"
 InsertCommand="INSERT INTO table Test(case_num) VALUES (@txt_case_num)" 
SelectCommand="SELECT TableTest.* FROM TableTest">
<InsertParameters>

<asp:Parameter Name="txt_case_num" />

</InsertParameters>
</asp:SqlDataSource>

How do I do this?


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>