0

I want to show a specific persons identity on an aspx page on page load (data includes photo, name, .. etc) On aspx page loading, handler file runs in backhand i fetch data from database, inside this handler file. i used handler, for to convert image; otherwise i would just use aspx page load. But had to return also other columns too for the specific record).

And gotto return data to aspx page and show in aspx controls like; image control, label control.. etc.

Is it possible to access an aspx page's server control id, from a generic handler ashx file? For example, inside ashx file, can i assign a value to a label control which belongs to an aspx page?

Or, are there any other ways to pass parameters to an aspx page from an ashx file? Simply, I want my ashx file return an object record to aspx page, and Show the record in asp.net controls.

perlynsparks
  • 401
  • 3
  • 7
  • 20
  • That doesn't make sense. The page is a type of handler and generally you only run one handler per HTTP request (unless you do Server.Transfer). How would the user see the page if he requests a handler and not the page. – Stilgar Jul 11 '14 at 23:37
  • The user see the aspx page. When the user open the aspx page, the handler runs backhand(i used handler because i fetch image from db, also have some other columns too other than image.) and supposed to show the record in aspx. Thats the reason i want to know if i could return an object from handler. (I use Handler for the first time. so sorry my mistakes). – perlynsparks Jul 11 '14 at 23:49
  • What is your use case? You want to display an image associated with other data in a page? – Stilgar Jul 12 '14 at 00:20
  • I changed the question a bit, can you please check it? – perlynsparks Jul 12 '14 at 09:51

1 Answers1

0

If you are showing the image and other data when the page "opens", you should just read the data from the database in the page load event, then update your page controls.

Nolo Problemo
  • 201
  • 3
  • 14
  • Yes, i already did that way no problems. So you say, it is unnecessary here to use a generic handler then.. Though i still wonder how to do, if it is necessary in a case which an ashx needs to pass a record data (a person object for example) to an aspx page.. – perlynsparks Jul 12 '14 at 09:30