Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 30th, 2007, 04:10 AM
Authorized User
Join Date: Jul 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in assigning value in a textbox

   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.

  #2 (permalink)  
Old August 30th, 2007, 07:27 AM
Authorized User
Join Date: Aug 2007
Location: mumbai, maharashtra, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

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;

try this,
hope this works.
reply me ur comments.
  #3 (permalink)  
Old August 31st, 2007, 08:12 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

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.

  #4 (permalink)  
Old September 1st, 2007, 07:57 AM
Authorized User
Join Date: Jul 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts

  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.

  #5 (permalink)  
Old September 2nd, 2007, 08:50 AM
Authorized User
Join Date: Jul 2006
Location: DongYing, , China.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abeen

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

  Success grows out of struggles to overcome difficulties.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 05:10 AM.

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