Pages

Subscribe:

Thursday, June 23, 2011

Textchanged event in asp.net

Hi all,

AutoPostBack="true"

to call text changed method when textbox loses a focus

Tuesday, June 14, 2011

Dynamically show Edit and Delete buttons in a CommandField in a GridView

Hi,

Follow this link

You will get your answer.

Exporting a dataset to excel sheet

Please follow below link

http://forums.asp.net/p/1197704/2076903.aspx

Good luck

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
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>

Can mvc replace a webforms front end

yes.
for ntier in MVC  please see

http://bit.ly/mvc3tier

http://bit.ly/mvc3tierdos

extract zip file in c#

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 


How come my code run very slow ?

ctl00_ prefix is missing for all my web pages

add this in web.config file

<configuration>
    <system.web>
        <pages controlRenderingCompatibilityVersion="3.5" />



3 tier architecture in asp.net

Great tutorial please follow this link


www.dotnetfunda.com/articles/article71.aspx