Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

?web user control? on multiple pages

Status
Not open for further replies.

xenology

Programmer
May 22, 2002
51
US
Maybe I'm going about this the wrong way so please feel free to offer a better choice instead of solution...

I need a custom toolbar on several pages. The toolbar will have the same functionality on every page but handle data specific to that page. i.e. btnSave on person.aspx will need to verify name is populated and then issue query to save to person table. btnSave when on the product page will verify it's items then save to the product table.

I didn't want to have to build the same toolbar on every page so I built the web user control. I thought I could put something like Private Sub btnSave_onclick() on every page and that would handle it's own custom checking and procedures.

My problem is webform1.aspx cannot recognize btnSave or even the user control in code view (it will display the user control in the browser though). I tried a work around by placing Public Sub SaveNow() on the aspx and then usercontrol.ascx added
private sub btnSave_onclick()
call SaveNow()
end sub
but then the error is SaveNow is not declared.

As a final note, I got the usercontrol onto the web page by dragging it from the Solution Explorer onto the page (which resulted in it adding
<uc1:tb id="Tb1" runat="server"></uc1:tb>
to the page)

thnx!
-xeno
 
You need to write an event for the control, itself, and then wire that event to your page specific handler.

You need this extra level of indirection.

Here's some info:

They call the event BubbleClick, which you then wire up on the parent page.

enjoy.

-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top