Hi all,
AutoPostBack="true"
to call text changed method when textbox loses a focus
Thursday, June 23, 2011
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>
extract zip file in c#
Follow this link
use sharpzip dll
http://wiki.sharpdevelop.net/SharpZipLib-Zip-Samples.ashx
download dll
http://www.calendarofupdates.com/updates/index.php?app=downloads&showfile=28
use sharpzip dll
http://wiki.sharpdevelop.net/SharpZipLib-Zip-Samples.ashx
download dll
http://www.calendarofupdates.com/updates/index.php?app=downloads&showfile=28
Accessing controls within Listview
Follow this link
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
if (((Literal)e.Item.FindControl("ImageLit")).Text == "NoImage")
{
((Panel)e.Item.FindControl("PanelImage")).Visible = false;
}
}
}in .aspx page :
<asp:ListView ID="ListView1" runat="server" DataKeyNames="ArticleID"
DataSourceID="ArticleDataRepeat"
onselectedindexchanged="ListView1_SelectedIndexChanged"
onitemcreated="List1ItemCreated" onitemdatabound="ListView1_ItemDataBound">Added onitemdatabound event.
find more in fo here
http://forums.asp.net/t/1687136.aspx/1?Accessing+controls+within+Listview
ctl00_ prefix is missing for all my web pages
add this in web.config file
<configuration> <system.web> <pages controlRenderingCompatibilityVersion="3.5" />
Subscribe to:
Posts (Atom)


