yahya kh
yahya kh

Reputation: 751

Textbox value from inside gridview not working?

I have a gridview and within it there is also another gridview as a templete filed, inside the nest gridview there is a textbox as a templete filed, now there is another button on nested grid too, when ever i press the button and i try to get the textbox value it's always empty, am i doing anything wrong ?

Upvotes: 0

Views: 297

Answers (2)

Elias Hossain
Elias Hossain

Reputation: 4469

You can try as below code format in Page_Load event:

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    { 
        gridView.DataSource = yourDataSource;
        gridView.DataBind();
    }
}

Upvotes: 1

Neha
Neha

Reputation: 2955

onload use

 if(!ispostback)
//bind grid

Upvotes: 4

Related Questions