Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2007, 04:10 AM
Authorized User
 
Join Date: Jul 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in assigning value in a textbox

Hi,
   I got a data like "t&m" and I store this value in the sql server.
It is getting stored as "t&m" correctly. when I receive the data in asp.net, I displayed the data using Response.Write to check the value
it displays as t&m correctly.
   The problem is that when I assign the value to a textbox it is getting displayed as t&m in the textbox.
   I should get only t&m in the textbox.
   How to solve this problem.
   Can anyone help me.


 
Old August 30th, 2007, 07:27 AM
Authorized User
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
this is Shakti, i work as a Software Programmer.

i think u should try to convert that value to string before assigning it to textbox.
Lets consider that u have a that value t&m
put that value in

string str=t&m;
textBox1.text=Convert.toString(str);

try this,
hope this works.
reply me ur comments.
 
Old August 31st, 2007, 08:12 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It sounds like this value is getting HtmlEncoded somewhere along the time. You might need to HtmlDecode it before you put it in the textbox.

-Peter
 
Old September 1st, 2007, 07:57 AM
Authorized User
 
Join Date: Jul 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
  Shakti I tried with your idea.
The same problem exists.
But Peter is correct, the values are getting encoded somewhere.
When I use HTMLDecode it works fine.
Thank you guys for your help.




 
Old September 2nd, 2007, 08:50 AM
Authorized User
 
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abeen
Default

 string str = "t&m";
 this.TextBox1.Text = str;

============================================
  Success grows out of struggles to overcome difficulties.
============================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem assigning my Array values to rows - Please Edoloto Excel VBA 1 August 18th, 2008 04:13 AM
Problem with textbox chafor ASP.NET 1.0 and 1.1 Basics 1 January 12th, 2006 11:21 AM
textbox problem dr_luxure VB.NET 2002/2003 Basics 3 April 10th, 2005 03:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.