Monday, January 2, 2012
Thursday, June 23, 2011
Textchanged event in asp.net
Hi all,
AutoPostBack="true"
to call text changed method when textbox loses a focus
AutoPostBack="true"
to call text changed method when textbox loses a focus
Tuesday, June 14, 2011
Wednesday, June 8, 2011
Dynamic table creation with SQL
Suppose you have a button called btnSubmit then on click of submit button you can write following code
to database for further processing in stored procedure you can split this values and add to database this approach will save your multiple hit to
database
protected void GridView1_Click(object sender, EventArgs e) { foreach (GridViewRow row in grd.Rows) { if (row.RowType == DataControlRowType.DataRow) { TextBox txt = (TextBox)row.Cells[1].FindControl("TextBox1"); if (txt != null && !string.IsNullOrEmpty(txt.Text)) { string stDescription = row.Cells[0].Text; string stMeasurement = row.Cells[2].Text; // Now you have all the values // i.e. Description,Measurement and the textbox value
entered against this two // now you can add this values to database by passing it to some stored procedure } } } }Another idea is to loop all rows and concatinate this strings in one single string builder seperated by some unique delimiter and pass this value
to database for further processing in stored procedure you can split this values and add to database this approach will save your multiple hit to
database
grid view footer did not present.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ShowFooter="true"> </asp:GridView>
Subscribe to:
Posts (Atom)


