在其他页面中获取控件ID

编程入门 行业动态 更新时间:2024-10-05 05:16:35
本文介绍了在其他页面中获取控件ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在不同页面中获取控件ID?

Hi, How can I get the Controls ID in different page?

推荐答案

控件是特定于页面的.如果要将某些控件值公开给其他页面,则可以使用属性(get-set)公开它们. 此外,如果您具有页面实例,则可以使用页面的``FindControl''方法使用控件ID查找该页面的控件. 更新: 您对问题做了一些修改.一旦回答,请不要删除. 如果您希望将控件的ID传递给各个页面,则可以使用相同的查询字符串或会话. 这些对您没有帮助,那么最好共享您正在研究的方案. 更新2 : 瞧,一旦您告诉自己的情况,答案将如何改变.您只需要设计一个用户控件.在此用户控件中具有参数控件,然后在所需的所有页面上使用此用户控件. Controls are page specific. If you want to expose a certain control values to other page then you can expose them using properties (get-set) . Further, if you have page instance then you can use ''FindControl'' method of the page to find a control of that page using control ID. UPDATE: You modified your question a little. Please don''t delete once answered. If you are looking to pass on the ID of control to various pages then you can use query string or sessions for the same. Is these does not help, then it would be better to share the scenario you are working on. UPDATE 2: See, how answer can change as soon you tell your scenario. You simply need to design a User Control. Have the parameter controls in this user control and then use this user control on all the pages where you need.

我编辑并回答了这个问题.但是在您的问题列表中找不到它了.您删除了吗? 如何获取其他页面中的控件ID? 您无法在另一个页面中获得页面的控件ID. 但是,您可以通过多种方法获得控件的价值. 您能解释一下您要做什么吗? I edited and answered this question. But can''t find it anymore in your question list. Have you deleted it? How can I get the Controls ID in different page?? You cannot get the control id of a page in another page. But there are ways you can get the value of a control. Can you explain what you are trying to do?

更多推荐

在其他页面中获取控件ID

本文发布于:2023-11-03 04:42:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1554264.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   页面   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!