Click here to Skip to main content
16,018,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Response.Write("
" + "<asp:TextBox ID='dsde' runat='server'>")
Posted
Comments
Sandeep Mewara 20-Jun-11 6:51am    
Elaborate! Not clear.
R. Giskard Reventlov 20-Jun-11 6:52am    
What error are you getting?

Hi,
try this code

Response.Write(";");
 
Share this answer
 
Comments
@nuraGGupta@ 20-Jun-11 8:23am    
Hey, doesn't it seems just a copy paste of my code? huh? [:-)]
This won't work, because you are writing asp control on the runtime to the browser, which won't be rendered. Instead, if you want to show a textbox dynamically, as it seems, you can use HTML textbox syntax, as given below:

Response.Write(<input type="textbox" id="dsde"  runat="server" />");


Hope this helps.
 
Share this answer
 
v2
That's not really possible, by the means with which you are attempting to do it. Response.Write is processed on the server and so are the ASP.NET controls, there's no way to register text written to the page as a control by Response.Write.

Instaed you can use HTML controls or there are other options you can use for ASP.NET, such as the PlaceHolder control. If it is something that you need to show for some users and hide for others, you can use the Visible property of the textbox control, eg:
Code:
<asp:TextBox id="TextBox1" runat="server" Visible="False">
 
Share this answer
 
change your code as shown below :

C++
Response.Write("" + "<asp:TextBox ID='dsde' runat='server'></asp:TextBox>")
 
Share this answer
 
Without asking why you'd want to do this and answering the question (such as it is) as asked, try:

Response.Write(@"<asp:textbox id=""dsde="" runat=""server"" />");
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900