C# 有没有一个解决方案可以在现有的webform中添加css模板,而现在已经有了这个模板?

C# 有没有一个解决方案可以在现有的webform中添加css模板,而现在已经有了这个模板?,c#,asp.net,css,templates,C#,Asp.net,Css,Templates,有没有办法为没有添加CSS模板的现有webform添加CSS模板 下面列出了我的代码,对于如何为网站主控中已经存在的表单添加CSS模板的任何指导,我们将不胜感激: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Linkchecker.WebForm2" ValidateRequest="false" EnableViewState="false" Enab

有没有办法为没有添加CSS模板的现有webform添加CSS模板

下面列出了我的代码,对于如何为网站主控中已经存在的表单添加CSS模板的任何指导,我们将不胜感激:

 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Linkchecker.WebForm2"
    ValidateRequest="false" EnableViewState="false" EnableViewStateMac="false" EnableSessionState="True"
    EnableEventValidation="false" ViewStateEncryptionMode="Never" %>

<!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></title>

    <script type="text/javascript">
        function finda() {
            var a = document.getElementsByTagName("a");
            var b = document.getElementById("TextBox1");
            b.value = "";


                        for (var i = 0; i < a.length; i++) {
                            a[i] = a.length.value;


                            if (a[i] == null) {
                                alert("Their is no links");
                            }   
                            else {
                                b.value = b.value + "\r\n\n" + a[i]  ;
                            }

                        }

                        //            window.open("http://www.fillsim.com");
                        window.close();
                     //   window.open("WebForm3.aspx?req=" + b.value);


        }
    </script>
     <script>
         var howLong = 6000;
         t = null;
         function closeMe() {
             t = setTimeout("self.close()", howLong);
         }
   </script>
      <script type = "text/javascript">


     var defaultText = "http://www.example.com";
           function waterMarkText(txt, evt) {
               if (txt.value.length == 0 && evt.type == "blur") {
                   txt.style.color = "red";
                   txt.value = defaultText;
               }
               if (txt.value == defaultText && evt.type == "focus") {
                   txt.style.color = "green";
                   txt.value = "";
               }
       }
</script>

</head>
<body >

    <form id="form1" runat="server">
    Enter the URL:<br />
    <asp:TextBox ID="urltxt" runat="server" Width="402px" Text="http://www.example.com" ForeColor="Gray" onblur = "waterMarkText(this, event);" onfocus = "waterMarkText(this, event);"></asp:TextBox>
    <br />
    <br />
    <asp:Button ID="btnRender" runat="server" Text="Page Render" OnClick="btnRender_Click" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btn_submit" runat="server" Text="Submit" OnClientClick="javascript:finda();" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btn_createlink" runat="server"
        Text="Create link" OnClick="btn_createlink_Click" />
    &nbsp;&nbsp;&nbsp;
    <br />
    <br />
    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="373px" Width="410px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox2" runat="server" Height="371px" TextMode="MultiLine" Width="409px"></asp:TextBox>
    &nbsp;<div class="ab" id="div" runat="server">
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Clear" 
            Width="71px" />
    </div>
    </form>


</body>
</html>

函数finda(){
var a=document.getElementsByTagName(“a”);
var b=document.getElementById(“TextBox1”);
b、 value=“”;
对于(变量i=0;i






您可以添加到
部分

<link href="Styles/Site.css" rel="stylesheet" type="text/css" />
<style type="text/css">
   .product-bottom-container 
   {
        width: 100%;
        overflow: hidden;
        height: 10px;
        border-top: 1px solid #C41212;            
        background-color: #ECECEC;

   }
</script>

.产品底部容器
{
宽度:100%;
溢出:隐藏;
高度:10px;
边框顶部:1px实心#C41212;
背景色:#ECECEC;
}
结合它

 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Linkchecker.WebForm2"
    ValidateRequest="false" EnableViewState="false" EnableViewStateMac="false" EnableSessionState="True"
    EnableEventValidation="false" ViewStateEncryptionMode="Never" %>

<!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></title>
        <link href="Styles/Site.css" rel="stylesheet" type="text/css" />

编辑1 以下是如何在现有页面中添加母版页的链接

我已经将所有这些css标签链接从网站管理员复制到了webform2,但没有模板。我忘了在webform2中添加母版页,但现在我该怎么做@shekhar,但感谢之前这么做,但我的webform2的所有设计内容都被破坏了,然后它说内容找不到,如果我删除了这个怎么样?若我进行了深入研究,那个么错误会被清除,但说明找不到内容,若我添加了内容,那个么错误会发生,该怎么办?你们到底想要什么?想在现有页面上应用母版页吗?嘿,谢哈尔,但是我的webform内容不见了,如果添加母版页的内容,则会出现错误