User control bug? Positioning issue in ASP.NET user controls.

User control bug? Positioning issue in ASP.NET user controls.

Post by Dave » Fri, 13 Jun 2003 14:28:41



Hi all,

I created some of my first user controls and they worked like a charm except
for one thing-
they cannot be repositioned on the screen with the mouse and it sticks in
the upper left hand corner.
When more controls are added, they too stick to the upper left hand corner
of the form!
You can't move them at all.  All other displayable items can be positioned
with no problems (so it's not a global thing).
I figured  I could just go into the HTML and type in the X and Y positions
directly like so:
(the user control here is "uc_states")

 <body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <asp:textbox id="TextBox1" style="Z-INDEX: 101; LEFT: 256px; POSITION:
absolute; TOP: 168px"
    runat="server"></asp:textbox><asp:button id="Button1" style="Z-INDEX:
102; LEFT: 416px; POSITION: absolute; TOP: 168px" runat="server"
    Text="Insert"></asp:button><asp:label id="Label1" style="Z-INDEX: 103;
LEFT: 512px; POSITION: absolute; TOP: 232px" runat="server"
    Width="152px"></asp:label><uc1:uc_states id="UC_states1" style="Z-INDEX:
104; LEFT: 104px; POSITION: absolute; TOP: 168px"
    runat="server"></uc1:uc_states>
   <DIV style="DISPLAY: inline; Z-INDEX: 105; LEFT: 256px; WIDTH: 152px;
POSITION: absolute; TOP: 144px; HEIGHT: 16px"
    ms_positioning="FlowLayout">City</DIV>
   <DIV style="DISPLAY: inline; Z-INDEX: 106; LEFT: 104px; WIDTH: 136px;
POSITION: absolute; TOP: 144px; HEIGHT: 19px"
    ms_positioning="FlowLayout">State</DIV>
  </form>
 </body>

This works only in the editor.  During runtime the user control jumps back
up to the top left.
Looks like a bug to me!
VS.Net 2003 (VB.NET), FW1.1

Any ideas?
TIA
Dave

 
 
 

User control bug? Positioning issue in ASP.NET user controls.

Post by Dave » Sun, 15 Jun 2003 10:29:31


Hi Again,

Here is the new code where I took out any reference to "flow layout" but it
still does the same thing!
Does anyone know of a workaround for this bug?
 <body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <asp:textbox id="TextBox1" style="Z-INDEX: 101; LEFT: 256px; POSITION:
absolute; TOP: 168px"
    runat="server"></asp:textbox><asp:button id="Button1" style="Z-INDEX:
102; LEFT: 416px; POSITION: absolute; TOP: 168px" runat="server"
    Text="Insert"></asp:button><asp:label id="Label1" style="Z-INDEX: 103;
LEFT: 528px; POSITION: absolute; TOP: 136px" runat="server"
    Width="152px"></asp:label>
   <DIV style="DISPLAY: inline; Z-INDEX: 105; LEFT: 256px; WIDTH: 152px;
POSITION: absolute; TOP: 144px; HEIGHT: 16px"
    ms_positioning="GridLayout">City</DIV>
   <DIV style="DISPLAY: inline; Z-INDEX: 106; LEFT: 104px; WIDTH: 136px;
POSITION: absolute; TOP: 144px; HEIGHT: 19px"
    ms_positioning="GridLayout">State</DIV>
   <uc1:UC_states ms_positioning="GridLayout" style="Z-INDEX: 107; LEFT:
104px; POSITION: absolute; TOP: 168px"
    id="UC_states1" runat="server"></uc1:UC_states>
  </form>
 </body>

and here is the code for the user control:


Codebehind="UC_states.ascx.vb" Inherits="WebApplication1.UC_states"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:dropdownlist id=DD_STATES accessKey=S DataMember="USSTATES"
ms_positioning="GridLayout" DataSource="<%# TheStates1 %>" runat="server"
DataTextField="STATE" DataValueField="STATE_ABBREV" Width="128px"
BackColor="#C0FFFF" Font-Bold="True" style="POSITION: absolute">
</asp:dropdownlist>

I added the ms_positioning and a style tag to the control - still doesn't
work.  Then I tried dropping the control inside a Grid Layout Panel - didn't
work either.  By the way, I followed a Microsoft example EXACTLY and it does
not work!
Help!!!
Dave


Quote:> Hi all,

> I created some of my first user controls and they worked like a charm
except
> for one thing-
> they cannot be repositioned on the screen with the mouse and it sticks in
> the upper left hand corner.
> When more controls are added, they too stick to the upper left hand corner
> of the form!
> You can't move them at all.  All other displayable items can be positioned
> with no problems (so it's not a global thing).
> I figured  I could just go into the HTML and type in the X and Y positions
> directly like so:
> (the user control here is "uc_states")

>  <body MS_POSITIONING="GridLayout">
>   <form id="Form1" method="post" runat="server">
>    <asp:textbox id="TextBox1" style="Z-INDEX: 101; LEFT: 256px; POSITION:
> absolute; TOP: 168px"
>     runat="server"></asp:textbox><asp:button id="Button1" style="Z-INDEX:
> 102; LEFT: 416px; POSITION: absolute; TOP: 168px" runat="server"
>     Text="Insert"></asp:button><asp:label id="Label1" style="Z-INDEX: 103;
> LEFT: 512px; POSITION: absolute; TOP: 232px" runat="server"
>     Width="152px"></asp:label><uc1:uc_states id="UC_states1"
style="Z-INDEX:
> 104; LEFT: 104px; POSITION: absolute; TOP: 168px"
>     runat="server"></uc1:uc_states>
>    <DIV style="DISPLAY: inline; Z-INDEX: 105; LEFT: 256px; WIDTH: 152px;
> POSITION: absolute; TOP: 144px; HEIGHT: 16px"
>     ms_positioning="FlowLayout">City</DIV>
>    <DIV style="DISPLAY: inline; Z-INDEX: 106; LEFT: 104px; WIDTH: 136px;
> POSITION: absolute; TOP: 144px; HEIGHT: 19px"
>     ms_positioning="FlowLayout">State</DIV>
>   </form>
>  </body>

> This works only in the editor.  During runtime the user control jumps back
> up to the top left.
> Looks like a bug to me!
> VS.Net 2003 (VB.NET), FW1.1

> Any ideas?
> TIA
> Dave


 
 
 

1. Numerous ASP.NET web form/user control designer bugs

Why is it that 50% of the time when I add a new SqlConnection object (it's
not limited to these objects. SqlCommand does the same thing, and seemingly
any component) it's not serialized to code-behind? Everyone I know that's
designed web forms has seen this bug and yet it exists in VS.NET 2003 Final
Beta.

The bug also occurs with property changes on those components, name changes,
collection changes, etc.

I can get the serialization to fire correctly (once) if I drop a control
onto the designer, like a web button. Then the codebehind will exhibit the
components I added (SqlConnection etc.)

I *seriously* hope MS fixes this one, as it is one of the most annoying
flaws I've seen yet.

Nathan Alden

2. thesaurus ?

3. Compiled user controls not in my user controls toolbox...

4. Help! Can't plot

5. How to control the focus as the user tabs into a user control?

6. UK READERS EPSON 1160 WANTERD

7. Accessing Other User Controls and Parents From User Control

8. Why is Designwave on the market

9. Calling an user control from another user control

10. web user control within a web user control

11. I have a user control and I want to inherit it from another user control

12. Access user control property in same user control .ascx code

13. Data binding DropDownList user control within other user controls