Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls on a web form

Status
Not open for further replies.

mrathi

Technical User
Oct 27, 2003
115
US
Hi Thanks in advance for all the responses.

I am creating a web form with several labels, textbox, panel, table controls using Visual Studio 2003. All the controls are basically placed properly in the IDE and when I run the application they look fine in the Internet Explorer on my computer. However on the IE of some other computer the controls are all misplaced. How can I keep all the controls together?

Is there a good way of placing controls on the form so that they look nice not matter what the browser or the resolution on any computer?

Thanks.
 
Consider reading some of the posts in the HTML, XHTML, & CSS forum on cross-browser issues.

Visual Studio creates a doctype. If you change this Doctype to a stricter type, it will force the resulting page to not use IE "quirks".

The first result is your page will look worse, in most cases. Then you have to slowly work through the problems, addressing them by use of good valid CSS.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
I have learned to use the HTML Table to organize my pages. I also set the fonts to px to deal with the different dpi setting. Another thing is the Flow Layout seems to work better as well.

Hope this helps.

Hope everyone is having a great day!

Thanks - Jennifer
 
It depends. We use CSS as Mr. Greer has pointed. We do for accessibility reasons. So I am told but have never used one many s/w programs for the visual impaired treat tables tr td as data and do not handle pages laid out in the same manner. Just an fyi.
Marty
 
If my controls are in a panel, is CSS still the way to go? I have never used CSS before and I really do not know it. Any recommendations will be helpful.

Thanks again.
 
Keep firmly in mind that what an ASP.NET Server control actually does (among other things) is render an HTML control. Think of each server control as a little "server" that serves up HTML tags.

In the case of a "Panel", look at what it actually creates. I'm pretty sure it creates / renders/ serves an HTML <div> element. You can do a lot with CSS and <div> elements.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Hi, Thanks for your response. I am going to paste here the HTML code generated by Visual Stusio. basically I have created a panel and placed some controls inside it. How can I apply or make CSS styles to suit this?

<asp:panel id="pnlTop" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 144px" runat="server" Width="810px" Height="40px">
<asp:Label id=lblAirs runat="server" Width="56px" Font-Bold="True">AIRS #</asp:Label>
<asp:TextBox id=txtAIRS tabIndex=1 runat="server" Width="136px" Enabled="False" MaxLength="12"></asp:TextBox>&nbsp;
<asp:Label id=lblClass runat="server" Width="56px" Font-Bold="True">CLASS:</asp:Label>
<asp:TextBox id=txtClass tabIndex=2 runat="server" Width="38px" MaxLength="2"></asp:TextBox>&nbsp;
<asp:CheckBox id=chkPart7 tabIndex=3 runat="server" Font-Bold="True" Text="PART 70"></asp:CheckBox>&nbsp;
<asp:CheckBox id=chkNSPS tabIndex=4 runat="server" Font-Bold="True" Text="NSPS"></asp:CheckBox>&nbsp;
<asp:CheckBox id=chkNonAttainment tabIndex=5 runat="server" Font-Bold="True" Text="NON-ATTAINMENT"></asp:CheckBox>&nbsp;
<asp:Label id=lblFEI runat="server" Width="56px" Font-Bold="True">1. FEI #</asp:Label>
<asp:TextBox id=txtFEI tabIndex=6 runat="server" Width="104px" MaxLength="12"></asp:TextBox></asp:panel>

All I want is the controls to be displayed in one line on the browser.

Thanks a million.
 
That isn't HTML, those are the Web Server Control tags. You can see the HTML by running the code, and using "View Source" in the browser.

I can't give you a complete CSS tutorial. There are lots of good sites out there to learn CSS.

Once you have a style, you can set styles simply by including a style sheet. Or, you can apply style properties to the server control in the IDE.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top