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 > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 4/26/2005 4:26:25 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 27 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
ad_flying
Asp.Net User
Can't refer a web control in Template4/26/2005 4:26:25 AM

0/0

I place a Button named Button1 in the HeaderTemplate of a DetailView.

I want to change the text fo Button1 programlly, but I can't refer Button1 in Page_Load event

How can I refer a web control in Template?

 

ASPSmith
Asp.Net User
Re: Can't refer a web control in Template4/26/2005 6:22:33 AM

0/0

Button myButton = FindControl("Button1") as Button;

myButton.Text = "foo";


Steven A Smith
AspAlliance.com - The #1 ASP.NET Community
DevAdvice.com - Answers to Questions
ad_flying
Asp.Net User
Re: Can't refer a web control in Template4/26/2005 7:07:38 AM

0/0

Thank,

I have try the code , but it result in an error message in run time:

Object reference not set to an instance of an object.

I think it must be the that the Button1 can't find!

But the Button1 really in the HeaderTemplate like:

                <asp:DetailsView ID="dvWH" runat="server" BackColor="White" BorderColor="#DEDFDE"      

              ...........
                      <HeaderTemplate>
                        <asp:Button ID="Button1" runat="server" Text="Button" />                        

                            ........

                    </HeaderTemplate>
                </asp:DetailsView>

 

 

 ASPSmith wrote:

Button myButton = FindControl("Button1") as Button;

myButton.Text = "foo";

ASPSmith
Asp.Net User
Re: Can't refer a web control in Template4/26/2005 2:53:07 PM

0/0

Put my code in the ItemDataBound event.  Instead of just FindControl, use e.Item.FindControl().  Do a google for e.Item.FindControl and you'll find many samples.
Steven A Smith
AspAlliance.com - The #1 ASP.NET Community
DevAdvice.com - Answers to Questions
ad_flying
Asp.Net User
Re: Can't refer a web control in Template5/1/2005 8:49:31 AM

0/0

Thank,

But I am using DetailView, there is no ItemDataBound event for it.

I can only DataBound, but the e argument does have a Item attribute.

 

 

 ASPSmith wrote:
Put my code in the ItemDataBound event.  Instead of just FindControl, use e.Item.FindControl().  Do a google for e.Item.FindControl and you'll find many samples.

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 Databases: From Novice to Professional Authors: Damien Foggon, Pages: 625, Published: 2006
Macromedia Coldfusion MX Web Application Construction Kit: Web Application Construction Kit Authors: Ben Forta, Nate Weiss, Leon Chalnick, Angela C. Buraglia, Pages: 1500, Published: 2002
Microsoft Office FrontPage 2003 Inside Out: Inside Out Authors: Jim Buyens, Pages: 1199, Published: 2003
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Programming Data-driven Web Applications with ASP.NET Authors: Donny Mack, Doug Seven, Pages: 704, Published: 2002
Beginning ASP.NET 2.0 E-commerce in C# 2005: From Novice to Professional Authors: Cristian Darie, Karli Watson, Pages: 681, Published: 2005
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 2.0 Website Programming Authors: Damon Armstrong, Pages: 641, Published: 2005
Activepi Companion Textbook: A Supplement for Use with ActivEpi CD-ROM Authors: David G. Kleinbaum, Kevin M. Sullivan, Nancy D. Barker, Pages: 518, Published: 2003

Web:
Can't refer a web control in Template - ASP.NET Forums Re: Can't refer a web control in Template. 04-26-2005, 2:22 AM. Contact ... Re: Can't refer a web control in Template. 04-26-2005, 3:07 AM. Contact ...
CoDe Magazine - Article: Web Control Templates Explained The GridView shows how you can use control templates in a repeating fashion, but they don’t have to ... So now I’ll show you how to add template functionality to a custom Web control. I’ll refer you once again to my previous articles. ...
Web Control Templates Explained Aug 14, 2006 ... The GridView shows how you can use control templates in a repeating fashion, but they don't have to be as ... I'll refer you once again to my previous articles. ... Live to Code Video: I Don't Buy Games, I Make Them ...
C# / Asp.Net / AJAX / Sql Blog: How to refer a server side control ... You would normally try to refer to a control as document.getElementById([control id] But in our case, you can't just use the control's ID. ...
Building Templated Custom ASP.NET Server Controls As the above Web control syntax illustrates, templates can contain: .... If you don't want to handle this event, return false, and the event will continue .... In such a case, a default template is used. For more details, refer to this ...
reference to controls in template item I thought that I can do that in code behind (Selected event of ... don't know how to refer to these "embedded" controls. Best Regards .... current web request . Please review the stack trace for more information ...
Creating Dynamic DataList control in C#/ASP.Net Template columns for datalist can be created by implementing the interface ITemplate in ... Web.UI.Control object that. // child controls and templates belong to. ... Refer the code (Listing 2 –TemplateClass for DataList) for clear understanding. ... DataItem, "CreatedOn", "{0:d} @ {0:t}") + " By " + DataBinder . ...
CodeProject: Template Rounded Corner Control. Free source code and ... Aug 3, 2004 ... However, if we can make it a template control such that its content is not limited ... Highly customizable JavaScript popup control for web page wrapped in ASP. ... Some how I couldn't bind the data to the datalist ... You may need to refer to some other articles regarding nested datalist control;P ...
InformIT: Adding Client Capabilities to Server Controls Using the ... Jul 22, 2008 ... In addition, the toolkit includes myriad controls you can either use or build on , making the toolkit a ... Visual Studio 2008 Extender Control Library Template ... The ExtenderControlBaseDesigner class that the ... resource type and the full resource name and should refer to an embedded resource. ...
Mike Christensen: Web Dev Guy : Templates - Part 2 You can refer to this instance of this class using the reserved .... This control can even be a Web Part that lives in a serialized state in a database some where. It doesn’t really matter since we load the template we need at runtime. ...

Videos:
Human Computation Google TechTalks July 26, 2006 Luis von Ahn is an assistant professor in the Computer Science Department at Carnegie Mellon University, where ...
Google I/O 2008 - Painless Python Part 1 of 2 Painless Python for Proficient Programmers Alex Martelli (Google) Python is a popular very-high-level programming language, with a clean and ...
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared ...
Literate functional testing Google London Test Automation Conference (LTAC) Google Tech Talks September 7th, 2006 Presenters: Robert Chatley and Tom White
Lec 14 | MIT 3.091 Introduction to Solid State Chemistry Introduction to the Solid State, the 7 Crystal Systems, the 14 Bravais Lattices View the complete course at: http://ocw.mit.edu/3-091F04 License ...




Search This Site:










quick question involving dates and regex...

collection confusion

interpret rtf files?

data driven custom controls?

how do i make tagprefix work?

testinging for object instantiation

works with one host and not another

validating user

windows authentication in dnn 2.0

a "whats new"

autopostback not working correctly

database queries

asp.net/vb.net is extremely slow

database in vwd

textbox to text msg

show module help for all users

memory

how do i get a usercontrol in a tablecell to expand over a grid without enlarging tablecell?

postback

seo search engine dnn options & modules

i can’ t send e-mails from my app

no errors but not working.

error on startup

dnn 3.0.4 clean install problem

i keep getting an error when i try to search on 'pane skins'

textbox splitting in time format

? database to form dynamic creation

permissioning on windows 2003

login system with database

help please

 
All Times Are GMT