This may be the way things look.
Yesterday, I looked at dnn and made a Google search. Today, I want to complete the search. I must use Google's wsdland use wsdl.exe to generate a C #CodeIn the result, there is a resultelement array, and we need to bind it with the DataGrid. Why not bother writing paging?
So with the following code
Googlesearchservice Service = New Googlesearchservice ();
Googlesearchresult result = Service. dogooglesearch (configurationsettings. deleetask [ " Googlekey " ],
This . Querytextbox. Text,
0 ,
10 ,
False ,
"" ,
False ,
"" ,
" UTF-8 " ,
" UTF-8 " );
This . Resultlist. datasource = Result. resultelements;
This . Resultlist. databind ();
The binding format is as follows: <% # databinder. eval (container. dataitem, "summary") %>
Summary is a field of resultelement. You can't get it. Instead, you have to create a new project and try how to bind it.
This . Resultlist. datasource = New Theelement [] {
New Theelement (),
New Theelement (),
New Theelement (),
New Theelement (),
New Theelement (),
New Theelement ()
} ;
This . Resultlist. databind ();
When theelement class is defined like this, an exception occurs.
Public Class Theelement
{
Public StringHello= "Hello";
}
When theelement class is defined like this, OK.
Public Class Theelement
{
Public String Hello
{
Get
{
Return "Hello";
}
}
}
Why not bind a field.