none
sps 页面中如何向下一个页面传值 RRS feed

  • 问题

  •  

    <table width="100%" border="0" bgcolor="#408080">
              <tr>
                <td scope="col"> <div align="center"> <span class="STYLE15 STYLE13">&#29992;&#25143;&#21517;&#65306; </span>
                    <input name="username" type="text" class="input" size="15">
                    <span class="STYLE6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="STYLE16">&nbsp;&nbsp;&nbsp; <span class="STYLE13">&#23494;&#30721;&#65306; </span> </span> </span>
                    <input name="password" type="text" class="input" size="15">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="Submit" type="submit" class="sms_button" value="&#30331;&#24405;">
                </div> </td>
              </tr>
            </table>

    点击登录时如何把 username和password的值传给一个页面接受??
    2008年12月22日 3:10

答案

全部回复

  • 加上form就可以了

    <form action="b.aspx" method="post">

    b.aspx里面可以
    Request.Form["
    username"]

    Request.Form["password"]

    分别得到输入的值

    2008年12月22日 3:25
    版主
  •  

    还是不行
    2008年12月22日 4:15
  • 贴你的代码
    2008年12月22日 4:26
    版主
  •  

    <HEAD>
    <meta name="WebPartPageExpansion" content="full">
    <META Name="GENERATOR" Content="Microsoft SharePoint">
        <META Name="ProgId" Content="SharePoint.WebPartPage.Document">
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
        <META Name="CollaborationServer" Content="SharePoint Team Web Site">
        <META HTTP-EQUIV="Expires" content="0">
        
         <Title ID=onetidTitle>主页 - <SharePointStick out tonguerojectProperty Property="Title" runat="server" __Preview="绩效考核"/></Title>
    <script src="/_layouts/2052/owsbrows.js"></script>
    <Link REL="stylesheet" Type="text/css" HREF="/_layouts/2052/styles/ows.css">
        <script><!--
    if (browseris.mac && !browseris.ie5up)
    {
        var ms_maccssfpfixup = "/_layouts/2052/styles/owsmac.css";
        document.write("<link rel='stylesheet' Type='text/css' href='" + ms_maccssfpfixup + "'>");
    }
    //--></script>
    <style>
    v\:*         { behavior: url(#default#VML) }
    o\:*         { behavior: url(#default#VML) }
    .shape       { behavior: url(#default#VML) }
    </style>
    <link type="text/xml" rel='alternate' href="_vti_bin/spdisco.aspx" />
    <meta name="Microsoft Theme" content="none, default">
    <meta name="Microsoft Border" content="none">
    </HEAD>
    <body marginwidth="0" marginheight="0" scroll="yes">
    <p><html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .STYLE2 {font-weight: bold}
    .STYLE4 {font-weight: bold}
    .STYLE6 {font-weight: bold}
    .STYLE9 {color: #000000}
    .STYLE11 {color: #FFFFFF; }
    .STYLE13 {
     font-size: 12px;
     color: #FFFFFF;
    }
    .STYLE15 {color: #FFFFFF; font-weight: bold; }
    .STYLE16 {font-size: 16px}
    .STYLE17 {color: #FFFFFF; font-weight: bold; font-size: 14px; }
    .STYLE18 {font-size: 14px}
    .STYLE19 {
     color: #008080;
     font-weight: bold;
    }
    .STYLE20 {color: #008080; font-weight: bold; font-size: 16px; }
    .style1 {
     text-align: right;
    }
    -->
    </style>
    </head>

    <body bgcolor="#D3D3D3" text="#333333" link="#333333" vlink="#666666" alink="#999999" leftmargin="1" topmargin="1" marginwidth="1" marginheight="1">
    <form runat="server" >
    <div align="center">
      <table width="780" height="223" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="223" valign="top"> <span class='ms-SPLink'> <span class='ms-HoverCellInActive' onmouseover="this.className='ms-HoverCellActive'"; onmouseout="this.className='ms-HoverCellInActive'">
           <WebPartPagesTongue TiedettingsLink runat="server" id="SettingsLink1"/> 
            </span> </span>
          
      <object classid="clsidBig Smile27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="780" height="197">
              <param name="movie" value="js1.swf">
              <param name="quality" value="high">
              <param name="LOOP" value="false">
              <param name="menu" value="false">
              <embed src="js1.swf" width="780" height="197" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed></object>
            <table width="100%" border="0" bgcolor="#408080">
           
              <tr><form method="post" action="http://computer.clpec/">
                <td scope="col">
       <input name="Text1" type="text">&nbsp;&nbsp;
       <input name="Password1" type="password">&nbsp;
       <input name="Submit" type="Submit" value="按钮"></td>
            </form>

     </tr>
         
            </table></td>
        </tr>
      </table>
        </table>
    </div>
    </form>
    </body>
    </html>
      </body>
    </html>

    一提交就返回本页面

    2008年12月22日 5:04
  •  

    <HEAD>
    <meta name="WebPartPageExpansion" content="full">
    <META Name="GENERATOR" Content="Microsoft SharePoint">
        <META Name="ProgId" Content="SharePoint.WebPartPage.Document">
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
        <META Name="CollaborationServer" Content="SharePoint Team Web Site">
        <META HTTP-EQUIV="Expires" content="0">
        
         <Title ID=onetidTitle>主页 - <SharePointStick out tonguerojectProperty Property="Title" runat="server" __Preview="绩效考核"/></Title>
    <script src="/_layouts/2052/owsbrows.js"></script>
    <Link REL="stylesheet" Type="text/css" HREF="/_layouts/2052/styles/ows.css">
        <script><!--
    if (browseris.mac && !browseris.ie5up)
    {
        var ms_maccssfpfixup = "/_layouts/2052/styles/owsmac.css";
        document.write("<link rel='stylesheet' Type='text/css' href='" + ms_maccssfpfixup + "'>");
    }
    //--></script>
    <style>
    v\:*         { behavior: url(#default#VML) }
    o\:*         { behavior: url(#default#VML) }
    .shape       { behavior: url(#default#VML) }
    </style>
    <link type="text/xml" rel='alternate' href="_vti_bin/spdisco.aspx" />
    <meta name="Microsoft Theme" content="none, default">
    <meta name="Microsoft Border" content="none">
    </HEAD>
    <body marginwidth="0" marginheight="0" scroll="yes">
    <p><html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .STYLE2 {font-weight: bold}
    .STYLE4 {font-weight: bold}
    .STYLE6 {font-weight: bold}
    .STYLE9 {color: #000000}
    .STYLE11 {color: #FFFFFF; }
    .STYLE13 {
     font-size: 12px;
     color: #FFFFFF;
    }
    .STYLE15 {color: #FFFFFF; font-weight: bold; }
    .STYLE16 {font-size: 16px}
    .STYLE17 {color: #FFFFFF; font-weight: bold; font-size: 14px; }
    .STYLE18 {font-size: 14px}
    .STYLE19 {
     color: #008080;
     font-weight: bold;
    }
    .STYLE20 {color: #008080; font-weight: bold; font-size: 16px; }
    .style1 {
     text-align: right;
    }
    -->
    </style>
    </head>

    <body bgcolor="#D3D3D3" text="#333333" link="#333333" vlink="#666666" alink="#999999" leftmargin="1" topmargin="1" marginwidth="1" marginheight="1">
    <form runat="server" >
    <div align="center">
      <table width="780" height="223" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="223" valign="top"> <span class='ms-SPLink'> <span class='ms-HoverCellInActive' onmouseover="this.className='ms-HoverCellActive'"; onmouseout="this.className='ms-HoverCellInActive'">
           <WebPartPagesTongue TiedettingsLink runat="server" id="SettingsLink1"/> 
            </span> </span>
          
      <object classid="clsidBig Smile27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="780" height="197">
              <param name="movie" value="js1.swf">
              <param name="quality" value="high">
              <param name="LOOP" value="false">
              <param name="menu" value="false">
              <embed src="js1.swf" width="780" height="197" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed></object>
            <table width="100%" border="0" bgcolor="#408080">
           
              <tr><form method="post" action="http://computer.clpec/">
                <td scope="col">
       <input name="Text1" type="text">&nbsp;&nbsp;
       <input name="Password1" type="password">&nbsp;
       <input name="Submit" type="Submit" value="按钮"></td>
            </form>

     </tr>
         
            </table></td>
        </tr>
      </table>
        </table>
    </div>
    </form>
    </body>
    </html>
      </body>
    </html>

    一提交就返回本页面

    2008年12月22日 5:04
  •  

    好像sps你的form不能传值
    2008年12月23日 3:33
  • form标记是不能嵌套的
    2008年12月23日 3:40
    版主
  • <form method="post" action="http://computer.clpec/">
                <td scope="col">
       <input name="Text1" type="text">&nbsp;&nbsp;
       <input name="Password1" type="password">&nbsp;
       <input name="Submit" type="Submit" value="按钮"></td>
            </form>

     </tr>
         
            </table></td>
        </tr>
      </table>
        </table>
    </div>
    </form>


    改成




     </tr>
         
            </table></td>
        </tr>
      </table>
        </table>
    </div>
    </form>

    <form method="post" action="http://computer.clpec/">
       <input name="Text1" type="text">&nbsp;&nbsp;
       <input name="Password1" type="password">&nbsp;
       <input name="Submit" type="Submit" value="按钮">
     </form>

    2008年12月23日 3:41
    版主
  • 那我要传值该怎么办???

    2008年12月23日 3:47
  • 提交到相同页面是因为 form runat=server.关于这个特征,你需要了解asp.net的机制。
    传值的方法有多种:
    1.直接写在
    form runat=server表单里面,该页面可以收到
    2,如果要传到别的页面,可以做个隐藏的表单进行传值,如果是使用.NET2.0,则可以设置PostBackUrl设置传到别的页面。
    3,也可以在本页接收到参数后再服务器端进行 Transfer
    2008年12月23日 4:38
    版主
  •  

    我写了没用,请问隐藏的表单怎么写啊!!谢谢
    2008年12月23日 6:22
  • 简单的使用Session或者Request就可以了

     

    2008年12月26日 13:31
    版主