Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have similar problems and finally found solution . my problem was returned null then use this code on external class . I apologize for my English is not good .</p> <p>solution via code :(Have Tested) <br/> Tested by: VS 2010</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; //[Description of MyNamespace] //|================================================================================&gt; //|-----*(In The Name Of GOD)*----- //|================================================================================&gt; namespace MyNamespace { //Most Be "partial class" And ": System.Web.UI.Page" !!!! public partial class MyClass : System.Web.UI.Page { //|============================================================&gt; //| Value Of Class. //|============================================================&gt; static System.Web.UI.Page Page1 = null; static System.Web.UI.Page Page2 = null; int form1Index = -0; //Most Be Static Method!!!! public static void GetMyPage() { //Both are a result code. //هر دو کد یه نتیجه می دهد Page1 = HttpContext.Current.Handler as System.Web.UI.Page; Page2 = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; } //|============================================================&gt; //| DO() Methods Of MyClass Class. //|============================================================&gt; public void DO() { //Call Your Static Method =&gt; GetMyPage() GetMyPage(); if (Page1 != null) { for (int i = 0; i &lt; Page1.Controls.Count; i++) { if (Page1.Controls[i].ID == "form1") { form1Index = i; break; } } } if (form1Index != -0) { for (int j = 0; j &lt; Page1.Controls[form1Index].Controls.Count; j++) { string ControlsID = Page1.Controls[form1Index].Controls[j].ID; // Code location ... //محل قرار گیری کد ها... } } } //|============================================================&gt; //| Destructor Methods MyClass Class. //|============================================================&gt; ~MyClass() { } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload