hyperlink column in datagrid in web user control

M

mimi

I need 2 different view on spending report for accounting and user. To
accomplish it, I create 2 aspx page AccRpt and UserRpt.

I created a web user control called summary.ascx. In the control, there is
a datagrid which contain a hyperlink column to go to spending detail.

Both AccRpt.aspx and UserRpt.aspx contain summary.ascx.

The web folder structures is:

/Application
/Accounting
/User
/Controls

If an accountant clicks on the link, it should go to accounting/detail.aspx
page. If a regular user clicks, it's supposed to go to user/details.aspx
page

How can I specify the link in the web user control? Thanks
 
S

souri challa

Create a public property in your user control that can set the
Hyperlink control to a given value. Now from your container pages,
setup this URL via the property.
You can ofcourse directly expose the hyperlink in the usercontrol by
making it public, or use 'FindControl' method from the parent pages.
Using a property like above is a better encapsulated way of doing it.
 

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
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top