CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/19/2008 7:20:37 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
canalso
Asp.Net User
How do I use the public function I clarified in Master Page, and use it in other web forms?3/19/2008 7:20:37 AM

0/0

I have written a public function in Master Page's Code File, and would like to use it in other web form while i would like to get the label out of the function return.

Mark up:

  • I have placed the ClassName ="MasterPage" in Master Page's <%@  Master.. ClassName="MasterPage" %>
  • I have placed <%@ MasterType TypeName="Site.Master" in Web form used (or should i use VirtualPath instead?)

Error :

  • BC30456: 'RetrieveLanguageText' is not a member of 'System.Web.UI.MasterPage'.

Main.Master.vb (Site.Master's Code File)

Public Function RetrieveLanguageText(ByVal strlangfilename As String, ByVal strlangsession As String)Dim LangSetting As XmlLang01 = New XmlLang01

LangSetting.XmlLang(strlangfilename, strlangsession)

lblgreeting.Text = LangSetting.GetString("Greeting")

Return LangSetting

End Function

Webform's Code File

Protected WithEvents lblgreeting As System.Web.UI.WebControls.Label

Dim m As MasterPage = CType(Page.Master, MasterPage)

lblgreeting.Text = m.RetrieveLanguageText("languageLA.xml", LanguageValue)

Web form

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


. . : : LarnVok : : . .
siva_sm
Asp.Net User
Re: How do I use the public function I clarified in Master Page, and use it in other web forms?3/19/2008 7:55:50 AM

0/0

There is already a class named MasterPage in ASP.NET, the parent class for master pages. Give some other name for ClassName in the master page and use the same in CType and try.

Mark replies as answers if they helped you solve the problem.
canalso
Asp.Net User
Re: How do I use the public function I clarified in Master Page, and use it in other web forms?3/19/2008 8:04:07 AM

0/0

I have changed to MasterExample instead of MasterPage, i received this error

Error:

  • BC30002: Type 'MasterExample' is not defined.

However, any suggestions on using the public function from the master page is good.


. . : : LarnVok : : . .
Amanda Wang - M
Asp.Net User
Re: How do I use the public function I clarified in Master Page, and use it in other web forms?3/21/2008 6:45:29 AM

0/0

Hi,

canalso:
I have placed <%@ MasterType TypeName="Site.Master" in Web form used (or should i use VirtualPath instead?)

Do you have a try to use the VirtualPath instead? I test it by using VirtualPath, it works fine on my local.

 Because the VirtualPath attribute supports only a single master page. but TypeName is used to specify the name of the base class which the master page inherits from.

The more about the master page and the details, you can refer this article: http://www.odetocode.com/Articles/450.aspx 

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
canalso
Asp.Net User
Re: How do I use the public function I clarified in Master Page, and use it in other web forms?3/22/2008 2:38:19 AM

0/0

I used global assembly which suggested by other contributor's post on the other forum discussion to fix it already

 

Wink

  


. . : : LarnVok : : . .
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
How do I use the public function I clarified in Master Page, and ... I have written a public function in Master Page's Code File, and would like to use it in other web form while i would like to get the label ...
Building ASP.NET 2.0 Web Sites Using Web Standards In other words, you want to create a single page Master/Detail form (see Figure 11) ..... Both functions use a Web Service proxy class named AmazonServices. ...
.net_2.0 : Lets Talk ScriptManager On any of the web controls, user controls or other ContentPlaceHolders then .... I am not able to use scriptmanager on master page as well as .aspx pages ...
CodeProject: Adding attributes to the tag when using Master ... Web.UI.MasterPage { public HtmlGenericControl BodyTag { get { return ... Then somewhere in your Content Page's code behind file, use the Master Page's ...
Getting access to the Head tag in Master Pages - Rick Strahl's Web Log add this 2 functions to masterpage .cs file public void RegisterScriptSrc(string ... I don't know but why would you not use Page.RegisterClientScriptBlock() ...
- maxNet MPS shall not be responsible for the contents and offers of other Web sites ... of the authorization for use shall not require any special form and shall be ...
Microsoft SharePoint Designer Team Blog : Using Javascript to ... In most cases SharePoint pages are based on a master page that contains the ..... Look at this page and you'll see they use a Content Editor Web Part. ...
Chapter 8 Army Public Web Site Management Web site linking. Army public Web sites will follow these requirements when linking to other Web sites:. (1) Use only text or hyperlink text to direct users ...
CSLA .NET - How to use Windows Authentication with CSLA.NET? This project is using Forms Authentication, and I need to use Windows ..... store it in a session variable, and re-used in the Master Page, ...
page and scripting languages Resources | TechRepublic NET Web form. You may type the text directly within the page markup, use a .... or clarified how developers can use Java class files from other programming ...

Videos:
Long Beach City Council Meeting Long Beach City Council Meeting
Philip Pocock 100 Days 100 Guests event (Day 63) Documenta X 1997 Philip Pocock speaking at Documenta X about hypercinema and the collabortative work produced in Uganda by Documenta X - A Description of the Equator ...




Search This Site:










retirieve users password in database

adapter for asp:image control

bug on www.dotnetnuke.com

signcode error

problem creating forgot password facility using forma authentication.

master pages and forms, how to alter the default button

problem publishing site

visual studio 2005 and frontpage 2003

looking for a cheap host for a server i can play with i.e. install longhorn, etc

can't install 4.0.1

intranet web app - ad group checking

how to put scrollbars? but header of the gridview are not included....how?

2.1.2: whois online and membership info?

manual of dnn

rolling my own vs. 2.0 membership provider

content page layout changes when opening a new window

about create wizard control with aspnetdb

specific view based on login

class in ascx is not defined

admin portion ot ibuy

containers title box height

store + msde + vs.net debug error

how to use ie web controls in web matrix or dreamweaver?

setting the width of a menuitem

purging master page output?

sourcecode examples for webparts development

fail to get //loclahost/portalvbvs running

specified cast is not valid

custom type won't work in profile properties

conditional login????

 
All Times Are GMT