Muhamad Jafarnejad
Muhamad Jafarnejad

Reputation: 2581

Access asp.net control in generic handler

There is a control in .aspx file:

<asp:Label ID="myLabel" runat="server" />

How can I access this label control from .ashx file ? (To read the label text for example)

Upvotes: 0

Views: 1185

Answers (1)

Aristos
Aristos

Reputation: 66641

You can not access anything from the one page to the other, from one handler to the other page.

You can direct send them, using POST, or GET.
Alternative you can send data from one page to the other, from a page to the handler, with session, using database, using cookies, etc.

But the most common way is the GET method, parameters on the url when you call the handler.

This is because each of the pages runs and ends on their time and the values there are not exist when the page ends.

Upvotes: 1

Related Questions