注册 登录
编程论坛 ASP.NET技术论坛

PostBackUrl传递参数的方法

水晶心 发布于 2010-11-22 22:39, 1580 次点击
我想在母版页利用 PostBackUrl这个属性传递一个ID参数到修改密码页面。不知道怎么传递,我在母版页做了个图像按钮连接到修改密码文件,可是需要传递登录人员的ID到修改密码文件,我不知道怎么写这个参数。
<td bgcolor="#9BCDFF" style="vertical-align: top; height: 39px; text-align: center; width: 192px;"><table width="213" height="128">
        <tbody>
          <tr>
            <td align="right" valign="bottom" style="width: 90px">用户:</td>
            <td align="left" valign="bottom"><asp:Label id="lblUserName" runat="server" ForeColor="Red"></asp:Label></td>
          </tr>
          <tr>
            <td align="right" style="width: 90px">角色:</td>
            <td align="left"><asp:Label id="lblRoleId" runat="server" ForeColor="Red"></asp:Label></td>
          </tr>
        </tbody>
      </table>
      <hr />
          <asp:TreeView ID="tvShow" runat="server" ExpandDepth="2">
          </asp:TreeView>
      </td>
      <td colspan="2" rowspan="3" style="vertical-align: top; width: 682px; text-align: center;">
      <table border="0" style="width: 814px" cellpadding="0" cellspacing="0">
          <tr align="center" style=" height:43px; background-image:url(<%=TemplateSourceDirectory %>/images/topback.gif)" >
            <td align="center" style="width: 120px; height: 43px;">
                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/home.jpg" Height="22px" Width="44px" /></td>
            <td align="center" style="width:  120px; height: 43px;">
                &nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/Relogin.jpg" Height="22px" Width="68px" PostBackUrl="Login.aspx" /></td>
            <td align="center" style="width: 120px; height: 43px;">
               <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/images/modifypass.jpg" Height="22px" Width="68px" PostBackUrl=/></td>
            <%--<td align="center" style="width:  120px; vertical-align: middle; text-align: center;">
                <asp:ImageButton ID="ImageButton4" runat="server" ImageUrl="~/images/hidetitle.jpg" Height="22px" Width="107px" />&nbsp;
            </td>--%>
红色字体就是那个图标按钮,其中PostBackUrl= 应该怎么写啊,请教各位高手,我想学习一下。能具体讲讲吗。
2 回复
#2
筱晓绾2010-11-23 12:52
母版页算是一个公共页面吧!不能指定某一个链接,除非你每个页面都要用到那个链接,如果是那样的话,那就在指定页面后加参数吧!
#3
水晶心2010-11-23 15:45
PostBackUrl=就是在这后面加文件路径和参数对吧,我知道怎样加文件路径,参数不会写,就想让这个修改密码图标链接到修改密码文件上,怎么传参数啊,帮帮我吧谢谢
1