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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question about master pages

Status
Not open for further replies.

csphard

Programmer
Apr 5, 2002
194
US
I created a masterpage and created several pages using it.

Now here is the question. The master page has a form on it and I can not remove this.

When I am working with the pages that I created using this how do I access the form on that page so I can make changes to it because I do not see the form tag.

ie tell it I want to use post or get and what action.

I thought I could delete it from the masterpage and add it on the pages where I need it. When I do this
those pages error saying I need it for the ContentPlaceHolderID.

Also viewed the source and see the form tag, I just do not know how to access it in vwd on the page created using the master page


Help

Howard
 
1. create public members on the master form like
Code:
public void setlabeltextto(string text)
{
    mylabel.text = text;
}
2.on the webform you can then access this using
Code:
master.setlabeltextto("hello world);
then webform should contain something like
Code:
<%@Master Type = '~/mymasterpage.master" %>
at the top of the markup.

you may need to cast the master page in the webform to access the public member
Code:
((MyMasterPage)Master).setlabeltextto("hello world);

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top