Click here to Skip to main content
15,887,027 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionModalPop_up Pin
Ersan Ercek11-Nov-09 6:55
Ersan Ercek11-Nov-09 6:55 
AnswerRe: ModalPop_up Pin
Petr Pechovic11-Nov-09 7:35
professionalPetr Pechovic11-Nov-09 7:35 
GeneralRe: ModalPop_up Pin
Ersan Ercek11-Nov-09 8:27
Ersan Ercek11-Nov-09 8:27 
GeneralRe: ModalPop_up Pin
Ersan Ercek12-Nov-09 0:13
Ersan Ercek12-Nov-09 0:13 
QuestionDynamic text box Pin
sris 42611-Nov-09 6:42
sris 42611-Nov-09 6:42 
AnswerRe: Dynamic text box Pin
Abhishek Sur11-Nov-09 6:55
professionalAbhishek Sur11-Nov-09 6:55 
GeneralRe: Dynamic text box Pin
sris 42611-Nov-09 7:00
sris 42611-Nov-09 7:00 
AnswerRe: Dynamic text box Pin
Abhishek Sur11-Nov-09 11:57
professionalAbhishek Sur11-Nov-09 11:57 
What do you mean by Dynamic controls.
Do you mean the controls will be generated inside DataList's ItemTemplate ?

Yes, you can access controls inside
ItemTemplate 
from codebehind just like I mentioned in my other post. You need to find the control when
ItemDataBound 
event executes.

<asp:Datalist....OnItemDataBound="Item_Bound" >
<itemtemplate>
<asp:textbox runat="server" id="tb1" />
</itemtemplate>

Now from codebehind :
void Item_Bound(Object sender, DataListItemEventArgs e)
{
   if (e.Item.ItemType == ListItemType.Item || 
             e.Item.ItemType == ListItemType.AlternatingItem)
   {

       TextBox tb1 = e.Item.FindControl("tb1") as TextBox; //same as the control inside Itemtemplate
  }

}


Note : You must place Runat = server if you want the control to be found properly using e.Item.FindControl

Hope this clears your doubt.

"Dont forget to click "Good Answer" if it helped you" Wink | ;) Wink | ;)



Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript

Questiondatalist with embedded dropdownlist question 2.) [solved] Pin
Crapaw4511-Nov-09 5:59
Crapaw4511-Nov-09 5:59 
QuestionVersion error Pin
netsooz (Amir Hamidi)11-Nov-09 4:41
netsooz (Amir Hamidi)11-Nov-09 4:41 
AnswerRe: Version error Pin
netsooz (Amir Hamidi)11-Nov-09 4:57
netsooz (Amir Hamidi)11-Nov-09 4:57 
AnswerRe: Version error Pin
Aman Bhullar11-Nov-09 18:36
Aman Bhullar11-Nov-09 18:36 
Questionasp.net files Pin
tamir90111-Nov-09 4:21
tamir90111-Nov-09 4:21 
AnswerRe: asp.net files Pin
N a v a n e e t h11-Nov-09 4:24
N a v a n e e t h11-Nov-09 4:24 
GeneralRe: asp.net files Pin
tamir90111-Nov-09 4:27
tamir90111-Nov-09 4:27 
GeneralRe: asp.net files Pin
Abhishek Sur11-Nov-09 4:56
professionalAbhishek Sur11-Nov-09 4:56 
GeneralRe: asp.net files Pin
tamir90111-Nov-09 19:53
tamir90111-Nov-09 19:53 
GeneralRe: asp.net files Pin
Abhishek Sur11-Nov-09 21:33
professionalAbhishek Sur11-Nov-09 21:33 
AnswerRe: asp.net files Pin
Abhijit Jana11-Nov-09 4:57
professionalAbhijit Jana11-Nov-09 4:57 
Questioncan we send the data of gridview through mail Pin
chandra23411-Nov-09 2:50
chandra23411-Nov-09 2:50 
AnswerRe: can we send the data of gridview through mail Pin
Abhijit Jana11-Nov-09 5:11
professionalAbhijit Jana11-Nov-09 5:11 
AnswerRe: can we send the data of gridview through mail Pin
Aman Bhullar11-Nov-09 18:46
Aman Bhullar11-Nov-09 18:46 
QuestionActive Directory Search is computer in group - help please Pin
sismeya11-Nov-09 2:38
sismeya11-Nov-09 2:38 
QuestionHow we can do for fast execution the page Pin
lrsalunkhe11-Nov-09 2:18
lrsalunkhe11-Nov-09 2:18 
AnswerRe: How we can do for fast execution the page Pin
Kannan Ar11-Nov-09 2:30
professionalKannan Ar11-Nov-09 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.