dynamically created textbox textchanged()

Posted by Deepakji under C# on 3/26/2012 | Points: 10 | Views : 5314 | Status : [Member] | Replies : 6
hi,


i am facing a problem in dynamically generated textbox it is like i am able to get textbox dynamically but the problem is with every textbox.textchanged () when i am calling this function , at the time of pageload dynamically generated text box are vanishing so i am unable to get them back.


so please let me know to do that , i am forwarding the sample code
tbNum.TextChanged += new EventHandler(tbNum_TextChanged);


protected void tbNum_TextChanged(object sender, EventArgs e)
{
Response.Write("Hello world");
}


thanking you,




Responses

Posted by: Jmckamal on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
you have to use this method in OnPreRender which will resolve the postback issue.

Thanks,
Kamal

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/26/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,
Refer to this link:
http://devcenter.infragistics.com/Articles/ArticleTemplate.Aspx?ArticleID=2149

Thanks,
Sanjay

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/26/2012 [Member] Silver | Points: 25

Up
0
Down
Try this also:
http://www.codeproject.com/Articles/18080/Solve-Dynamic-Control-Problem-With-PostBack

Thanks,
Sanjay

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jmckamal on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Sksamantaray - It looks like Deepakji has already done for with dynamic control creation, but he is facing some issues with that during pageload event fire. So I have asked him to change it to OnPreRender fire event which may resolve the issue.

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you should try as Jmckamal said

R D Patel

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/26/2012 [Member] Silver | Points: 25

Up
0
Down
I am sorry Jmckamal ,
My intention is not to under estimate your solution ,intention is to provide a link which has some sollution , because he is facing the postback issue.


Thanks,
Sanjay

Deepakji, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response