如何设置网页分辨率 [英] How to Set web page resolution

查看:241
本文介绍了如何设置网页分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


How to Set web page resolution according to screen  in asp.net(C#)

I m Working with Web Application

推荐答案

如果您使用的是Visual Studio,则只需调整表单的锚属性,其控件以及利用Dock属性.然后,每当您打开网页,最小化,最大化或调整网页大小时,控件都会根据您的调整进行自我调整.

需要更改的属性:-

1.锚
2.停靠
If you are using Visual Studio then you can simply adjust the anchor property of your form and it''s controls and also make use of Dock property. And then whenever you open your webpage, minimize it, maximize it, or resize it, the controls will self-adjust themselves as per your adjustments.

Properties that needs to be changed :-

1. Anchor
2. Dock


这是在Visual Studio中的GUI模式下完成的,因此下面是示例.

http://www.devx.com/dotnet/Article/6964/1954 [ ^ ]

这是我们对Windows窗体所做的,对于网页没有这样的选择.

但是您可以使用表格,tr和td或div来设置网页.通过表或div对其进行管理,控件在调整窗口大小时会自动调整自身大小.

例如:-


It is done in GUI mode in Visual Studio, so following are the examples.

http://www.devx.com/dotnet/Article/6964/1954[^]

This is what we do for windows form, and for web pages there is no such option.

But you can use tables, tr and td or div to setup your webpage. And by managing it via tables or divs, the controls automatically resize themselves when the window is resized.

For eg:-


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="~/Default.aspx.cs" Inherits="Default" %>

<%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls"

    TagPrefix="BDP" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Web Employee Master</title>
    <style type="text/css">
        #form1
        {
            text-align: center;
        }
    </style>
</head>
<body style="background-color: #cc6699">
    <form id="form1" runat="server">
    <table>
        <tr>
            <td>
                <asp:Label ID="lblEmployeeMaster" runat="server" Text="Employee Master" Font-Bold="True"

                    BackColor="#FFFF99" BorderColor="Black" BorderStyle="Dotted" Font-Underline="True"

                    Style="text-align: center" Width="244px" Font-Size="X-Large" Height="28px"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td align="left">
                            <table>
                                <tr>
                                    <td>
                                        <b>Employee ID :</b>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEmpID" runat="server" Width="150px" ReadOnly="True" MaxLength="5"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <b>Employee Name</b> <b>:</b>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEmpName" runat="server" Width="150px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Must not be Blank."

                                            ControlToValidate="txtEmpName" SetFocusOnError="true"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>



</table>



</table>


这篇关于如何设置网页分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆