15.08.2013 Views

Ektron CMS400.NET Developer Reference Manual

Ektron CMS400.NET Developer Reference Manual

Ektron CMS400.NET Developer Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Ektron</strong>.Cms.Controls.Search MySearch = new<br />

<strong>Ektron</strong>.Cms.Controls.Search();<br />

MySearch.Page = this;<br />

MySearch.Fill();<br />

Introduction to <strong>Ektron</strong> <strong>CMS400.NET</strong> Server Controls<br />

This relationship is only required when inserting a control in the<br />

code behind. When dragging and dropping, even if you make<br />

changes in code behind, the relationship is automatically<br />

generated.<br />

Customizing Server Controls<br />

NOTE<br />

Best Practice<br />

<strong>Ektron</strong> recommends including the page property reference when using<br />

the server controls as components in the code behind.<br />

One of Visual Studio .NET’s strengths is its separation of coding<br />

and logic from presentation. Web page formatting is handled by a<br />

page’s HTML, while the logic is handled by the code behind, which<br />

is stored in the corresponding .vb file. For example, if the ASP.NET<br />

page is mypage.aspx, the code behind file is mypage.aspx.vb.<br />

If you do not see the code behind files, click the Show All Files button on the VS<br />

.NET Solution Explorer toolbar.<br />

Within the vb file, you can use Visual Basic to insert code to<br />

manipulate the events that occur on the page.<br />

This subsection contains the following topics:<br />

• ”Recognizing the Server Control Within the HTML” on page 49<br />

• ”Recognizing the Server Control Within the Code Behind” on<br />

page 49<br />

• ”Customizing the Server Control in the Code Behind” on<br />

page 50<br />

<strong>Ektron</strong> <strong>CMS400.NET</strong> <strong>Developer</strong> <strong>Reference</strong> <strong>Manual</strong>, Version 5.1, Revision 5 48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!