grid view display
-
Hello friends. I want to show the same grid view in another page from first page. I use the following code in text box case. it work properly. but for grid view what will I change in following code. In first page: I take text box and button. on button click I write
Server.Transfer("page2.aspx");
<u>In Secong page:</u> On page_load event
{
if(Page.PreviousPage != null)
{
TextBox txt =(TextBox) Page.PreviousPage.FindControl("txtFirstPage");
if(txt != null)
{
Response.Write("<font color='teal' > " + txt.Text + "</font>");} } thanx
-
Hello friends. I want to show the same grid view in another page from first page. I use the following code in text box case. it work properly. but for grid view what will I change in following code. In first page: I take text box and button. on button click I write
Server.Transfer("page2.aspx");
<u>In Secong page:</u> On page_load event
{
if(Page.PreviousPage != null)
{
TextBox txt =(TextBox) Page.PreviousPage.FindControl("txtFirstPage");
if(txt != null)
{
Response.Write("<font color='teal' > " + txt.Text + "</font>");} } thanx
You should really avoid the use of Server.Transfor for such simple scenarios like this. ASP.NET allows you to cross-post from one page to another. Just set the PostbackURL property on the button to page2.aspx, and access the value for txtFirstPage directly from the form: Request.Form["txtFirstPage"]