网格未在其他页面中加载....由于master.cs文件 [英] grids are not loading in other pages....due to master.cs file

查看:66
本文介绍了网格未在其他页面中加载....由于master.cs文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将文件(master.cs文件)后面的代码动态添加到contentplaceholder1(在master.aspx文件中),如

I am adding the controls dynamically to contentplaceholder1(in master.aspx file) from code behind file(master.cs file) like

lbl_jobid.Text = "Job Name" + a.ToString();
          ContentPlaceHolder1.Controls.AddAt(0, lbl_jobid);




当Iam在master.cs文件中编写上述代码时

在回发期间,其他页面中的所有其他网格均未加载,我是否在master.cs文件中犯了任何错误?




when Iam writing the above code in master.cs file

all my other grids in other pages are not loading during postbacks am I doing any mistake in master.cs file ?

推荐答案

我不确定,但是您可以尝试一下. .

在您的contentplaceholder内部添加一个面板.
现在尝试使用下面的代码在面板内添加一个控件
I am not sure but you give a try..

Add a panel inside you contentplaceholder.
Now try to add a the control inside the panel by using below code
Label myLabel = new Label();
myLabel.Text = "Label";
myLabel.ID = "Label1";
Panel1.Controls.Add(myLabel);


这篇关于网格未在其他页面中加载....由于master.cs文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆