无法获得创建的表ID [英] Can't get created table ID
问题描述
朋友们,
我需要你的帮助...
我有一个div,并使其具有runat ="server"&通过
动态创建表
在javascript中调用函数,我可以获得在表内创建的所有ID
例如标签,文本框等...并进行所有计算.
我的问题是,
当我单击保存"按钮时,我无法获得任何ID(标签,文本框等).
设计代码....
< div id ="div1" runat ="server">
C#代码...
TextBox txt = FindControl("txt_ItemCode_" + i)作为TextBox;
或
ItemCode = Request.Form ["txt_ItemCode_" + i];
在这两个代码中,我都为空(无法获取ID)
谢谢,
Praveen
Hi friends,
I need ur help...
I have a div and made it has runat="server" & creating tables dynamically by
calling function in javascript and i can get all the ID created inside the table
like lable, textbox etc... and going all calculation.
My Problem is,
When I click save button, I cant able to get any ID''d (lable, textbox etc...)
DESIGN CODE....
<div id="div1" runat="server">
C# CODE...
TextBox txt = FindControl("txt_ItemCode_" + i) as TextBox;
OR
ItemCode = Request.Form["txt_ItemCode_" + i];
Here in both codes I''m getting null (can''t get ID)
Thanks,
Praveen
推荐答案
似乎您已通过添加
将DIV声明为服务器端对象.
It looks like you have declared the DIV as a server side object by adding the
runat="server"
然后您使用客户端(javascript)进行访问,
也许是问题所在?
Then your using clientside (javascript) to access it,
maybe that is the problem?
这篇关于无法获得创建的表ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!