ठीक है, मैं गतिशील रूप से बनाए गए नियंत्रण की आईडी के बारे में बहुत उलझन में हूं।आईडी बनाम अनोखा आईडी बनाम क्लाइंट आईडी बनाम UniqueClientID बनाम StaticClientID?
Public Class TestClass
Inherits Panel
Implements INamingContainer
Function TestClassInit() Handles Me.Init
Dim pnlMainPanel As New Panel
Me.Controls.Add(pnlMainPanel)
Dim pnlTest1 As New Panel
pnlMainPanel.Controls.Add(pnlTest1)
pnlTest1.ClientIDMode = UI.ClientIDMode.Inherit ' DEFAULT
'pnlTest1.ID = "ctl01"
'pnlTest1.UniqueID = "ctl00$MainPanel$ctl01"
'pnlTest1.ClientID = "MainPanel_ctl01"
'pnlTest1.UniqueClientID = "ctl00_MainPanel_ctl01"
'pnlTest1.StaticClientID = ""
pnlTest1.ClientIDMode = UI.ClientIDMode.Predictable
'pnlTest1.ClientID = "MainPanel_ctl01" (no change)
pnlTest1.ClientIDMode = UI.ClientIDMode.AutoID
'pnlTest1.ClientID = "ctl00_MainPanel_ctl01"
pnlTest1.ClientIDMode = UI.ClientIDMode.Static
'pnlTest1.ClientID = ""
End Function
End Class
क्यों 5 अलग-अलग आईडी ??
आपको विभिन्न आईडी मोड का उपयोग कब करना चाहिए?
(मैं MSDN डॉक्स पढ़ें, लेकिन वे थे, हमेशा की तरह, विशेष रूप से रोशन नहीं।)
मैं क्या आईडी है परवाह नहीं है, तो और सिर्फ एक नियंत्रण & देना जोड़ना चाहते हैं अपने एक गतिशील रूप से जोड़ा AJAX विस्तारक के लिए आईडी, मैं किस मोड/आईडी कॉम्बो का उपयोग करना चाहिए?
यदि आप एड्स की देखभाल नहीं करते हैं तो उन्हें पहले स्थान पर क्यों जोड़ें – Baz1nga
मुझे लगता है कि .NET के लिए एमएसडीएन दस्तावेज़ों की तुलना में बहुत अच्छा है ... उदाहरण के लिए शेयरपॉइंट –