Thanks David, but believe me I have searched everywhere for this!
Maybe its so basic that I can't see it. I managed to include links in
datagrid pages with no problem, but this is doing my head in.
The code here shows my data on the page sucessfully, but could you
show me how I amend it to show the link. Also, some fields are long
text with carriage returns. How do I show these properly formatted?
Thanks again
Leslie
=============================
<script runat="server">
Sub Page_Load (sender As Object, e As EventArgs)
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Dim rdr As OleDbDataReader
Dim strId As String
Dim strSQL As String
strId = Request.QueryString("id")
Conn = New OleDbConnection ("PROVIDER=SQLOLEDB;
server=servername;database=briefings;User Id=;Password=;")
Conn.open
strSQL = "SELECT * FROM Briefings WHERE id = " & strId & " "
cmd = New OleDbCommand(strSQL, conn)
rdr = cmd.ExecuteReader
If rdr.Read Then
litid.Text = rdr.Item("id")
litTitle.Text = rdr.Item("Title")
litEmail.Text = rdr.Item("Email")
litAddDate.Text = Format(rdr.Item("AddDate"), "dd-MMM-yyyy")
litContact.Text = rdr.Item("Contact")
litDetails.Text = rdr.Item("Details")
litAuthor.Text = rdr.Item("Author")
litWebsite.Text = rdr.Item("Website")
Else
litID.Text = "ID '" & strId & "' not found"
End If
rdr.Close
cmd.Dispose
conn.Close
End Sub
</script>
================================
Then in the html:
<asp:literal id="litWebsite" runat="server"></asp:literal>
================================
On Sat, 05 Jul 2003 23:53:02 GMT, "David Waz..." <dlw@pickpro.com>
[quoted text, click to view] wrote:
>uh, no that's not how to do it! :-)
>
><asp:LinkButton id="link1" runat=server />
>
>then, in your code-behind:
>
>at top:
>Protected link1 as LinkButton
>
>and finally, within your code - one way to do this:
>
>link1.text=o_dataRow.item("WebSite")
>
>That's it...
>
>PS: this is pretty basic stuff, not complicated. Glad to answer this kind
>of stuff, but you should have been able to find this in ANY beginner book on
>ASP.Net stuff. You should get and read oneofum...leswroteinmessagenewss0legvo091p23o389cp0vtevmddtmq9r09@4ax.zl6...I'mnewtoasp.net.refugeefromoldaspIhaveadatabasefieldWebsite,whichisaurlandIwantitbeahyperlink.Icandisplaytheurlastextusingaspliteral id="litWebsite" runat="server"></asp:literal>
>>
>> But I want it to be a hyperlink. I tried enclosing the above line in
>> an <a href......> tag but no good.
>>
>> Any tips for a newbie??
>> Thanks
>> Leslie
>