CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
web_forms
getting_started
data_presentation_controls
dotnetnuke
data_access-sql_server_sql_server_express_and_sqldatasource_control
security
client_side_web_development
novell-support-groupwise-6x-clients
data_access-data_access_and_objectdatasource_control
asp-net_ajax-asp-net_ajax_control_toolkit
novell-support-netware-6x-install-upgrade
asp-net_ajax-asp-net_ajax_discussion_and_suggestions
novell-support-netware-6x-administration-tools
master_pages_themes_and_navigation_controls
configuration_and_deployment
novell-support-netware-client-winnt-2x-xp
novell-support-groupwise-7x-clients
asp-net_ajax-asp-net_ajax_ui
novell-support-edirectory-netware
community-free_for_all
visual_studio_2005
novell-support-groupwise-6x-install-setup
data_access-xml_and_xmldatasource_control
control-cancel
novell-support-iprint
advanced_asp-net-crystal_reports
data_access-xml_web_services
microsoft-public-access
novell-community-chat
state_management
novell-support-netware-6x-abends-hangs
dotnetnuke-getting_started
novell-support-groupwise-6x-gwia
-net_languages-c
novell-support-identity-manager-engine-drivers
novell-support-groupwise-discontinued
advanced_asp-net-architecture
opensuse-org-suse-linux-support-install-configure-administration
dotnetnuke-custom_modules
novell-support-groupwise-7x-install-setup-admin
novell-support-netware-6x-storage-media
novell-support-groupwise-6x-agents
installation_and_setup
data_access-access_databases_and_accessdatasource_control
windows-hosting_open_forum
visual_web_developer_2005_express
novell-support-groupwise-6x-web-access
novell-support-netware-6x-server-backup
macromedia-dreamweaver
novell-support-netware-5x-administration-tools
novell-support-ifolder
novell-support-bordermanager-install-setup
novell-support-imanager
microsoft-public-dotnet-framework-aspnet
novell-support-netware-5x-install-upgrade
novell-support-cluster-services
novell-support-bordermanager-proxies
novell-support-newsflash
advanced_asp-net-sql_server_reporting_services
microsoft-public-dotnet-languages-csharp
web_parts_and_personalization
about_this_site-feedback_on_this_website
ibm-software-websphere-portal-server
novell-support-netware-dns-dhcp
novell-support-zenworks-desktops-4x-app-launcher
-net_languages-visual_basic_-net
advanced_asp-net-custom_server_controls
novell-support-bordermanager-vpn
novell-support-ndps-neps
microsoft-public-sqlserver-programming
novell-support-netware-webserver
community-jobs
novell-support-netware-4x
advanced_asp-net-mobile_and_handheld_devices
internet_explorer_web_controls
novell-support-zenworks-desktops-4x-install-setup
novell-support-edirectory-linux
novell-support-groupwise-7x-gwia
development_tools-web_matrix_general_discussions
microsoft-public-access-formscoding
macromedia-flash
community-announcements
portal_starter_kit
novell-support-zenworks-desktops-4x-management-agent
novell-support-zenworks-patch-management
novell-support-native-file-access
microsoft-public-access-queries
microsoft-public-access-forms
novell-support-groupwise-7x-web-access
novell-support-netware-small-business-6x
data_access-active_directory_and_ldap
novell-support-edirectory-windows
novell-support-groupwise-7x-agents
novell-support-ichain
data_access-oracle
novell-support-zenworks-desktop-management-6x-imaging
novell-support-groupwise-7x-wireless
novell-support-netware-5x-abends-hangs
advanced_asp-net-localization
novell-support-zenworks-desktop-management-7x-imaging-server-nw-win




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 4/24/2006 9:37:15 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 6 Views: 44 Favorited: 0 Favorite
7 Items, 1 Pages 1 |< << Go >> >|
"Collegesprtsfa
NewsGroup User
Dynamic Controls in master pages4/24/2006 9:37:15 PM

0

I have dynamic controls that I create on page load of a content page. When I try to grab the information from the control to add to my database I get an error. I used this same code in 1.1 and it worked find. I am assuming the problem is that I am working with master pages. How do you access dynamic control in a master page senerio?
"siegetank" <>
NewsGroup User
Re: Dynamic Controls in master pages4/25/2006 2:12:50 PM

0

where is the code located that is trying to access the control?
Shane
Web Administrator
"Collegesprtsfa
NewsGroup User
Re: Dynamic Controls in master pages4/25/2006 2:41:29 PM

0

The code is sitting in the content page in a sub for the onclick command of the button for submitting.

My code worked in 1.1 and now it doesn't in 2.0.  I have tried the following ways to access. The controls are recreated on page load.

 

Dim mpContentPlaceHolder As ContentPlaceHolder

Dim mpTextBox As TextBox

mpContentPlaceHolder = _

CType(Master.FindControl("cp"), _

ContentPlaceHolder)

If Not mpContentPlaceHolder Is Nothing Then

mpTextBox =

CType(mpContentPlaceHolder.Page.FindControl("first1"), _

TextBox)

If Not mpTextBox Is Nothing Then

mpTextBox.Text =

"TextBox found!"

Else

Response.Write(

"Not Found")

End If

End If

 

and I have also tried

Dim a As TextBox
a = CType(Me.Page.FindControl("first1"), TextBox)
"siegetank" <>
NewsGroup User
Re: Dynamic Controls in master pages4/25/2006 2:51:45 PM

0

I believe you need to set the @MasterType Directive on your .aspx page:

&lt;%@ MasterType VirtualPath="myMasterPage.master" %&gt;

Then expose the control you want as a property (in the master page):

</p> <p>public string first1Text</p> <p>{</p> <p>get { return first1.Text; }</p> <p>set { first1.Text = value; }</p> <p>}</p> <p>

then access the control in the content code behind:

</p> <p>Master.first1Text = "This is my Text!";</p> <p>

 

I hope this helps!


Shane
Web Administrator
"siegetank" <>
NewsGroup User
Re: Dynamic Controls in master pages4/25/2006 2:54:28 PM

0

I believe you need to set the @MasterType Directive on your .aspx page:

<%@ MasterType VirtualPath="myMasterPage.master" %>

Then expose the control you want as a property (in the master page):

public string first1Text

{

get { return first1.Text; }

set { first1.Text = value; }

}

then access the control in the content code behind:

Master.first1Text = "This is my Text!";

 

 

I'm not sure how to do code blocks on this forum.  Let's see if this looks better.


Shane
Web Administrator
"Collegesprtsfa
NewsGroup User
Re: Dynamic Controls in master pages4/25/2006 3:21:05 PM

0

I wouldn't know what the ID's of those textboxes are going to be. The number on the end is a record ID associated with the text entered in those boxes.
"siegetank" <>
NewsGroup User
Re: Dynamic Controls in master pages4/25/2006 3:56:10 PM

0

I'm not sure what to do about that.  sorry.
Shane
Web Administrator
7 Items, 1 Pages 1 |< << Go >> >|


Free Download:













share db connection in all web user controlers on page

change theme dynamically on multiple master pages...

xmldatasource and treeview web control

problem displaying a control on a page

bookmarking ajax content pages...

how can i set a contentplaceholder size automatically??

flash animation in asp.net

select node in tree view after bind

sub master page query

use a masterpage for multiple web sites

problem with vertical asp.net men and contentplaceholder in master page

when will someone develop a multi-column treeview?

treeview control in asp.net

masterpages & login pages

repeater and masterpage

access web control on nested master page

changing color of selectednode on treeview

how do i scroll content area only?

moving treeview nodes around in the tree

how to build master webcontrol

load treeview from sql query

custom vertical menu

call method of another class

how to apply css in master page?

drop shadow and highlighting of dynamic menus

alternative for the standard .net menu control

multiple-row menus

how to change the header falsh programmatically?

menu item without explicit url (assuming default.aspx page) does not get selected property

anyone have examples on how to pull a treeview from a database

can i load an aspx into a contentplaceholder programatically?

treeview - node.parent is null even though it has a parent node

menu control don't show the selected item

googlebot and master and content-pages

masterpage and menuitem navigateurl

update to master pages causes system.outofmemoryexception error

menu control: menu item text is clickable but cell is not

change all site layout dinamically

dynamic menu

treeview control with radio buttons

problems when publish a master page website.

masterpage and iextenderprovider

how do i turn off theme if i specified default theme in web.config?

master, content and postback

enablingtheme="false" does not work

regarding redirecting a page inside of content place holder...

page title?

howto give as background an image to a treeview or menu? and not just backcolor?

using a single field value across all .aspx pages on my site

is there a way to turn off an "unknown server tag" for themes?

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT