iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am trying to retrieve a label ('lblTesting') from the web dialog box (content template) using getElementById. But I get nothing. Is there any way to retreive a control inside the content template of a dialog box?
ASPX Code: <ISWebDesktop:WebDialogBox ID="WebDialogBox1" runat="server" Height="150px" Width="400px" ShowOnLoad="false"> <ContentTemplate> <asp:Label ID="lblTesting" runat="server"></asp:Label> </ContentTemplate> <CommandButtons> <ISWebDesktop:WebDialogBoxButton Type="OK" Text= "Close" Name= "X" /> </CommandButtons> </ISWebDesktop:WebDialogBox>
Thanks and Regards,
Fung
Hello Fung,
You can use FindControl() method to retrieve the control inside ContentTemplate of WebDialogBox.
function DoClosed() { var dlgBox = ISGetObject("WebDialogBox1"); var element = dlgBox.FindControl("WebDialogBox1_ViewContentTemplate_Label1"); alert(element.innerText); }
WebDialogBox1_ViewContentTemplate_Label1 is the ASP.NET Label ID that I obtained using Developer Tools.
I have attached a sample file for your reference.
Hope this helps.
Thank you.
Hello Martin,
Thanks, the code work as I expected!
Best Regards,
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname