Welcome Guest Search | Active Topics | Sign In | Register

Dialog Control Cross-Version Options
Samuele
Posted: Wednesday, July 18, 2007 2:57:39 PM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Hi,

i've a Dialog control with inside ContentTemplate a control.
I get control with DialogID.FindControl(ControlID) and it ever work fine.
I've have install new dll version and FindControl now find nothing.. but it not is realy correct.. because if i put a break point in the code before finding control and i try to view value (usign DialogID.Control(0).FindControl(ControlID)) for some times it get nothing but at the end get the control.
It is like if the control is not till designed.

Thanks
Samuele
eo_support
Posted: Wednesday, July 18, 2007 3:05:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Samuele,

I am not sure what you mean by "it is like if the control is not till designed". Can you paste your code with detailed description about how it's working/not working so that we can take a look?

Thanks
Samuele
Posted: Thursday, July 19, 2007 12:42:38 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
I'm sorry for my bad English..

Code: HTML/ASPX
<%@ Register TagPrefix="eo" Namespace="EO.Web" Assembly="EO.Web" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<eo:Dialog id="Dialog1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
				Height="100px" Width="168px" BackColor="#47729F" ControlSkinID="None" HeaderHtml="Dialog Title"
				FooterHtml="Dialog Footer">
				<HeaderStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #ffbf00 3px solid; padding-left: 4px; font-weight: bold; font-size: 11px; padding-bottom: 2px; color: white; padding-top: 2px; border-bottom: #22456a 1px solid; font-family: verdana"></HeaderStyleActive>
				<ContentStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #7d97b6 1px solid; padding-left: 4px; border-left-width: 1px; font-size: 11px; border-left-color: #728eb8; padding-bottom: 4px; color: white; padding-top: 4px; border-bottom: #22456a 1px solid; font-family: verdana"></ContentStyleActive>
				<ContentTemplate>
					<asp:Button id="ToSearch" runat="server" Text="Button"></asp:Button>
				</ContentTemplate>
				<FooterStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #7d97b6 1px solid; padding-left: 4px; border-left-width: 1px; font-size: 11px; border-left-color: #728eb8; padding-bottom: 4px; color: white; padding-top: 4px; border-bottom: #22456a 1px solid; font-family: verdana"></FooterStyleActive>
			</eo:Dialog>
		</form>
	</body>
</HTML>


In this case ToSearch is nothing

Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ToSearch As Button = Dialog1.FindControl("ToSearch")
    End Sub


In this case get error "Index is over ..."
But is you put a break point work correctly.

Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ToSearch As Button = Dialog1.Controls(0).FindControl("ToSearch")
    End Sub


Thanks
Samuele
Padishar
Posted: Thursday, July 19, 2007 5:47:59 AM

Rank: Newbie
Groups: Member

Joined: 7/18/2007
Posts: 8
Hi Samuele,

From what I understand, I had some difficulty during the learning curve on this control. But once you get the hang of it, it is packaged quite nice. When I call the "FindControl" function, and I am using the ContentTemplate, I actually call it under the "ContentContainer" property of the dialog class. Like so...

Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ToSearch As Button = Dialog1.ContentContainer.FindControl("ToSearch")
    End Sub

This should get you what you need.

Happy Coding!
Padishar Think
eo_support
Posted: Thursday, July 19, 2007 6:37:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Thanks Padishar! You are absolutely right. ContentContainer is exactly for that purpose.
Samuele
Posted: Thursday, July 19, 2007 6:58:52 AM
Rank: Advanced Member
Groups: Member

Joined: 5/31/2007
Posts: 58
Its work fine!!

Very thenks for all
Samuele


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.