.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

FindControl - basic explanation for a moron like me...

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net


ASP 3.5

Dim control as Control

control = Page.ParseControl("<tr><td><asp:textbox id='textbox1' runat='server' /></td></tr>")

This as simple as I can make it.

So, in QuickWatch, I can see:

control.Controls(0) is a literalcontrol

control.Controls(1) is a textbox with id, clientid and uniqueid all set to 'textbox1'.

So the 64k question:

Why does control.FindControl("textbox1") return Nothing? I really don't get it. I know that FindControl is not recursive, but textbox1 is in the controlscollection of the root control! Please explain - this is driving me nuts...




View Complete Post

More Related Resource Links

WCF Tutorial - Basic Interprocess Communication

What the heck is WCF? For a long time, I couldn't tell you exactly what it was. And honestly, I still don't think I can. WCF is such a broad concept that it's hard to boil down into a concise explanation. When I finally started reading about it, and getting beyond the concepts, things started to clear up. That's what today's tutorial is about - cutting through all the concepts and just use WCF to build a basic server and a basic client.

How to run Office macros by using Automation from Visual Basic .NET

This step-by-step article describes how to call Office macros from a Visual Basic .NET Automation client.

You can use Microsoft Office Automation to open a document or create a new document that contains a Visual Basic for Applications (VBA) macro and execute the macro at run time.

learn basic about share point.

This learn basic about share point.

Dynamically Create Controls in ASP.NET with Visual Basic .NET

This step-by-step article describes how to dynamically create controls for an ASPX Web page.

The sample project does the following:
It creates two TextBox controls.
It verifies that the TextBox contents (TextBox.text) and attributes are saved across posts to the server.
It describes how events that are posted by a dynamically created control are handled.


I have 2 web pages. First page has a textbox and a button control.

when I enter test and click on the button , system goes to the second page. And in the second page I want to access the Textbox in the first page. When I try to do this I get the following error.

"Object reference not set to an instance of an object. Following is my code :

Dim txt As New TextBox

' Find the server name on the previous page
txt = CType(Page.PreviousPage.FindControl("TextBox2"), TextBox)
If Not IsNothing(txt) Then
Response.Write("[Name Not available]")
End If

I know I could do this with session, but I want to use the Page.PreviousPage.FindControl. Any help is greatly appreciated

Creating a Basic SharePoint Web Part

This programming task includes the steps for creating a basic custom Windows SharePoint Services Web Part. It is a simple Web Part that allows you to change the Web Part's Title property, which is a Windows SharePoint Services WebPart base class property that sets the text in the title bar of the Web Part.

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

Basic Support


Can anyone help me please?


I have been producing a registration form using html and asp.  I have managed to get it to send an email having copied script from a previous website which someone developed for me.  I now get the response going to the old address and with then old text.  How can I change it all to the new site?

This has been very frustrating as I am sure someone is going to say all I have to do is ...




Some basic MVC question

  1. In regular asp net I can run (debug) the application but I can either "view in browser" that gives me the option to view the application and write code on same time.

In MVC I can't find this option.

  1. What is the basic DATA MODEL for working with SQL DB.

I mean with no any framework (entity framework, Sub sonic, Link to SQL etc')

I look for basic application that works with data but with no fw.

  1. What is the popular DB framework that working with data.
  2.  I am looking on  mvc series


C# Soup To Nuts  (the best series ever)


I watch some of the MVC video, seems that the music store is good but I have to wait to the other part.

Does any one know and recommend   a Microsoft MVC tutorial?





Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




Linq qry with order by basic questions


I have never tried a group by with linq, now I do and I'm stuck.

I try to convert this sql statement to its linq counterpart :

SELECT COUNT(tb_Mailer_Smses.Id) AS [cnt], tb_Mailer_mailing.Id As [Id]
,SUM( CASE WHEN tb_Mailer_smses.DLRStatus = 200 THEN 1 ELSE 0 END) As [Delivered]
FROM tb_Mailer_mailing INNER JOIN
tb_Mailer_Smses ON tb_Mailer_mailing.Id = tb_Mailer_Smses.MailingId
WHERE tb_Mailer_mailing.ApplicationId = 1
GROUP BY tb_Mailer_mailing.Id

Is there some one who can me show me the convertion process ?

Basic Instincts: Multi-Targeting Visual Basic Applications in Visual Studio 2010


Visual Studio 2010 lets you create applications that target versions of the Microsoft .NET Framework from 2.0 to 4, and each step in between. We take a look at how multi-targeting works in Visual Studio today, and explain how you should approach multi-targeting in your projects.

Spotty Bowles

MSDN Magazine June 2010

Visual Basic: What's New in Visual Basic 2010


Learn about what's new in Visual Basic 10 straight from a program manager on Microsoft's Visual Basic team. Jonathan Aneja demonstrates time-saving features that help developers get more done with fewer lines of code.

Jonathan Aneja

MSDN Magazine April 2010

Basic Instincts: Generic Co- and Contravariance in Visual Basic 2010


Dig into the new co- and contravariance features coming in Visual Studio 2010. Binyam Kelile provides hands-on Visual Basic examples to explain how they provide more flexibility when working with generic interfaces and delegates.

Binyam Kelile

MSDN Magazine March 2010

Basic Instincts: Collection and Array Initializers In Visual Basic 2010


Collection Initializers are a great addition to the language and allows concise syntax in order to initialize both framework and user defined collection types.

Spotty Bowles

MSDN Magazine October 2009

Basic Instincts: Stay Error Free With Error Corrections


Error corrections are an essential part of the Visual Basic coding experience. This article explores the many error correction features offered by Visual Basic and provides a glimpse at the future release of Visual Studio 2010.

Dustin Campbell

MSDN Magazine July 2009

Basic Instincts: Documenting Your Code With XML Comments


XML comments provide an easy and effective way to document your code. We'll show you how to use and customize XML comments in your Visual Basic projects.

Lisa Feigenbaum

MSDN Magazine May 2009

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend