J
James R. Davis
A complete newbie here (to ASP.NET) though lots of years of ASP programming.
Still, some things are not yet very obvious to me.
I have a SQL table that includes a TEXT field that often exceeds 20,000
bytes in size. Each such field contains an HTML page that I want to render
for my users via a Formview.
The problem is that within that field some of the tags are in forum format
instead of HTML format. For example, an IMG tage is "" instead of
"<IMG src ..." format.
So, I believe what I must do is create a control that is given control at
databound time (FormView1_DataBound) and in that control I will do so
replace string manipulations.
Of all the silly things to get in the way I cannot seem to find a way to get
to that field.
The formview looks like this:
--------------------------------------------
<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Tip Article"
%>
<script runat="server">
Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs)
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<BR />
<div class="fullwidth">
<h2>
<%
Dim Num As Integer
Num = Request.QueryString("Num")
%>
<asp:FormView ID="FormView1" runat="server"
DataSourceID="SqlDataSource1" OnDataBound="FormView1_DataBound">
<ItemTemplate>
<asp:Label ID="T_MESSAGELabel" runat="server"
Text='<%# Bind("T_MESSAGE") %>'></asp:Label><br />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MTT.mdfConnectionString %>"
SelectCommand="SELECT [T_MESSAGE] FROM [forum_topics]
WHERE ([T_SUBJECT] LIKE @T_SUBJECT + '%')">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="001"
Name="T_SUBJECT" QueryStringField="Num"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</h2>
<p>
</div>
</asp:Content>
----------
As you can see, the field name is "T_MESSAGE".
How do I get to it within the FormView1_DataBound Sub?
Thank you for any assistance.
Still, some things are not yet very obvious to me.
I have a SQL table that includes a TEXT field that often exceeds 20,000
bytes in size. Each such field contains an HTML page that I want to render
for my users via a Formview.
The problem is that within that field some of the tags are in forum format
instead of HTML format. For example, an IMG tage is "" instead of
"<IMG src ..." format.
So, I believe what I must do is create a control that is given control at
databound time (FormView1_DataBound) and in that control I will do so
replace string manipulations.
Of all the silly things to get in the way I cannot seem to find a way to get
to that field.
The formview looks like this:
--------------------------------------------
<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Tip Article"
%>
<script runat="server">
Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs)
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<BR />
<div class="fullwidth">
<h2>
<%
Dim Num As Integer
Num = Request.QueryString("Num")
%>
<asp:FormView ID="FormView1" runat="server"
DataSourceID="SqlDataSource1" OnDataBound="FormView1_DataBound">
<ItemTemplate>
<asp:Label ID="T_MESSAGELabel" runat="server"
Text='<%# Bind("T_MESSAGE") %>'></asp:Label><br />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MTT.mdfConnectionString %>"
SelectCommand="SELECT [T_MESSAGE] FROM [forum_topics]
WHERE ([T_SUBJECT] LIKE @T_SUBJECT + '%')">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="001"
Name="T_SUBJECT" QueryStringField="Num"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</h2>
<p>
</div>
</asp:Content>
----------
As you can see, the field name is "T_MESSAGE".
How do I get to it within the FormView1_DataBound Sub?
Thank you for any assistance.