CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   ASP.NET (http://www.codingforums.com/forumdisplay.php?f=40)
-   -   Relative path in gridview (http://www.codingforums.com/showthread.php?t=288261)

min222002 02-25-2013 04:31 PM

Relative path in gridview
 
Hello everyone,
Im trying to make the paths in gridview to be relative. The problem is that I cant get it to work with the standard ~something/whatever.aspx format. Here is the portion of the gridview that has the path (and the parameters I'm passing):

Code:

<asp:HyperLinkField DataNavigateUrlFields="AM RC,begin_dt,begin_dt"
                    DataNavigateUrlFormatString="http://randomsite.com/randompage.aspx?rc={0}&amp;begin={1}end={2}"
                    DataTextField="AM RC" HeaderText="AM RC" />

I would like to avoid code behind if possible just just in case here it is too in VB - no c# please:
Code:


Partial Class sc_am
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

    Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)

    End Sub
    Private Sub ExportToExcel(ByVal strFileName As String, ByVal dg As GridView)

        Response.Clear()
        Response.Buffer = True
        Response.ContentType = "application/vnd.ms-excel"
        Response.Charset = ""
        Me.EnableViewState = False
        Dim oStringWriter As New System.IO.StringWriter
        Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)

        GridView1.RenderControl(oHtmlTextWriter)

        Response.Write(oStringWriter.ToString())
        Response.[End]()


    End Sub

    Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
        ExportToExcel("FW_QSI_Report_Dir.xls", GridView1)
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub

    Protected Sub rc_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rc.TextChanged

    End Sub
End Class



All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.