well it doesnt have a .Text property but you can type text in it... I'm wondering is there a way to get the text in a panel control by code?
Printable View
well it doesnt have a .Text property but you can type text in it... I'm wondering is there a way to get the text in a panel control by code?
I just tried and I cant directly type text on the panel. If you use a label, then you can.
waa? you CAN directly type in the panel. just click on it a few times (kinda like you click on a file to rename it...)Quote:
Originally posted by DevGrp
I just tried and I cant directly type text on the panel. If you use a label, then you can.
Ah damn, I did'nt realize that you were refering to the ASP.NET version :D. Thought it was the WinForm version.
Ok, I tried again. I dont think there is a way to get the text.
hehehe :)Quote:
Originally posted by DevGrp
Ah damn, I did'nt realize that you were refering to the ASP.NET version :D. Thought it was the WinForm version.
it sounds rather stupid, ms lets you type in it but doesnt let you read what you've typed:( oh well, it would have been really nice
Here you go, u just gotta dig alittle deeper:
The panel web control renders a span tag, so you'll have to grab his first child control to read the text value.Code:LiteralControl l = ((LiteralControl)Panel1.Controls[0]);
Response.Write(String.Format("The text I contain is {0}", l.Text));
w00T cool:D many thanks! you da man! :cool:Quote:
Originally posted by Lethal
Here you go, u just gotta dig alittle deeper:
The panel web control renders a span tag, so you'll have to grab his first child control to read the text value.Code:LiteralControl l = ((LiteralControl)Panel1.Controls[0]);
Response.Write(String.Format("The text I contain is {0}", l.Text));