IRowConsumer webpart runat client

From: Ivan Pololi (a_at_a.it)
Date: 01/24/05


Date: Mon, 24 Jan 2005 17:09:08 +0100

Hello,

I'm a newbie developer in .NET.

I'm struggling to find examples of Connectable Webparts written in VB
.NET...I've found lot of stuff in C# but I'm not very good at that language.

I've used a web tool to translate the following C# code in VB.NET.

When I put my webpart on my page, the C# works well, while the VB.NET gives
me an error: "RowConsumerInterfaceWPQ3 not defined".

Anybody can help me with this example or just a simple example in VB .NET
(with runat client because i'm using an OWC Pivottable to interface).

Thank you very much for your help,
Ivan Pololi
Italy

[C# original code]

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint.WebPartPages.Communication;
using System.Data;
using System.Runtime.InteropServices;

namespace MyWebParts
{
 /// <summary>
 /// Summary description for RowConsumer.
 /// </summary>
 [GuidAttribute("66C28F7F-9B1E-4ba4-B16F-FCF391088C57")]
 [ToolboxData("<{0}:RowConnectedConsumer
runat=server></{0}:RowConnectedConsumer>")]
 public class RowConnectedConsumer : WebPart, IRowConsumer
 {
  //Used to keep track of whether or not the connection will be running
client-side
  private bool _runAtClient = false;

  //Keep a count of IRow connections
  private int _rowConnectedCount = 0;

  //Web Part UI
  private DataGrid _dataGrid;

  /// <summary>
  ///----Notification to the Web Part that is should ensure that all
  ///----its interfaces are registered using RegisterInterface.
  /// </summary>
  public override void EnsureInterfaces()
  {
   //Register the IRowConsumer interface
   RegisterInterface("MyRowConsumerInterface_WPQ_", //InterfaceName:
Friendly name of the interface

    "IRowConsumer", //InterfaceType: The type of
the interface

    WebPart.UnlimitedConnections, //MaxConnections: sets how
many connections can
    //be formed on this interface

    ConnectionRunAt.ServerAndClient, //RunAtOptions: where the
interface can be run

    this, //InterfaceObject: reference
to the actual
    //object that implements this interface

    "RowConsumerInterface_WPQ_", //InterfaceClientReference: for
client-side connections, a
    //string that is used as the identifier for the client-side
    //object that implements this interface

    "MyRowConsumer", //MenuLabel: a general label
for the interface
    //(used in Authoring Connections)

    "Just a simple IRowConsumer"); //Description: an extended
explanation of the
   //interface (used in Authoring Connections)
  }

  /// <summary>
  ///----Called by the framework to determine whether a part thinks
  ///----that it can be run on the client or server based on the current
  ///----configuration.
  /// </summary>

  public override ConnectionRunAt CanRunAt()
  {
   //This Web Part can run on both the client and the server
   return ConnectionRunAt.ServerAndClient;
  }

  /// <summary>
  ///----Notification to the Web Part that it has been connected. The
  ///----framework uses this to inform a part that it is connected as
  ///----soon as it connects up the appropriate events for the connection.
  /// </summary>
  public override void PartCommunicationConnect(string interfaceName,
   WebPart connectedPart,
   string connectedInterfaceName,
   ConnectionRunAt runAt)
  {
   //Check if this is my particular cell interface
   if (interfaceName == "MyRowConsumerInterface_WPQ_")
   {
    //Keep a count of the connections
    _rowConnectedCount++;
   }

   //Check to see if this is a client-side part
   if (runAt == ConnectionRunAt.Client)
   {
    //This is a client-side part
    _runAtClient = true;
    return;
   }

   //Must be a server-side part so need to create the Web Part's controls
   EnsureChildControls();
  }

  //PartCommunicationInit and PartCommunicationMain are not needed in this
case for the Consumer,
  //because the Consumer doesn't have any events that it needs to fire
  //during either of these phases.

  //GetInitArgs is not needed in this case because IRowConsumer never
  //requires a transformer

  //PartCommunicationNeedData, BeginDataRetrieval, and EndDataRetrieval are
not
  //needed for this Web Part because it doesn't have to do any asynchronous
  //data fetching.

  /// <summary>
  /// The RowProviderInit event handler.
  /// The Provider part will fire this event during its
PartCommunicationInit phase
  /// </summary>
  public void RowProviderInit(object sender, RowProviderInitEventArgs
rowProviderInitArgs)
  {
   //This is where the Consumer part could see what type of "Row" the
Provider
   //will be sending.

   //Need to ensure that all of the Web Part's controls are created
   EnsureChildControls();

   //Need to add the columns to the DataGrid source table
   for(int i = 0; i <= rowProviderInitArgs.FieldList.GetUpperBound(0); i++)
   {
    // Add a column object to the table
    DataColumn dataColumn = new DataColumn();
    dataColumn.ColumnName = rowProviderInitArgs.FieldList[i];
    if(rowProviderInitArgs.FieldDisplayList != null)
    {
     dataColumn.Caption = rowProviderInitArgs.FieldDisplayList[i];
    }
    ((DataTable)_dataGrid.DataSource).Columns.Add(dataColumn);
   }

   //Bind the data grid
   _dataGrid.DataBind();
  }

  /// <summary>
  /// The RowReady event handler.
  /// The Provider part will fire this event during its
PartCommunicationMain phase
  /// </summary>
  /// <param name="sender">Provider Web Part</param>
  /// <param name="rowReadyArgs">The args passed by the Provider</param>
  public void RowReady(object sender, RowReadyEventArgs rowReadyArgs)
  {
   //Add the Rows that were passed by the Provider to the DataGrid's
   //source table
   if(rowReadyArgs.Rows != null)
   {
    if(rowReadyArgs.Rows[0] != null)
    {
     for(int i = 0; i <= rowReadyArgs.Rows.GetUpperBound(0); i++)
     {
      object[] rowItems = rowReadyArgs.Rows[i].ItemArray;
      DataRow dr = ((DataTable)_dataGrid.DataSource).NewRow();
      dr.ItemArray = rowItems;
      ((DataTable)_dataGrid.DataSource).Rows.Add(dr);
     }

     //Bind the data grid
     _dataGrid.DataBind();
    }
   }
  }

  /// <summary>
  /// Render this Web Part control to the output parameter specified.
  /// </summary>
  /// <param name="output"> The HTML writer to write out to </param>
  protected override void RenderWebPart(HtmlTextWriter output)
  {
   //Need to ensure that all of the Web Part's controls are created
   EnsureChildControls();

   //Is it connected?
   if(_rowConnectedCount > 0)
   {
    //Render client connection code if the connection is client-side
    if (_runAtClient)
    {
     output.Write(ReplaceTokens("<br><B>Connected: Client-Side</b><br>"
      + "<DIV ID='DataTable_WPQ_'></DIV>\n"
      + "<div id=\"FieldList_WPQ_\">Field List: </div>\n"
      + "<div id=\"FieldDisplayList_WPQ_\">Field Display List: </div>\n"

      + "<SCRIPT LANGUAGE='JavaScript'>\n"
      + "<!-- \n"
      + " var RowConsumerInterface_WPQ_ = new Consumer_WPQ_();\n"
      + " var rowFieldNames_WPQ_;\n"
      + " var tableHTML = '';\n"

      + " function Consumer_WPQ_()\n"
      + " {\n"
      + " this.RowProviderInit = RowProviderInit_WPQ_;\n"
      + " this.RowReady = RowReady_WPQ_;\n"
      + " }\n"

      + " function RowProviderInit_WPQ_(sender, rowProviderInitArgs)\n"
      + " {\n"
      + " var adBSTR = 8;\n"
      + " var columnCount;\n"
      + " if(rowProviderInitArgs.FieldDisplayList != null)\n"
      + " {\n"
      + " columnCount =
rowProviderInitArgs.FieldDisplayList.length;\n"
      + " rowFieldNames_WPQ_ =
rowProviderInitArgs.FieldDisplayList;\n"
      + " }\n"
      + " else\n"
      + " {\n"
      + " columnCount = rowProviderInitArgs.FieldList.length;\n"
      + " rowFieldNames_WPQ_ = rowProviderInitArgs.FieldList;\n"
      + " }\n"

      + " document.all(\"FieldList_WPQ_\").innerHTML = \"Field List:
\";\n"
      + " document.all(\"FieldDisplayList_WPQ_\").innerHTML = \"Field
Display List: \";\n"

      + " if(rowProviderInitArgs.FieldList != null)\n"
      + " {\n"
      + " for(var i = 0; i < rowProviderInitArgs.FieldList.length;
i++)\n"
      + " {\n"
      + " document.all(\"FieldList_WPQ_\").innerHTML +=
rowProviderInitArgs.FieldList[i] + \";\";\n"
      + " }\n"
      + " }\n"
      + " else\n"
      + " {\n"
      + " document.all(\"FieldList_WPQ_\").innerHTML +=
\"NULL\";\n"
      + " }\n"

      + " if(rowProviderInitArgs.FieldDisplayList != null)\n"
      + " {\n"
      + " for(var i = 0; i <
rowProviderInitArgs.FieldDisplayList.length; i++)\n"
      + " {\n"
      + " document.all(\"FieldDisplayList_WPQ_\").innerHTML +=
rowProviderInitArgs.FieldDisplayList[i] + \";\";\n"
      + " }\n"
      + " }\n"
      + " else\n"
      + " {\n"
      + " document.all(\"FieldDisplayList_WPQ_\").innerHTML +=
\"NULL\";\n"
      + " }\n"

      + " RenderTable_WPQ_(null, true);\n"
      + " }\n"

      + " function RowReady_WPQ_(sender, rowReadyArgs)\n"
      + " {\n"
      + " RenderTable_WPQ_(rowReadyArgs.Rows, false);\n"
      + " document.all('DataTable_WPQ_').innerHTML +=
'<P>SelectionStatus: ' + rowReadyArgs.SelectionStatus + '</P>';\n"
      + " }\n"

      + " function RenderTable_WPQ_(dataTable, emptyTable)\n"
      + " {\n"
      + " tableHTML = '<TABLE BORDER=1
style=background-color:lightgreen;font:10pt Verdana bold;><TR>';\n"
      + " for(var i = 0; i < rowFieldNames_WPQ_.length; i++)\n"
      + " {\n"
      + " tableHTML += '<TH>';\n"
      + " tableHTML += rowFieldNames_WPQ_[i];\n"
      + " tableHTML += '</TH>';\n"
      + " }\n"
      + " tableHTML += '</TR>';\n"

      + " if(!emptyTable)\n"
      + " {\n"
      + " if(!dataTable.EOF || ! dataTable.BOF)\n"
      + " {\n"
      + " var columnCount = dataTable.Fields.Count;\n"
      + " dataTable.MoveFirst();\n"
      + " do\n"
      + " {\n"
      + " tableHTML += '<TR>';\n"
      + " for(var i = 0; i < columnCount; i++)\n"
      + " {\n"
      + " tableHTML += '<TD>';\n"
      + " tableHTML += dataTable.Fields(i).Value;\n"
      + " tableHTML += '</TD>';\n"
      + " }\n"
      + " tableHTML += '</TR>';\n"
      + " dataTable.MoveNext();\n"
      + " }\n"
      + " while(!dataTable.EOF);\n"
      + " }\n"
      + " }\n"

      + " tableHTML += '</TABLE>';\n"
      + " document.all('DataTable_WPQ_').innerHTML = tableHTML;\n"
      + " }\n"
      + "//-->\n"
      + "</SCRIPT>\n"));
    }
    else
    {
     //Just render some informational text
     output.RenderBeginTag(HtmlTextWriterTag.Br);
     output.RenderEndTag();
     output.RenderBeginTag(HtmlTextWriterTag.H5);
     output.Write("Connected Server-Side");
     output.RenderEndTag();
     output.RenderBeginTag(HtmlTextWriterTag.Br);
     output.RenderEndTag();

     //Render the DataGrid control
     _dataGrid.RenderControl(output);
    }
   }
   else
   {
    //There wasn't a row connection formed,
    //so just output a message
    output.Write("NO ROW INTERFACE CONNECTION");
   }
  }

  /// <summary>
  /// Create all of the controls for this Web Part
  /// </summary>
  protected override void CreateChildControls()
  {
   //Create the DataGrid
   _dataGrid = new DataGrid();

   //Create the DataTable
   DataTable dataTable = new DataTable();

   //Set the DataGrid's DataSource
   _dataGrid.DataSource = dataTable;
   _dataGrid.ID = "DataGrid";
  }
 }
}

[VB .NET translated code]

Imports System

Imports System.Web.UI

Imports System.Web.UI.WebControls

Imports System.ComponentModel

Imports Microsoft.SharePoint.WebPartPages

Imports Microsoft.SharePoint.WebPartPages.Communication

Imports System.Data

Imports System.Runtime.InteropServices

Namespace MenuWebPart

'/ <summary>

'/ Summary description for RowConsumer.

'/ </summary>

Public Class RowConnectedConsumer

Inherits WebPart

Implements IRowConsumer 'ToDo: Add Implements Clauses for implementation
methods of these interface(s)

'Used to keep track of whether or not the connection will be running
client-side

Private _runAtClient As Boolean = False

'Keep a count of IRow connections

Private _rowConnectedCount As Integer = 0

'Web Part UI

Private _dataGrid As DataGrid

'/ <summary>

'/----Notification to the Web Part that is should ensure that all

'/----its interfaces are registered using RegisterInterface.

'/ </summary>

Public Overrides Sub EnsureInterfaces()

'Register the IRowConsumer interface

RegisterInterface("MyRowConsumerInterface_WPQ_", "IRowConsumer",
WebPart.UnlimitedConnections, ConnectionRunAt.ServerAndClient, Me,
"RowConsumerInterface_WPQ_", "MyRowConsumer", "Just a simple IRowConsumer")
'InterfaceName: Friendly name of the interface

End Sub 'EnsureInterfaces

'InterfaceType: The type of the interface

'MaxConnections: sets how many connections can

'be formed on this interface

'RunAtOptions: where the interface can be run

'InterfaceObject: reference to the actual

'object that implements this interface

'InterfaceClientReference: for client-side connections, a

'string that is used as the identifier for the client-side

'object that implements this interface

'MenuLabel: a general label for the interface

'(used in Authoring Connections)

'Description: an extended explanation of the

'interface (used in Authoring Connections)

'/ <summary>

'/----Called by the framework to determine whether a part thinks

'/----that it can be run on the client or server based on the current

'/----configuration.

'/ </summary>

Public Overrides Function CanRunAt() As ConnectionRunAt

'This Web Part can run on both the client and the server

Return ConnectionRunAt.ServerAndClient

End Function 'CanRunAt

'/ <summary>

'/----Notification to the Web Part that it has been connected. The

'/----framework uses this to inform a part that it is connected as

'/----soon as it connects up the appropriate events for the connection.

'/ </summary>

Public Overrides Sub PartCommunicationConnect(ByVal interfaceName As String,
ByVal connectedPart As WebPart, ByVal connectedInterfaceName As String,
ByVal runAt As ConnectionRunAt)

'Check if this is my particular cell interface

If interfaceName = "MyRowConsumerInterface_WPQ_" Then

'Keep a count of the connections

_rowConnectedCount += 1

End If

'Check to see if this is a client-side part

If runAt = ConnectionRunAt.Client Then

'This is a client-side part

_runAtClient = True

Return

End If

'Must be a server-side part so need to create the Web Part's controls

EnsureChildControls()

End Sub 'PartCommunicationConnect

'PartCommunicationInit and PartCommunicationMain are not needed in this case
for the Consumer,

'because the Consumer doesn't have any events that it needs to fire

'during either of these phases.

'GetInitArgs is not needed in this case because IRowConsumer never

'requires a transformer

'PartCommunicationNeedData, BeginDataRetrieval, and EndDataRetrieval are not

'needed for this Web Part because it doesn't have to do any asynchronous

'data fetching.

'/ <summary>

'/ The RowProviderInit event handler.

'/ The Provider part will fire this event during its PartCommunicationInit
phase

'/ </summary>

Public Sub RowProviderInit(ByVal sender As Object, ByVal rowProviderInitArgs
As RowProviderInitEventArgs) Implements IRowConsumer.RowProviderInit

'This is where the Consumer part could see what type of "Row" the Provider

'will be sending.

'Need to ensure that all of the Web Part's controls are created

EnsureChildControls()

'Need to add the columns to the DataGrid source table

Dim i As Integer

For i = 0 To rowProviderInitArgs.FieldList.GetUpperBound(0)

' Add a column object to the table

Dim dataColumn As New DataColumn

dataColumn.ColumnName = rowProviderInitArgs.FieldList(i)

If Not (rowProviderInitArgs.FieldDisplayList Is Nothing) Then

dataColumn.Caption = rowProviderInitArgs.FieldDisplayList(i)

End If

CType(_dataGrid.DataSource, DataTable).Columns.Add(dataColumn)

Next i

'Bind the data grid

_dataGrid.DataBind()

End Sub 'RowProviderInit

'/ <summary>

'/ The RowReady event handler.

'/ The Provider part will fire this event during its PartCommunicationMain
phase

'/ </summary>

'/ <param name="sender">Provider Web Part</param>

'/ <param name="rowReadyArgs">The args passed by the Provider</param>

Public Sub RowReady(ByVal sender As Object, ByVal rowReadyArgs As
RowReadyEventArgs) Implements IRowConsumer.RowReady

'Add the Rows that were passed by the Provider to the DataGrid's

'source table

If Not (rowReadyArgs.Rows Is Nothing) Then

If Not (rowReadyArgs.Rows(0) Is Nothing) Then

Dim i As Integer

For i = 0 To rowReadyArgs.Rows.GetUpperBound(0)

Dim rowItems As Object() = rowReadyArgs.Rows(i).ItemArray

Dim dr As DataRow = CType(_dataGrid.DataSource, DataTable).NewRow()

dr.ItemArray = rowItems

CType(_dataGrid.DataSource, DataTable).Rows.Add(dr)

Next i

'Bind the data grid

_dataGrid.DataBind()

End If

End If

End Sub 'RowReady

'/ <summary>

'/ Render this Web Part control to the output parameter specified.

'/ </summary>

'/ <param name="output"> The HTML writer to write out to </param>

Protected Overrides Sub RenderWebPart(ByVal output As HtmlTextWriter)

'Need to ensure that all of the Web Part's controls are created

EnsureChildControls()

'Is it connected?

If _rowConnectedCount > 0 Then

'Render client connection code if the connection is client-side

If _runAtClient Then

output.Write(ReplaceTokens(("<br><B>Connected: Client-Side</b><br>" + "<DIV
ID='DataTable_WPQ_'></DIV>" + ControlChars.Lf + "<div
id=""FieldList_WPQ_"">Field List: </div>" + ControlChars.Lf + "<div
id=""FieldDisplayList_WPQ_"">Field Display List: </div>" + ControlChars.Lf +
"<SCRIPT LANGUAGE='JavaScript'>" + ControlChars.Lf + "<!-- " +
ControlChars.Lf + " var RowConsumerInterface_WPQ_ = new Consumer_WPQ_();" +
ControlChars.Lf + " var rowFieldNames_WPQ_;" + ControlChars.Lf + " var
tableHTML = '';" + ControlChars.Lf + " function Consumer_WPQ_()" +
ControlChars.Lf + " {" + ControlChars.Lf + " this.RowProviderInit =
RowProviderInit_WPQ_;" + ControlChars.Lf + " this.RowReady = RowReady_WPQ_;"
+ ControlChars.Lf + " }" + ControlChars.Lf + " function
RowProviderInit_WPQ_(sender, rowProviderInitArgs)" + ControlChars.Lf + " {"
+ ControlChars.Lf + " var adBSTR = 8;" + ControlChars.Lf + " var
columnCount;" + ControlChars.Lf + " if(rowProviderInitArgs.FieldDisplayList
!= null)" + ControlChars.Lf + " {" + ControlChars.Lf + " columnCount =
rowProviderInitArgs.FieldDisplayList.length;" + ControlChars.Lf + "
rowFieldNames_WPQ_ = rowProviderInitArgs.FieldDisplayList;" +
ControlChars.Lf + " }" + ControlChars.Lf + " else" + ControlChars.Lf + " {"
+ ControlChars.Lf + " columnCount = rowProviderInitArgs.FieldList.length;" +
ControlChars.Lf + " rowFieldNames_WPQ_ = rowProviderInitArgs.FieldList;" +
ControlChars.Lf + " }" + ControlChars.Lf + "
document.all(""FieldList_WPQ_"").innerHTML = ""Field List: "";" +
ControlChars.Lf + " document.all(""FieldDisplayList_WPQ_"").innerHTML =
""Field Display List: "";" + ControlChars.Lf + "
if(rowProviderInitArgs.FieldList != null)" + ControlChars.Lf + " {" +
ControlChars.Lf + " for(var i = 0; i < rowProviderInitArgs.FieldList.length;
i++)" + ControlChars.Lf + " {" + ControlChars.Lf + "
document.all(""FieldList_WPQ_"").innerHTML +=
rowProviderInitArgs.FieldList[i];"";" + ControlChars.Lf + " }" +
ControlChars.Lf + " }" + ControlChars.Lf + " else" + ControlChars.Lf + " {"
+ ControlChars.Lf + " document.all(""FieldList_WPQ_"").innerHTML +=
""NULL"";" + ControlChars.Lf + " }" + ControlChars.Lf + "
if(rowProviderInitArgs.FieldDisplayList != null)" + ControlChars.Lf + " {" +
ControlChars.Lf + " for(var i = 0; i <
rowProviderInitArgs.FieldDisplayList.length; i++)" + ControlChars.Lf + " {"
+ ControlChars.Lf + " document.all(""FieldDisplayList_WPQ_"").innerHTML +=
rowProviderInitArgs.FieldDisplayList[i];"";" + ControlChars.Lf + " }" +
ControlChars.Lf + " }" + ControlChars.Lf + " else" + ControlChars.Lf + " {"
+ ControlChars.Lf + " document.all(""FieldDisplayList_WPQ_"").innerHTML +=
""NULL"";" + ControlChars.Lf + " }" + ControlChars.Lf + "
RenderTable_WPQ_(null, true);" + ControlChars.Lf + " }" + ControlChars.Lf +
" function RowReady_WPQ_(sender, rowReadyArgs)" + ControlChars.Lf + " {" +
ControlChars.Lf + " RenderTable_WPQ_(rowReadyArgs.Rows, false);" +
ControlChars.Lf + " document.all('DataTable_WPQ_').innerHTML +=
'<P>SelectionStatus: ' + rowReadyArgs.SelectionStatus + '</P>';" +
ControlChars.Lf + " }" + ControlChars.Lf + " function
RenderTable_WPQ_(dataTable, emptyTable)" + ControlChars.Lf + " {" +
ControlChars.Lf + " tableHTML = '<TABLE BORDER=1
style=background-color:lightgreen;font:10pt Verdana bold;><TR>';" +
ControlChars.Lf + " for(var i = 0; i < rowFieldNames_WPQ_.length; i++)" +
ControlChars.Lf + " {" + ControlChars.Lf + " tableHTML += '<TH>';" +
ControlChars.Lf + " tableHTML += rowFieldNames_WPQ_[i];" + ControlChars.Lf +
" tableHTML += '</TH>';" + ControlChars.Lf + " }" + ControlChars.Lf + "
tableHTML += '</TR>';" + ControlChars.Lf + " if(!emptyTable)" +
ControlChars.Lf + " {" + ControlChars.Lf + " if(!dataTable.EOF || !
dataTable.BOF)" + ControlChars.Lf + " {" + ControlChars.Lf + " var
columnCount = dataTable.Fields.Count;" + ControlChars.Lf + "
dataTable.MoveFirst();" + ControlChars.Lf + " do" + ControlChars.Lf + " {" +
ControlChars.Lf + " tableHTML += '<TR>';" + ControlChars.Lf + " for(var i =
0; i < columnCount; i++)" + ControlChars.Lf + " {" + ControlChars.Lf + "
tableHTML += '<TD>';" + ControlChars.Lf + " tableHTML +=
dataTable.Fields(i).Value;" + ControlChars.Lf + " tableHTML += '</TD>';" +
ControlChars.Lf + " }" + ControlChars.Lf + " tableHTML += '</TR>';" +
ControlChars.Lf + " dataTable.MoveNext();" + ControlChars.Lf + " }" +
ControlChars.Lf + " while(!dataTable.EOF);" + ControlChars.Lf + " }" +
ControlChars.Lf + " }" + ControlChars.Lf + " tableHTML += '</TABLE>';" +
ControlChars.Lf + " document.all('DataTable_WPQ_').innerHTML = tableHTML;" +
ControlChars.Lf + " }" + ControlChars.Lf + "//-->" + ControlChars.Lf +
"</SCRIPT>" + ControlChars.Lf)))

Else

'Just render some informational text

output.RenderBeginTag(HtmlTextWriterTag.Br)

output.RenderEndTag()

output.RenderBeginTag(HtmlTextWriterTag.H5)

output.Write("Connected Server-Side")

output.RenderEndTag()

output.RenderBeginTag(HtmlTextWriterTag.Br)

output.RenderEndTag()

'Render the DataGrid control

_dataGrid.RenderControl(output)

End If

Else

'There wasn't a row connection formed,

'so just output a message

output.Write("NO ROW INTERFACE CONNECTION")

End If

End Sub 'RenderWebPart

'/ <summary>

'/ Create all of the controls for this Web Part

'/ </summary>

Protected Overrides Sub CreateChildControls()

'Create the DataGrid

_dataGrid = New DataGrid

'Create the DataTable

Dim dataTable As New DataTable

'Set the DataGrid's DataSource

_dataGrid.DataSource = dataTable

_dataGrid.ID = "DataGrid"

End Sub 'CreateChildControls

End Class 'RowConnectedConsumer

End Namespace 'MyWebParts



Relevant Pages

  • Re: NAT with IP Filters
    ... Static NAT (inbound) connection on purpose. ... you have disabled the firewall if you aren't filtering specific ports. ... interface, but this is far more tedious than simply telling the routing ... are fine except that they don't allow outgoing connections via e.g. TCP ...
    (microsoft.public.windows.server.networking)
  • Re: NAT with IP Filters
    ... connections which I mean, from a private interface). ... Static NAT connection on purpose. ... you have disabled the firewall if you aren't filtering specific ports. ...
    (microsoft.public.windows.server.networking)
  • Re: Network Setup Advice
    ... This lets inbound connections work for mail, ... lest you have the neighborhood skript-kiddy surfing pr0n and sending ... and that is going to have to be the route ... are going to have considerable confusion over which interface to use. ...
    (comp.os.linux.networking)
  • Re: New to IPFW and would like critique...
    ... The firewall ... You log a *lot* of types of connections that aren't particularly ... > # Outside interface network and netmask and ip ... packet coming from a port 53 and going to, say, port 137. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Port Forwarding Question
    ... I have a router with 2 interfaces. ... to the internet and the other interface connected to my LAN. ... forwarding for http trafficto a specific IP address in my LAN. ...
    (microsoft.public.windows.server.general)