hello,
well, not easy to explain
lets assume, that i use an third party component (DbNetGrid) which is
implemented as a DHTML behaviour
(*.htc). This grid uses a compiled .Net assembly written in C# and using
ADO.NET to connect to the database.
Because this grid is implemented as DHTML behaviour it cannot be added to
the VS.NET toolbox. It can however still be used
within VS.NET projects.
#############
Adding DbNetGrid to a web page consists of 2 basic steps:
(1)
Define the HTML element that will act as the container for the grid. Any
HTML element that supports the innerHTML property can be used e.g <DIV> or
<TD>. The
element must have two properties set:
It must be given a unique 'id' value. This will allow it to be addressed
correctly when accessed from the client-side script.
The component must be attached to the element using the behavior property of
the style object. e.g.
<div id=dbnetgrid1 style='behavior:url(/dbnetgrid/dbnetgrid.htc)'></div>
The url given must correspond to the virtual directory in which DbNetGrid
has been installed. For example, the url for DbNetGrid.Net would typically
be /dbnetgrid/dbnetgrid.htc
If you create applications outside of the DbNetGrid installation folder you
do not need to copy any DbNetGrid files to your project folder. All
DbNetGrid functionality is reference by the full
path assigned to the url property of the behavior.
(2)
The second step is to use some client script to initialise any other
properties on the grid and call the loadData method to populate the grid.
This would typically be placed in a function
that is called by the onload event of the body tag. e.g.
....
<script language=JScript>
function initialise()
{
with (document.all.dbnetgrid1)
{
connectionString = "samples"
fromPart = "customers"
loadData()
}
}
</script>
</head>>
<body onload=initialise()>
....
#############
the whole grid is configured, initialized and controled via jscript on the
client. the problem now is that i have businesslogik which i want
to fire which has to act in relation with data located in the grid on the
client.
considering the fact, that this grid isn't instantiated in my aspx-page
during design time, i need the possibility to "interact" with this grid.
this means, that i explictly have to call functions which are implemented by
my ClassFileXYZ.aspx.cs, respectively
are located in the .net assembly-dll.
Lets say the user selects a record in the grid, clicks on a customized
grid-button and then a specific function (from my codebehind page)
should be called with the id of the selected record as parameter.
any further ideas?
tia
sandro