Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-25-2013, 04:31 PM   PM User | #1
min222002
New Coder

 
Join Date: Feb 2013
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
min222002 is an unknown quantity at this point
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
min222002 is offline   Reply With Quote
Reply

Bookmarks

Tags
hyperlinks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Advertisement
Log in to turn off these ads.