codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  text field multiple  eshwar_gp at 10:36 on Monday, December 20, 2004
 

Hi,
in my project, if i enter ' < > like charecters in a text field(multiple) itis giving eror like ""


please provide me solution. this is asp.net with C#. sql server is the database.


example: Incorrect syntax near '<'. Unclosed quotation mark before the character string ' , 0, 0)'.

like this.



  Re: text field multiple  tgreer at 15:18 on Wednesday, December 22, 2004
 

I can't give an answer without seeing some source code. Can you copy the particular statement that is giving you this error?



  Re: text field multiple  eshwar_gp at 08:30 on Monday, December 27, 2004
 

<form id="Form1" method="post" runat="server">
<asp:TextBox id="TextBox1" name="TextBox1" style="Z-INDEX: 101; LEFT: 304px; POSITION: absolute; TOP: 72px"
TextMode="MultiLine" Height="136px" Runat=server> </asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 360px; POSITION: absolute; TOP: 256px" runat="server"
Text="Button"></asp:Button>
</form>






and .cs is
-----------

private void Button1_Click(object sender, System.EventArgs e)
{
string psgpost1 = (TextBox1.Text);

string psgpostText1 = psgpost1.Replace("'", "'");

Response.Write(psgpost1);

string psgpost2 = psgpostText1;

string psgpostText2 = psgpost2.Replace("<", "<");

Response.Write(psgpostText2);

string psgpost3 = psgpostText2;
string psgpostText = psgpost3.Replace(">", ">");

Response.Write(psgpostText);

}



how to remove html quotes?



regards,
eshwar_gp

<Added>

string psgpostText1 = psgpost1.Replace("'", "'");

string psgpostText2 = psgpost2.Replace("<", "<");


string psgpostText = psgpost3.Replace(">", ">");

in these 3 places in replace function 2nd arguement i used related number like ' for "'"....

please reply.


eshwar_gp


  Re: text field multiple  tgreer at 14:27 on Tuesday, December 28, 2004
 

I would like to help, but don't understand the question, or what you're trying to do.
If you want the user to be able to enter HTML escaped values, you need to add:

ValidateRequest="false"

to your Page Directive.

If you want to display those entries on the webform, you have to use the proper escape sequences:


string psgpostText2 = psgpost2.Replace("<", "<");


You could also use HttpUtility.HtmlEncode(string) for this.

Replacing a character with the SAME character, as you're doing, is a meaningless operation.



<Added>

I see what's going on. The forum is parsing things for us.

string psgpostText2 = psgpost2.Replace("<", "& lt ;");

The second angle bracket should be the HTML escape code for less-than: ampersand-l-t-semicolon

I've tested it and it works fine.


  Re: text field multiple  eshwar_gp at 06:16 on Wednesday, December 29, 2004
 

Hi:
what you ever you explained is good.

i am able to get proper output for

this is eshwar_gp's testing. < still he is trying >.
< he has to get properputput>yaa.


but,
if i use

this is eshwar_gp's testing. <still he is trying >.
< he has to get properputput>yaa.

note: between < and still there is no space. then it is giving error.

like

A potentially dangerous Request.Form value was detected from the client (TextBox1="... testing. <still he is trying ...").



please solve my problem



regards,
eshwar_gp

  Re: text field multiple  tgreer at 14:49 on Wednesday, December 29, 2004
 

From my previous post:

If you want the user to be able to enter HTML escaped values, you need to add:

ValidateRequest="false"

to your Page Directive.

Like this:

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplicationX.WebForm1" ValidateRequest="false"%>



  Re: text field multiple  eshwar_gp at 07:09 on Thursday, January 06, 2005
 

Thank you site expert.

Thank you for your co-operation to solve this issue.

Regards,
eshwar_gp

  Re: text field multiple  tgreer at 14:59 on Thursday, January 06, 2005
 

You're welcome!



  Re: text field multiple  eshwar_gp at 06:49 on Friday, January 07, 2005
 

Hi site-expert,

And, I am facing one more problem with textfiled-multiple.

I am not able to get entered data in the givien format.

i am missing paragraphs, alignments and others.

If I enter data like
--------------------

private void Button1_Click(object sender, System.EventArgs e)
{
string psgpost1 = (TextBox1.Text);

string psgpostText1 = psgpost1.Replace("'", "'");

Response.Write(psgpost1);

string psgpost2 = psgpostText1;

string psgpostText2 = psgpost2.Replace("<", "<");

Response.Write(psgpostText2);

string psgpost3 = psgpostText2;
string psgpostText = psgpost3.Replace(">", ">");

Response.Write(psgpostText);

}

i am getting like this in my grid
---------------------------------

private void Button1_Click(object sender, System.EventArgs e)
{string psgpost1 = (TextBox1.Text);string psgpostText1 = psgpost1.Replace("'", "'");Response.Write(psgpost1);string psgpost2 = psgpostText1;string psgpostText2 = psgpost2.Replace("<", "<");Response.Write(psgpostText2) ;string psgpost3 = psgpostText2;string psgpostText = psgpost3.Replace(">", ">");Response.Write(psgpostText);}


Plz solve my problem.

Regards,
eshwar_gp




  Re: text field multiple  tgreer at 13:58 on Friday, January 07, 2005
 

You can just call me "Tom".

Response.Write() merely appends data to the Response Stream. It does not format the data. You have to format the data.

So if you want your data to contain line ending characters, you have to add the HTML tag for producing a line, which is "<br>".

Likewise, if you want to produce a paragraph, you must emit the "<p>" and "</p>" tags in the correct places.



  Re: text field multiple  eshwar_gp at 06:19 on Monday, January 10, 2005
 

Hi,
I can put all those. But end user doesnot know like he has to do all these html codes.

In this discission forum also u r able to display data which we entered in this text multiple as we typed.

Let me know how it is working .. Plz..


and, i am displaying data in a grid.

as u said, Response.Write() merely appends data to the Response Stream. It does not format the data. You have to format the data.

Letme know how to format it?

Regards,
eshwar_gp

  Re: text field multiple  iampriya at 07:52 on Saturday, October 18, 2008
 

Please help
I also have the same problem please help

  Re: text field multiple  ladygaga at 07:47 on Tuesday, June 14, 2011
 

christian louboutin pumps
christian louboutin black pumps
Cheap tory burch
fake tory burch flats
fake tory burch shoes
replica tory burch shoes
fake tory burch
tory burch replica shoes


  Re: text field multiple  danaray79 at 21:32 on Tuesday, August 02, 2011
 

I must appreciate you for the information you have shared.I find this information very useful and it has considerably saved my time.thanks

Buy Articles | Life Experience Degree | bachelor degree | Sample Essays

  Re: text field multiple  zara at 03:42 on Monday, August 15, 2011
 

Chanel Store has been pushed out many new bags, which are walking in the forefront of world. Delicate bows and pleats and vivid Chanel Handbags make the flamboyant yet feminine. Its soft curved shape is enhanced with an eye-catching studded golden brass twist lock. Natural cowhide leather trimmings and shoulder strap, it is carried on the shoulder with its adjustable shoulder strap. Chanel Purses are makes of 100% leather with it is weightless materials and roman drapes. Chanel Accessories page where owns sunglasses, scarf, ring, bangle and earring and so on. Cool sunglasses designer is one of the only designer brands that cater specifically for man. This means that their designs are well tailored to the male facial structure and look and fit superbly. The designs are contemporary and dynamic. Buy Chanel where Chanel Watches that you can enjoy a best price during the discount time.









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: no print button on the paper
•  Re: Shared variables
•  Re: whats better way
•  Re: CheapDotNet.com ASP.NET Web Hosting
•  Re: Overflow: Scroll - Back to Top
•  Re: trouble with program
•  louis vuitton outlet
•  louis vuitton outlet
•  louis vuitton outlet


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011