G
Guest
Hi...
Can someone please tell me why my querystring isn't returning anything!
I have a called viewpage.aspx that contains a datagrid with the following
linkcolumn
<asp:hyperlinkcolumn DataNavigateUrlField="pageid"
DataNavigateUrlFormatString="editor.aspx?id={0}" Text="<img border=0
src=../images/edit.gif alt=Edit Page>">
When I run the code the id is sent to editor.aspx which is visable in the
address bar so I know it is working. However when I try to request the
querystring it returns rowID=0
WHY???
Would appritiate any advice... thanks
CODE..
Private rowID As Integer = 1
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Get Text for Editor
If Not Page.IsPostBack Then
rowID = CType(Request.QueryString(ID), Integer)
FreeTextBox1.Text = GetDocument()
End If
End Sub 'Page_Load
Public Sub Button_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
UpdateDocument(FreeTextBox1.Text)
End Sub 'Button_Click
Private Function GetDocument() As String
Dim ds As DataSet = GetDataSet(("SELECT content FROM tblPageContent
WHERE pageID=" + rowID.ToString()))
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
ds.Dispose()
End Function 'GetDocument
Can someone please tell me why my querystring isn't returning anything!
I have a called viewpage.aspx that contains a datagrid with the following
linkcolumn
<asp:hyperlinkcolumn DataNavigateUrlField="pageid"
DataNavigateUrlFormatString="editor.aspx?id={0}" Text="<img border=0
src=../images/edit.gif alt=Edit Page>">
When I run the code the id is sent to editor.aspx which is visable in the
address bar so I know it is working. However when I try to request the
querystring it returns rowID=0
WHY???
Would appritiate any advice... thanks
CODE..
Private rowID As Integer = 1
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Get Text for Editor
If Not Page.IsPostBack Then
rowID = CType(Request.QueryString(ID), Integer)
FreeTextBox1.Text = GetDocument()
End If
End Sub 'Page_Load
Public Sub Button_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
UpdateDocument(FreeTextBox1.Text)
End Sub 'Button_Click
Private Function GetDocument() As String
Dim ds As DataSet = GetDataSet(("SELECT content FROM tblPageContent
WHERE pageID=" + rowID.ToString()))
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
ds.Dispose()
End Function 'GetDocument