Controls in HeaderTemplate

Y

Yan Wang

Hi!

Does anyone know how to get the text in textbox field which is in
HeaderTemplate of a DataGrid?
In the following code, I can not get text of "tbName". I typed something in
that box. I can get
tbName control but the text is empty.

Thanks a lot!

Yan

==================== asp ===============================================
<asp:datagrid Autogeneratecolumns="false" id="dgList" runat="server"
DataKeyField="ID">
<Columns>
<asp:TemplateColumn>
<ItemStyle></ItemStyle>
<ItemTemplate>
<asp:LinkButton Runat="server" CommandName="OnNameClicked">
<%# DataBinder.Eval(Container.DataItem, "NAME") %>
</asp:LinkButton>
</ItemTemplate>
<HeaderTemplate>
<table>
<tr>
<td>
<asp:LinkButton Runat="server" ID="btName"
OnCommand="OnNameSortClicked" CommandArgument="NAME">Name</asp:LinkButton>
<asp:Label Runat="server" ID="lbNameSort"></asp:Label>
</td>
<tr>
<td>
<asp:TextBox Runat="server" ID="tbName"
EnableViewState="True"></asp:TextBox>
</td>
</tr>
</table>
</HeaderTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
========================= sever =======================================
public void OnItemDataBound(object sender, DataGridItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Header) {
for (int i = 0; i < m_dgList.Columns.Count; ++i) {
Control aControl = null;
if (e.Item.Cells.HasControls()) {
aControl = e.Item.Cells.FindControl("tbName");
if (aControl != null) {
TextBox tbTemp = (TextBox)aControl; // I
reach here
if (tbTemp.Text != null && tbTemp.Text.Length > 0) {
tbTemp.Text = "Got it!";
//never reach here!!!!
}
}
}
}
}
}
 
M

Martin Dechev

Hi, Yan Wang,

The condition

if (tbTemp.Text != null && tbTemp.Text.Length > 0)

is supposed to be false on the first request (when IsPostBack is false)
because the control is added like this:

<asp:TextBox Runat="server" ID="tbName" EnableViewState="True"/>

Try to set the Text property in order to make the condition if (tbTemp.Text
!= null && tbTemp.Text.Length > 0) true.

Hope this helps
Martin
 
Y

Yan Wang

Hi!

You are right. But still I can not solve the problem. I try to catch
"OnItemDataBound" event is only raised when IsPostBack is true.
Same as OnItemCreate event. So I still can not get the text which I typed
in. I also notice, I can not make tbName instantialize
at codebhind class.(I use "protected TextBox tbName;" in class, it is always
NULL).
Is that because MS only want all stuff in datagrid to be shown to page only?
Any idea how to get content of textbox in
HeaderTemplate but that content is what typed from user not from program? Or
I have to go back as normal html input tag for
that textbox?

Thanks for your help!

Yan



Martin Dechev said:
Hi, Yan Wang,

The condition

if (tbTemp.Text != null && tbTemp.Text.Length > 0)

is supposed to be false on the first request (when IsPostBack is false)
because the control is added like this:

<asp:TextBox Runat="server" ID="tbName" EnableViewState="True"/>

Try to set the Text property in order to make the condition if (tbTemp.Text
!= null && tbTemp.Text.Length > 0) true.

Hope this helps
Martin

Yan Wang said:
Hi!

Does anyone know how to get the text in textbox field which is in
HeaderTemplate of a DataGrid?
In the following code, I can not get text of "tbName". I typed something in
that box. I can get
tbName control but the text is empty.

Thanks a lot!

Yan

==================== asp ===============================================
<asp:datagrid Autogeneratecolumns="false" id="dgList" runat="server"
DataKeyField="ID">
<Columns>
<asp:TemplateColumn>
<ItemStyle></ItemStyle>
<ItemTemplate>
<asp:LinkButton Runat="server" CommandName="OnNameClicked">
<%# DataBinder.Eval(Container.DataItem, "NAME") %>
</asp:LinkButton>
</ItemTemplate>
<HeaderTemplate>
<table>
<tr>
<td>
<asp:LinkButton Runat="server" ID="btName"
OnCommand="OnNameSortClicked"
CommandArgument="NAME">Name said:
<asp:Label Runat="server" ID="lbNameSort"></asp:Label>
</td>
<tr>
<td>
<asp:TextBox Runat="server" ID="tbName"
EnableViewState="True"></asp:TextBox>
</td>
</tr>
</table>
</HeaderTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
========================= sever =======================================
public void OnItemDataBound(object sender, DataGridItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Header) {
for (int i = 0; i < m_dgList.Columns.Count; ++i) {
Control aControl = null;
if (e.Item.Cells.HasControls()) {
aControl = e.Item.Cells.FindControl("tbName");
if (aControl != null) {
TextBox tbTemp = (TextBox)aControl; // I
reach here
if (tbTemp.Text != null && tbTemp.Text.Length > 0) {
tbTemp.Text = "Got it!";
//never reach here!!!!
}
}
}
}
}
}

 
M

Martin Dechev

Hi, Yan,

Maybe this code can help you because it is working for me:

Listing <test.aspx>:

<%@ Page language="C#" inherits="test_aspx" %>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
</head>
<body>
<form id="form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server"
autogeneratecolumns="False" onitemcreated="DataGrid1_ItemCreated">
<columns>
<asp:templatecolumn>
<itemtemplate>
<asp:linkbutton runat="server" commandname="OnNameClicked" id="Linkbutton1">
<%# DataBinder.Eval(Container.DataItem, "column1") %>
</asp:linkbutton>
</itemtemplate>
<headertemplate>
<table>
<tr>
<td>
<asp:textbox runat="server" id="tbName"
enableviewstate="True"/>
</td>
</tr>
</table>
</headertemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
</form>
</body>
</html>

Listing <test_aspx.cs>:

using System;

public class test_aspx : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;

protected void Page_Load(object s, EventArgs e)
{
if(!IsPostBack)
{
System.Data.DataTable dt =
new System.Data.DataTable();
System.Data.DataRow dr;
dt.Columns.Add("column1", typeof(string));
dr = dt.NewRow();
dr[0] = "One";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Two";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Three";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Four";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Five";
dt.Rows.Add(dr);
DataGrid1.DataSource =
dt.DefaultView;
DataGrid1.DataBind();
}
}

protected void DataGrid1_ItemCreated(object s,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Header)
{
System.Web.UI.WebControls.TextBox tbName =
e.Item.FindControl("tbName") as
System.Web.UI.WebControls.TextBox;
if(tbName != null)
tbName.Text = "Gotcha!";
}
}
}

Greetings
Martin
Yan Wang said:
Hi!

You are right. But still I can not solve the problem. I try to catch
"OnItemDataBound" event is only raised when IsPostBack is true.
Same as OnItemCreate event. So I still can not get the text which I typed
in. I also notice, I can not make tbName instantialize
at codebhind class.(I use "protected TextBox tbName;" in class, it is always
NULL).
Is that because MS only want all stuff in datagrid to be shown to page only?
Any idea how to get content of textbox in
HeaderTemplate but that content is what typed from user not from program? Or
I have to go back as normal html input tag for
that textbox?

Thanks for your help!

Yan



Martin Dechev said:
Hi, Yan Wang,

The condition

if (tbTemp.Text != null && tbTemp.Text.Length > 0)

is supposed to be false on the first request (when IsPostBack is false)
because the control is added like this:

<asp:TextBox Runat="server" ID="tbName" EnableViewState="True"/>

Try to set the Text property in order to make the condition if (tbTemp.Text
!= null && tbTemp.Text.Length > 0) true.

Hope this helps
Martin

Yan Wang said:
Hi!

Does anyone know how to get the text in textbox field which is in
HeaderTemplate of a DataGrid?
In the following code, I can not get text of "tbName". I typed
something
in
that box. I can get
tbName control but the text is empty.

Thanks a lot!

Yan

==================== asp ===============================================
<asp:datagrid Autogeneratecolumns="false" id="dgList" runat="server"
DataKeyField="ID">
<Columns>
<asp:TemplateColumn>
<ItemStyle></ItemStyle>
<ItemTemplate>
<asp:LinkButton Runat="server" CommandName="OnNameClicked">
<%# DataBinder.Eval(Container.DataItem, "NAME") %>
</asp:LinkButton>
</ItemTemplate>
<HeaderTemplate>
<table>
<tr>
<td>
<asp:LinkButton Runat="server" ID="btName"
OnCommand="OnNameSortClicked"
CommandArgument="NAME">Name said:
<asp:Label Runat="server" ID="lbNameSort"></asp:Label>
</td>
<tr>
<td>
<asp:TextBox Runat="server" ID="tbName"
EnableViewState="True"></asp:TextBox>
</td>
</tr>
</table>
</HeaderTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
========================= sever =======================================
public void OnItemDataBound(object sender, DataGridItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Header) {
for (int i = 0; i < m_dgList.Columns.Count; ++i) {
Control aControl = null;
if (e.Item.Cells.HasControls()) {
aControl = e.Item.Cells.FindControl("tbName");
if (aControl != null) {
TextBox tbTemp = (TextBox)aControl; // I
reach here
if (tbTemp.Text != null && tbTemp.Text.Length > 0) {
tbTemp.Text = "Got it!";
//never reach here!!!!
}
}
}
}
}
}


 
Y

Yan Wang

Hi! Martin:

Thanks a lot for your reply. From code here, I think you put "Gotcha" in
code. What I want
is that I want to get the content of that textbox. Say, I type in something
to that textbox from
browser. Then I click "One" (a link button in datagrid item). The page is
posted back to server.
Now, I want to get the content of TextBox in HeaderTemplate at this time.
But I find, I
can not get it. It always return me empty string.

Do you know how to solve it?

Thanks a lot!

Yan


Martin Dechev said:
Hi, Yan,

Maybe this code can help you because it is working for me:

Listing <test.aspx>:

<%@ Page language="C#" inherits="test_aspx" %>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
</head>
<body>
<form id="form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server"
autogeneratecolumns="False" onitemcreated="DataGrid1_ItemCreated">
<columns>
<asp:templatecolumn>
<itemtemplate>
<asp:linkbutton runat="server" commandname="OnNameClicked" id="Linkbutton1">
<%# DataBinder.Eval(Container.DataItem, "column1") %>
</asp:linkbutton>
</itemtemplate>
<headertemplate>
<table>
<tr>
<td>
<asp:textbox runat="server" id="tbName"
enableviewstate="True"/>
</td>
</tr>
</table>
</headertemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
</form>
</body>
</html>

Listing <test_aspx.cs>:

using System;

public class test_aspx : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;

protected void Page_Load(object s, EventArgs e)
{
if(!IsPostBack)
{
System.Data.DataTable dt =
new System.Data.DataTable();
System.Data.DataRow dr;
dt.Columns.Add("column1", typeof(string));
dr = dt.NewRow();
dr[0] = "One";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Two";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Three";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Four";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Five";
dt.Rows.Add(dr);
DataGrid1.DataSource =
dt.DefaultView;
DataGrid1.DataBind();
}
}

protected void DataGrid1_ItemCreated(object s,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Header)
{
System.Web.UI.WebControls.TextBox tbName =
e.Item.FindControl("tbName") as
System.Web.UI.WebControls.TextBox;
if(tbName != null)
tbName.Text = "Gotcha!";
}
}
}

Greetings
Martin
Yan Wang said:
Hi!

You are right. But still I can not solve the problem. I try to catch
"OnItemDataBound" event is only raised when IsPostBack is true.
Same as OnItemCreate event. So I still can not get the text which I typed
in. I also notice, I can not make tbName instantialize
at codebhind class.(I use "protected TextBox tbName;" in class, it is always
NULL).
Is that because MS only want all stuff in datagrid to be shown to page only?
Any idea how to get content of textbox in
HeaderTemplate but that content is what typed from user not from
program?
Or
I have to go back as normal html input tag for
that textbox?

Thanks for your help!

Yan



Martin Dechev said:
Hi, Yan Wang,

The condition

if (tbTemp.Text != null && tbTemp.Text.Length > 0)

is supposed to be false on the first request (when IsPostBack is false)
because the control is added like this:

<asp:TextBox Runat="server" ID="tbName" EnableViewState="True"/>

Try to set the Text property in order to make the condition if (tbTemp.Text
!= null && tbTemp.Text.Length > 0) true.

Hope this helps
Martin

Hi!

Does anyone know how to get the text in textbox field which is in
HeaderTemplate of a DataGrid?
In the following code, I can not get text of "tbName". I typed something
in
that box. I can get
tbName control but the text is empty.

Thanks a lot!

Yan

==================== asp ===============================================
<asp:datagrid Autogeneratecolumns="false" id="dgList" runat="server"
DataKeyField="ID">
<Columns>
<asp:TemplateColumn>
<ItemStyle></ItemStyle>
<ItemTemplate>
<asp:LinkButton Runat="server" CommandName="OnNameClicked">
<%# DataBinder.Eval(Container.DataItem, "NAME") %>
</asp:LinkButton>
</ItemTemplate>
<HeaderTemplate>
<table>
<tr>
<td>
<asp:LinkButton Runat="server" ID="btName"
OnCommand="OnNameSortClicked"
CommandArgument="NAME">Name said:
<asp:Label Runat="server" ID="lbNameSort"></asp:Label>
</td>
<tr>
<td>
<asp:TextBox Runat="server" ID="tbName"
EnableViewState="True"></asp:TextBox>
</td>
</tr>
</table>
</HeaderTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
========================= sever =======================================
public void OnItemDataBound(object sender, DataGridItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Header) {
for (int i = 0; i < m_dgList.Columns.Count; ++i) {
Control aControl = null;
if (e.Item.Cells.HasControls()) {
aControl = e.Item.Cells.FindControl("tbName");
if (aControl != null) {
TextBox tbTemp = (TextBox)aControl;
//
 
M

Martin Dechev

Hi, Yan,

The only place I could get reference to the textbox in the header was the
OnItemCreated event. The problem is that it happens after the call to the
event handler of the LinkButtons Click event. Apart from this, the viewstate
gets loaded after the OnItemCreated event. So, the only way is to append
info in the both event handlers and then do the processing in a third event
handler - after the viewstate has been loaded. I chose the OnPreRender event
of the datagrid for this.

Well, this seems to be a dirty solution... But it is working

listing <text.aspx>:

<%@ Page language="C#" inherits="test_aspx" %>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
</head>
<body>
<form id="form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server"
autogeneratecolumns="False"
onitemcreated="DataGrid1_ItemCreated"
onprerender="DataGrid1_PreRender">
<columns>
<asp:templatecolumn>
<itemstyle></itemstyle>
<itemtemplate>
<asp:linkbutton runat="server" id="Linkbutton1"
oncommand="LinkButton_Command" commandname="OnNameClicked"
commandargument='<%# DataBinder.Eval(Container.DataItem,"column1")%>'>
<%# DataBinder.Eval(Container.DataItem, "column1") %>
</asp:linkbutton>
</itemtemplate>
<headertemplate>
<table>
<tr>
<td>
<asp:textbox runat="server" id="tbName"/>
</td>
</tr>
</table>
</headertemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
the posted value is:
<asp:literal id="Literal1" runat="server">n/a</asp:literal>
</form>
</body>
</html>

listing <test_aspx.cs>:

using System;

public class test_aspx : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Literal Literal1;

System.Web.UI.WebControls.TextBox tb;
string _commandArg, _commandName;
bool _linkButtonClicked;

protected void Page_Load(object s, EventArgs e)
{
if(!IsPostBack)
{
System.Data.DataTable dt = new System.Data.DataTable();
System.Data.DataRow dr;
dt.Columns.Add("column1", typeof(string));
dr = dt.NewRow();
dr[0] = "One";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Two";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Three";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Four";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Five";
dt.Rows.Add(dr);
DataGrid1.DataSource = dt.DefaultView;
DataGrid1.DataBind();
}
}

protected void LinkButton_Command(object s,
System.Web.UI.WebControls.CommandEventArgs e)
{
// Store the info in the private fields
// for the later processing:
_commandArg = (string)e.CommandArgument;
_commandName = e.CommandName;
_linkButtonClicked = true;
}

protected void DataGrid1_ItemCreated(object s,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Header)
{
System.Web.UI.WebControls.TextBox tbName =
e.Item.FindControl("tbName") as
System.Web.UI.WebControls.TextBox;
if(tbName != null)
{
if(!IsPostBack)
tbName.Text = "Gotcha";
// Let's store the reference to this ghost:
tb = tbName;
}
}
}

protected void DataGrid1_PreRender(object s, EventArgs e)
{
if(_linkButtonClicked)
{
DoProcessing();
}
}

void DoProcessing()
{
// Do here the actual processing here

Literal1.Text = tb.Text;
}
}

Hope this helps
Martin
 
Y

Yan Wang

Hi! Martin:

Great! It works perfect. Thanks a lot. I think it is weird that we can not
match the fields in HeaderTemplate to
its parent's class. Otherwise, it can be solved in a very simple way. I
notice the controls in DataGrid1 only
contain data items but not header items. Do you know any reason for this?
Anyway, that is other story.

Thanks a lot!

Yan



Martin Dechev said:
Hi, Yan,

The only place I could get reference to the textbox in the header was the
OnItemCreated event. The problem is that it happens after the call to the
event handler of the LinkButtons Click event. Apart from this, the viewstate
gets loaded after the OnItemCreated event. So, the only way is to append
info in the both event handlers and then do the processing in a third event
handler - after the viewstate has been loaded. I chose the OnPreRender event
of the datagrid for this.

Well, this seems to be a dirty solution... But it is working

listing <text.aspx>:

<%@ Page language="C#" inherits="test_aspx" %>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
</head>
<body>
<form id="form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server"
autogeneratecolumns="False"
onitemcreated="DataGrid1_ItemCreated"
onprerender="DataGrid1_PreRender">
<columns>
<asp:templatecolumn>
<itemstyle></itemstyle>
<itemtemplate>
<asp:linkbutton runat="server" id="Linkbutton1"
oncommand="LinkButton_Command" commandname="OnNameClicked"
commandargument='<%# DataBinder.Eval(Container.DataItem,"column1")%>'>
<%# DataBinder.Eval(Container.DataItem, "column1") %>
</asp:linkbutton>
</itemtemplate>
<headertemplate>
<table>
<tr>
<td>
<asp:textbox runat="server" id="tbName"/>
</td>
</tr>
</table>
</headertemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
the posted value is:
<asp:literal id="Literal1" runat="server">n/a</asp:literal>
</form>
</body>
</html>

listing <test_aspx.cs>:

using System;

public class test_aspx : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Literal Literal1;

System.Web.UI.WebControls.TextBox tb;
string _commandArg, _commandName;
bool _linkButtonClicked;

protected void Page_Load(object s, EventArgs e)
{
if(!IsPostBack)
{
System.Data.DataTable dt = new System.Data.DataTable();
System.Data.DataRow dr;
dt.Columns.Add("column1", typeof(string));
dr = dt.NewRow();
dr[0] = "One";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Two";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Three";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Four";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "Five";
dt.Rows.Add(dr);
DataGrid1.DataSource = dt.DefaultView;
DataGrid1.DataBind();
}
}

protected void LinkButton_Command(object s,
System.Web.UI.WebControls.CommandEventArgs e)
{
// Store the info in the private fields
// for the later processing:
_commandArg = (string)e.CommandArgument;
_commandName = e.CommandName;
_linkButtonClicked = true;
}

protected void DataGrid1_ItemCreated(object s,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType ==
System.Web.UI.WebControls.ListItemType.Header)
{
System.Web.UI.WebControls.TextBox tbName =
e.Item.FindControl("tbName") as
System.Web.UI.WebControls.TextBox;
if(tbName != null)
{
if(!IsPostBack)
tbName.Text = "Gotcha";
// Let's store the reference to this ghost:
tb = tbName;
}
}
}

protected void DataGrid1_PreRender(object s, EventArgs e)
{
if(_linkButtonClicked)
{
DoProcessing();
}
}

void DoProcessing()
{
// Do here the actual processing here

Literal1.Text = tb.Text;
}
}

Hope this helps
Martin
Yan Wang said:
Hi! Martin:

Thanks a lot for your reply. From code here, I think you put "Gotcha" in
code. What I want
is that I want to get the content of that textbox. Say, I type in something
to that textbox from
browser. Then I click "One" (a link button in datagrid item). The page is
posted back to server.
Now, I want to get the content of TextBox in HeaderTemplate at this time.
But I find, I
can not get it. It always return me empty string.

Do you know how to solve it?

Thanks a lot!

Yan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top