Re: FindControl doesn't work



Crumbs, this post was really helpful.
I too tried to cut corners and run before I could walk - doesn't work. :-)
Just wanted to say thanks.

Pete.

"Kevin Spencer" <uce@xxxxxxx> wrote in message
news:%23Ke1GS8vGHA.4296@xxxxxxxxxxxxxxxxxxxxxxx
Hi Dennis,

The ID attribute of the WebForm is the Name of the object.

It occurs to me that if you do not know anything about the WebForm class,
which is the meat and potatoes of the Page class, and very little about
the Page class itself, you need to stop where you are, and familiarize
yourself with these very important classes, and how they fit into the
ASP.Net object model. You will never get off of square 1 unless you do.
I'm not trying to bust your chops, but understanding ASP.Net is like
understanding Trigonometry. You have to understand arithmetic, algebra,
and geometry before you start to study Trigonometry, or you are in for a
real rough time.

ASP.Net is a pretty complex animal. It is a technology which works within
the environment of an HTTP Web Server, and that subject alone deserves
some study. It create HTML pages on the client, and understanding HTML is
also essential. I don't know at this point whether or not you are familiar
with HTML, but it should be mentioned. It uses a combination of
server-side Object-Oriented programming, and client-side HTML, XML, CSS,
JavaScript, the whole nine yards of what can be done with HTML. All of
these topics you should be familiar with.

In addition, ASP.Net has its own development model, centered around the
base class System.Web.UI.Control. A Page class is inherited from Control,
as is the WebForm class. In fact, any class in an ASP.Net page that sends
HTML to the client inherits System.Web.UI.Control. So, it is important to
understand how Controls work.

Because HTTP is stateless, ASP.Net incorporates a set of "tricks" that
emulate state between Page requests. You need to understand these as well,
including what ViewState, PostBack, Session, and Application are, at the
very least.

The ASP.net System.Web.UI.Page class is the central object usually, as it
incorporates all of the process involved in composing and rendering the
HTML, as well as process for handling PostBacks and server-side Events.
The Page class hosts the WebForm as well as all other
System.Web.UI.Controls in the Page. The Page class is a special type of
class that is called a "Templated Control." It may contain both
programming code and ASP.Net/HTML markup. In fact, it is compiled at
run-time to a class, and the markup becomes executable code. The markup is
a handy mixture of the familiar HTML markup syntax, and a similar ASP.Net
markup syntax which can be used to create Controls in the Page.

The WebForm is the heart of the PostBack model, and must contain all of
the Controls which require any action on the server. you should be
familiar with how the WebForm Control works as well.

Here is the complete Visual Web Developer Reference:
http://msdn2.microsoft.com/en-us/library/ms178093.aspx

Here is the Reference Section regarding ASP.Net Pages:
http://msdn2.microsoft.com/en-us/library/2z18a5tf.aspx

Here is the .Net SDK ASP.Net Reference:
http://msdn2.microsoft.com/en-us/library/9k6k3k4a.aspx

Here is the .Net SDK System.Web.UI Namespace Reference:
http://msdn2.microsoft.com/en-us/library/system.web.ui.aspx

So, do yourself a *big* favor, and try to get a working grasp of these
mechanisms before you try to go forward.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Orange you bland I stopped splaying bananas?


"Dennis" <dbronstein@xxxxxxxxx> wrote in message
news:1155565213.512591.140030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Kevin Spencer wrote:
Did you try Form1.FindControl? Is the Control immediately underneath the
Form?


I don't have a Form1, or if I do, I don't know how to reference it. I
have a Page.Form and Me.Form, but as I said, neither of those work.





.



Relevant Pages

  • Re: Webform keydown event and keyup event...help
    ... Webform does not work totally different: ... you either place a ServerControl on it or an HTML control on it. ... a ServerControl, if you want to do it all in your client, you use an HTML ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: No html insertion in the *.aspx file
    ... You already tried to see if in the *html* part (.aspx) of the page you have ... keep in mind that all the HTML is in your .ascx file and it's parsed ... reference OR in the .aspx you don't have a line like this one on top of the ... which is used for referencing your custom control, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: FindControl doesnt work
    ... The ID attribute of the WebForm is the Name of the object. ... It create HTML pages on the client, ... A Page class is inherited from Control, ... Here is the Reference Section regarding ASP.Net Pages: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Client Side Control and OWC Object
    ... I'm building a client side control in vs.net by selecting "Windows ... Control Library" for the project to create a .dll. ... embed the OWC spreadsheet object into the html page and then reference it ...
    (microsoft.public.office.developer.web.components)
  • Re: No html insertion in the *.aspx file
    ... The reference is there, ... most of my controls inherit from my base control, ... It seems all controls that are not derictly derived from WebControl produce this problem. ... > and rendered as HTML afterwards. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)

Loading