runat="server"

G

Guest

Hi,

I have a BoundColumn in a DataGrid:

<asp:BoundColumn DataField="lastname" SortExpression="lastname"
ReadOnly="True" HeaderText="Last Name"></asp:BoundColumn>

Column is sorted. I am wondering why this code is working properly as there
is missing the statement runat="server".

When I click on a header of the column, the grid posts back to the server
and sorting is done. Why does it work without runat="server"? In my books is
always used runat=â€server†expression. Is it a preferable way?

Thanks,

Lubomir
 
D

David C

Notice that also missing is ID. It is really not a server side client to
which you can refer to in code.
 
S

Saravana

For asp:boundcolumn control, you dont require runat=server as it is enclosed
inside datagrid. You cant use asp:boundcolumn outside datagrid. So you need
not mention runat=server for asp:boundcolumn.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,163
Messages
2,570,897
Members
47,434
Latest member
TobiasLoan

Latest Threads

Top