.NETGURU
user controle problem
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolsvb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

siri siris
-- Moved from [aspngwebservices] to [aspngcontrolsvb] by Charles M. Carroll <Click here to reveal e-mail address> --hi alli developped one small user controle which contains 4tables. i want to set up one of the table's heightthrough property. i created that property aswriteonly.i registered this user controle in my webform. but when i run my program(.aspx), i am gettingfollowing eerror. i am including my .ascx code and.aspx code also below ..please help me.ascx code:<script language="vb" runat="server">Public WriteOnly Property HeightVal As String    Set        TableTop2.Height = Value    End SetEnd Property</script><asp:table id="TableTop4" style="Z-INDEX: 101; LEFT:0px; POSITION: absolute; TOP: 0px" BackColor="Teal"Height="57px" Width="1000px" runat="server">    <asp:TableRow>        <asp:TableCell>        </asp:TableCell>    </asp:TableRow></asp:table><asp:table id="TableTop3" style="Z-INDEX: 103; LEFT:985px; POSITION: absolute; TOP: 57px" BackColor="Teal"Height="700px" Width="15px" runat="server">    <asp:TableRow>        <asp:TableCell>        </asp:TableCell>    </asp:TableRow></asp:table><asp:table id="TableTop2" style="Z-INDEX: 102; LEFT:0px; POSITION: absolute; TOP: 57px" BackColor="Teal"Width="15px" runat="server">    <asp:TableRow>        <asp:TableCell>            <input id="tt" size="20" type="text"runat="server">        </asp:TableCell>    </asp:TableRow></asp:table><asp:table id="TableTop1" style="Z-INDEX: 104; LEFT:15px; POSITION: absolute; TOP: 57px"BackColor="LightSeaGreen" Height="10px" Width="970px"runat="server">    <asp:TableRow>        <asp:TableCell>        </asp:TableCell>    </asp:TableRow></asp:table>.aspx code:<%@ Page Language="vb" AutoEventWireup="false"Codebehind="login.aspx.vb" Inherits="tycoproj.login"%><%@ Register TagPrefix="Acmex" TagName="Border"Src="border.ascx"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0Transitional//EN"><HTML>    <HEAD>        <title></title>        <meta name="GENERATOR" content="Microsoft VisualStudio.NET 7.0">        <meta name="CODE_LANGUAGE" content="Visual Basic7.0">        <meta name="vs_defaultClientScript"content="JavaScript">        <meta name="vs_targetSchema"content="http://schemas.microsoft.com/intellisense/ie5";>    </HEAD>    <body MS_POSITIONING="GridLayout">        <form id="Form1" method="post" runat="server">            <Acmex:Border HeightVal="566px" runat="server">            </Acmex:Border>            <asp:label id="lblHead" style="Z-INDEX: 106; LEFT:435px; POSITION: absolute; TOP: 186px" runat="server"Font-Size="Medium" Width="146px" Height="22px">PleaseLogin Below</asp:label>            <asp:RequiredFieldValidatorid="RequiredFieldValidator1" style="Z-INDEX: 110;LEFT: 634px; POSITION: absolute; TOP: 283px"runat="server" Height="9px" Width="200px"Display="Static" ControlToValidate="txtUserName"> (* Enter UserName) </asp:RequiredFieldValidator>            <asp:label id="lblUid" style="Z-INDEX: 102; LEFT:377px; POSITION: absolute; TOP: 280px" runat="server"Font-Size="Small" Width="105px" Font-Bold="True">UserName:</asp:label>            <asp:label id="lblPwd" style="Z-INDEX: 103; LEFT:379px; POSITION: absolute; TOP: 306px" runat="server"Font-Size="Small" Width="105px"Font-Bold="True">Password:</asp:label>            <asp:textbox id="txtUserName" style="Z-INDEX: 101;LEFT: 500px; POSITION: absolute; TOP: 280px"runat="server" Width="120px" Height="21px"Font-Bold="True" BackColor="White" BorderStyle="Solid"ToolTip="Enter User Name" MaxLength="20"BorderWidth="1px"></asp:textbox>            <asp:textbox id="txtPwd" style="Z-INDEX: 105; LEFT:500px; POSITION: absolute; TOP: 307px" runat="server"Width="120px" Height="21px" Font-Bold="True"BackColor="White" BorderStyle="Solid" ToolTip="EnterUser Name" MaxLength="20" BorderWidth="1px"TextMode="Password"></asp:textbox>            <asp:button id="btnLogin" style="Z-INDEX: 104;LEFT: 457px; POSITION: absolute; TOP: 382px"runat="server" Width="65px" Height="26px"Font-Bold="True" BorderStyle="Solid" ToolTip="Login"BorderWidth="1px" Text="Login"OnClick="btnLogin_Click"></asp:button>            <asp:Label id="Label1" style="Z-INDEX: 107; LEFT:398px; POSITION: absolute; TOP: 84px" runat="server"Height="34px" Width="252px" Font-Size="X-Large"Font-Bold="True" Font-Italic="True">TYCOElectronics</asp:Label>            <asp:Label id="Label2" style="Z-INDEX: 108; LEFT:336px; POSITION: absolute; TOP: 128px" runat="server"Height="37px" Width="369px" Font-Size="X-Large"Font-Bold="True">QTR Management System</asp:Label>            <asp:Label id="lblError" style="Z-INDEX: 109; LEFT:387px; POSITION: absolute; TOP: 228px" runat="server"Height="27px" Width="235px"></asp:Label>            <asp:RequiredFieldValidatorid="RequiredFieldValidator2"ControlToValidate="txtPwd" Display="Static"runat="server" style="Z-INDEX: 110; LEFT: 635px;POSITION: absolute; TOP: 311px" Height="9px"Width="200px"> (* Enter Password) </asp:RequiredFieldValidator>        </form>    </body></HTML>error:Description: An error occurred during the compilationof a resource required to service this request. Pleasereview the following specific error details and modifyyour source code appropriately. Compiler Error Message: BC30311: A value of type'String' cannot be converted to'System.Web.UI.WebControls.Unit'.Source Error: Line 2: Public WriteOnly Property HeightVal As StringLine 3:     SetLine 4:         TableTop2.Height = ValueLine 5:     End SetLine 6: End Property Source File: c:\inetpub\wwwroot\tycoproj\border.ascx Line: 4 Thanksravindra__________________________________________________Do You Yahoo!?Send your FREE holiday greetings online!http://greetings.yahoo.com
Reply to this message...
 
    
Chris Wooldridge
the error is just as it says

an servercontrol height property does not just take a number as its input

you must create a Web.UI.WebControls.Unit object give it a value and then
use that to set your height

"siri siris" <Click here to reveal e-mail address> wrote in message
news:554951@aspngcontrolsvb...
[Original message clipped]

Reply to this message...
 
    
Rob Howard (VIP)
Hi Siri,

Try:

<script language=3D"vb" runat=3D"server">
Public WriteOnly Property HeightVal As Unit
    Set
        TableTop2.Height =3D Value
    End Set
End Property
</script>

-----Original Message-----
From: siri siris [mailto:Click here to reveal e-mail address]=20
Sent: Friday, January 04, 2002 12:07 PM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] user controle problem

-- Moved from [aspngwebservices] to [aspngcontrolsvb] by Charles M.
Carroll <Click here to reveal e-mail address> --

hi all

i developped one small user controle which contains 4
tables. i want to set up one of the table's height
through property. i created that property as
writeonly.i registered this user controle in my web
form. but when i run my program(.aspx), i am getting
following eerror. i am including my .ascx code and
.aspx code also below ..please help me

.ascx code:

<script language=3D"vb" runat=3D"server">
Public WriteOnly Property HeightVal As String
    Set
        TableTop2.Height =3D Value
    End Set
End Property
</script>
<asp:table id=3D"TableTop4" style=3D"Z-INDEX: 101; LEFT:
0px; POSITION: absolute; TOP: 0px" BackColor=3D"Teal" Height=3D"57px"
Width=3D"1000px" runat=3D"server">
    <asp:TableRow>
        <asp:TableCell>
        </asp:TableCell>
    </asp:TableRow>
</asp:table>
<asp:table id=3D"TableTop3" style=3D"Z-INDEX: 103; LEFT:
985px; POSITION: absolute; TOP: 57px" BackColor=3D"Teal" =
Height=3D"700px"
Width=3D"15px" runat=3D"server">
    <asp:TableRow>
        <asp:TableCell>
        </asp:TableCell>
    </asp:TableRow>
</asp:table>
<asp:table id=3D"TableTop2" style=3D"Z-INDEX: 102; LEFT:
0px; POSITION: absolute; TOP: 57px" BackColor=3D"Teal" Width=3D"15px"
runat=3D"server">
    <asp:TableRow>
        <asp:TableCell>
            <input id=3D"tt" size=3D"20" type=3D"text"
runat=3D"server">
        </asp:TableCell>
    </asp:TableRow>
</asp:table>
<asp:table id=3D"TableTop1" style=3D"Z-INDEX: 104; LEFT:
15px; POSITION: absolute; TOP: 57px"
BackColor=3D"LightSeaGreen" Height=3D"10px" Width=3D"970px" =
runat=3D"server">
    <asp:TableRow>
        <asp:TableCell>
        </asp:TableCell>
    </asp:TableRow>
</asp:table>

.aspx code:

<%@ Page Language=3D"vb" AutoEventWireup=3D"false"
Codebehind=3D"login.aspx.vb" Inherits=3D"tycoproj.login"%> <%@ Register
TagPrefix=3D"Acmex" TagName=3D"Border" Src=3D"border.ascx"%> <!DOCTYPE =
HTML
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML>
    <HEAD>
        <title></title>
        <meta name=3D"GENERATOR" content=3D"Microsoft Visual
Studio.NET 7.0">
        <meta name=3D"CODE_LANGUAGE" content=3D"Visual Basic
7.0">
        <meta name=3D"vs_defaultClientScript"
content=3D"JavaScript">
        <meta name=3D"vs_targetSchema"
content=3D"http://schemas.microsoft.com/intellisense/ie5";>
    </HEAD>
    <body MS_POSITIONING=3D"GridLayout">
        <form id=3D"Form1" method=3D"post" runat=3D"server">
            <Acmex:Border HeightVal=3D"566px" runat=3D"server">
            </Acmex:Border>
            <asp:label id=3D"lblHead" style=3D"Z-INDEX: 106;
LEFT:
435px; POSITION: absolute; TOP: 186px" runat=3D"server" =
Font-Size=3D"Medium"
Width=3D"146px" Height=3D"22px">Please Login Below</asp:label>
            <asp:RequiredFieldValidator
id=3D"RequiredFieldValidator1" style=3D"Z-INDEX: 110;
LEFT: 634px; POSITION: absolute; TOP: 283px"
runat=3D"server" Height=3D"9px" Width=3D"200px"
Display=3D"Static" ControlToValidate=3D"txtUserName">
(* Enter UserName)
</asp:RequiredFieldValidator>
            <asp:label id=3D"lblUid" style=3D"Z-INDEX: 102;
LEFT:
377px; POSITION: absolute; TOP: 280px" runat=3D"server" =
Font-Size=3D"Small"
Width=3D"105px" Font-Bold=3D"True"> UserName:</asp:label>
            <asp:label id=3D"lblPwd" style=3D"Z-INDEX: 103;
LEFT:
379px; POSITION: absolute; TOP: 306px" runat=3D"server" =
Font-Size=3D"Small"
Width=3D"105px" Font-Bold=3D"True">Password:</asp:label>
            <asp:textbox id=3D"txtUserName" style=3D"Z-INDEX:
101;
LEFT: 500px; POSITION: absolute; TOP: 280px"
runat=3D"server" Width=3D"120px" Height=3D"21px"
Font-Bold=3D"True" BackColor=3D"White" BorderStyle=3D"Solid" =
ToolTip=3D"Enter
User Name" MaxLength=3D"20" BorderWidth=3D"1px"></asp:textbox>
            <asp:textbox id=3D"txtPwd" style=3D"Z-INDEX: 105;
LEFT:
500px; POSITION: absolute; TOP: 307px" runat=3D"server" Width=3D"120px"
Height=3D"21px" Font-Bold=3D"True" BackColor=3D"White" =
BorderStyle=3D"Solid"
ToolTip=3D"Enter User Name" MaxLength=3D"20" BorderWidth=3D"1px"
TextMode=3D"Password"></asp:textbox>
            <asp:button id=3D"btnLogin" style=3D"Z-INDEX: 104;
LEFT: 457px; POSITION: absolute; TOP: 382px"
runat=3D"server" Width=3D"65px" Height=3D"26px"
Font-Bold=3D"True" BorderStyle=3D"Solid" ToolTip=3D"Login" =
BorderWidth=3D"1px"
Text=3D"Login" OnClick=3D"btnLogin_Click"></asp:button>
            <asp:Label id=3D"Label1" style=3D"Z-INDEX: 107;
LEFT:
398px; POSITION: absolute; TOP: 84px" runat=3D"server" Height=3D"34px"
Width=3D"252px" Font-Size=3D"X-Large" Font-Bold=3D"True"
Font-Italic=3D"True">TYCO Electronics</asp:Label>
            <asp:Label id=3D"Label2" style=3D"Z-INDEX: 108;
LEFT:
336px; POSITION: absolute; TOP: 128px" runat=3D"server" Height=3D"37px"
Width=3D"369px" Font-Size=3D"X-Large" Font-Bold=3D"True">QTR Management
System</asp:Label>
            <asp:Label id=3D"lblError" style=3D"Z-INDEX: 109;
LEFT:
387px; POSITION: absolute; TOP: 228px" runat=3D"server" Height=3D"27px"
Width=3D"235px"></asp:Label>
            <asp:RequiredFieldValidator
id=3D"RequiredFieldValidator2"
ControlToValidate=3D"txtPwd" Display=3D"Static"
runat=3D"server" style=3D"Z-INDEX: 110; LEFT: 635px;
POSITION: absolute; TOP: 311px" Height=3D"9px"
Width=3D"200px">
(* Enter Password)
</asp:RequiredFieldValidator>
        </form>
    </body>
</HTML>

error:

Description: An error occurred during the compilation
of a resource required to service this request. Please
review the following specific error details and modify
your source code appropriately.=20

Compiler Error Message: BC30311: A value of type
'String' cannot be converted to 'System.Web.UI.WebControls.Unit'.

Source Error:

=20

Line 2: Public WriteOnly Property HeightVal As String
Line 3:     Set
Line 4:         TableTop2.Height =3D Value
Line 5:     End Set
Line 6: End Property
=20

Source File: c:\inetpub\wwwroot\tycoproj\border.ascx =20
Line: 4=20

Thanks
ravindra

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online! http://greetings.yahoo.com
| [aspngcontrolsvb] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngcontrolsvb.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
siri siris
hi chris

thanks
ravi
--- Chris Wooldridge <Click here to reveal e-mail address>
wrote:
[Original message clipped]


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

Reply to this message...
 
 
System.Web.UI.MobileControls.RequiredFieldValidator
System.Web.UI.WebControls.BorderStyle
System.Web.UI.WebControls.RequiredFieldValidator
System.Web.UI.WebControls.TableCell
System.Web.UI.WebControls.TableRow
System.Web.UI.WebControls.Unit
System.Windows.Forms.BorderStyle
System.Windows.Forms.ToolTip




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification