Repeater、Datalist等的超链接问题

在做毕业设计的时候,突然发现了一个棘手的问题,就是我用vs调试的时候,路径是对的,但是到了另一台服务器上时,我放在了IIs上,结果郁闷的时刻降临到了我这苦命的...身上,发现路径不对!

查了两天的资料终于、终于...了==!

实例如下:(自定义用户控件当中)

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ZhaoBiaoZhongBiaoMessage.ascx.vb"
    Inherits=".ZhaoBiaoZhongBiaoMessage" %>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1">
    <HeaderTemplate>
        <ul>
    </HeaderTemplate>
    <ItemTemplate>
        <li>
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#DataBinder.Eval(Container.DataItem,"ZBSN","~/Zhaobiao/LookZhaobiao.aspx?ZBSN={0:G}&Type=2")%>' ToolTip='<%# Eval("ZBTitle")%>' ><%#str(Eval("ZBTitle"), 13)%></asp:HyperLink>
        </li>
    </ItemTemplate>
    <FooterTemplate>
        <li><a id="A1" href="~/Zhaobiao/ZhaobiaoIndex.aspx" style="text-decoration: none" runat="server">更多...</a></li>
        </ul>
    </FooterTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="Getzhaobiao6"
    TypeName="Com.Hqnetsoft.B2b.Bll.zhaobiao"></asp:ObjectDataSource>

----------------------------

 

Public Partial Class ZhaoBiaoZhongBiaoMessage
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    Public Function str(ByVal myobj As String, ByVal count As Integer) As String
        Dim mystr As String = myobj.ToString()
        Dim returnstr As String = mystr
        If mystr.Length > count Then
            returnstr = mystr.Substring(0, count) + "......"
        End If
        Return returnstr
    End Function 
End Class

 

posted @ 2009-03-21 16:57  Devil_Zhang  阅读(268)  评论(0编辑  收藏  举报