473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Textbox server control problem

Does anyone ever see this happen.

I build a form with couple of textbox server control. When user inputs
character ` in there, after form post back, the textbox become a line
of string such as <INPUT id=_txtName style="WIDTH: 70%" value=`
name=_txtName>.

I can filter out ` from the inputs, but it seems like a microsoft bug
to me.

Any ideas?

Nov 19 '05 #1
5 1709
On Wed, 25 May 2005 12:00:45 -0500, <ha****@hotmail.com> wrote:
Does anyone ever see this happen.

I build a form with couple of textbox server control. When user inputs
character ` in there, after form post back, the textbox become a line
of string such as <INPUT id=_txtName style="WIDTH: 70%" value=`
name=_txtName>.

I can filter out ` from the inputs, but it seems like a microsoft bug
to me.

Any ideas?


Hmm, doesn't do this for me (v 1.1). .NET will replace double-quotes with
&quot; if needed, to prevent problems in the HTML, otherwise single-quote
works fine, no problems displaying or setting the value.

Can you post the aspx code? For the textbox, and any other special code
you're using on the textbox, outside of just setting its .Text property.
Explain what you're doing in the UI as a user, etc.

Also make sure your HTML in the aspx is valid (all tags properly closed,
etc.)...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2
It isn't not single-quote, it is `, the charactor under ~.

Nov 19 '05 #3
On Wed, 25 May 2005 12:47:16 -0500, <ha****@hotmail.com> wrote:
It isn't not single-quote, it is `, the charactor under ~.


Sorry :) That one still works for me. I can type it in and in
server-code set another textbox.Text equal to it and works fine.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #4
I appreciated your help. I tried create a new form from scratch, and
just like you said, it works fine. So it gotta be something wrong with
my code. I'll post the aspx file and c# file below.

<%@ Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<title>Business Card Order Form</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link href="Styles.css" rel="stylesheet" type="text/css">
</HEAD>
<body>
<form id="_frmHome" method="post" runat="server">
<table width="660" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td></td>
</tr>
<tr>
<td class="iboard">
<table width="98%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td colspan="2" height="3"></td>
</tr>
<tr>
<td width="70%" align="center">
<asp:Label id="_lblName" runat="server"
cssclass="iName"></asp:Label></td>
<td align="center">
<asp:Label id="_lblTitle" runat="server"
cssclass="iTNameBig"></asp:Label></td>
</tr>
<tr>
<td colspan="2" height="3"></td>
</tr>
<tr>
<td colspan="2" height="1" bgcolor="#9999ff"></td>
</tr>
<tr>
<td colspan="2" height="3"></td>
</tr>
<tr>
<td colspan="2">
<asp:PlaceHolder id="_phAction" runat="server"
EnableViewState="True" Visible="True">
<table width="80%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td>
<asp:RadioButtonList id="_rblAction" runat="server"
cssclass="iTab" AutoPostBack="True">
<asp:ListItem>To order Business Card for myself</asp:ListItem>
<asp:ListItem>To order Business Card for others</asp:ListItem>
</asp:RadioButtonList></td>
</tr>
</table>
</asp:PlaceHolder>
<asp:PlaceHolder id="_phSearch" runat="server"
EnableViewState="true" Visible="False">
<table width="98%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td>
<fieldset class="iboard"><legend class="iTab">Search</legend>
<table width="95%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td colspan="2" height="3"></td>
</tr>
<tr>
<td width="30%" align="right" class="iTab">Search By Last Name
&nbsp;</td>
<td>
<asp:TextBox id="_txtLName" runat="server"
Width="70%"></asp:TextBox></td>
</tr>
<tr>
<td align="right" class="iTab">Search By Login &nbsp;</td>
<td>
<asp:TextBox id="_txtLogin" runat="server"
Width="70%"></asp:TextBox>&nbsp;&nbsp;
<asp:Button id="_btnSearch" runat="server"
Text="Search"></asp:Button></td>
</tr>
<tr>
<td colspan="2" height="3"></td>
</tr>
</table>

</fieldset></td>
</tr>
<tr>
<td colspan="2" height="3"></td>
</tr>
</table>
</asp:PlaceHolder>
</td>
</tr>
<tr>
<td colspan="2" height="5"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form>
</body>
</HTML>


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using FirmWide.DataAccessLayer;
using BizCard.BusinessLogic;
using FirmWide.BusinessLayer.DirectoryAccess;

public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlForm _frmHome;
protected System.Web.UI.WebControls.Label _lblName;
protected System.Web.UI.WebControls.Label _lblTitle;
protected System.Web.UI.WebControls.RadioButtonList _rblAction;
protected System.Web.UI.WebControls.PlaceHolder _phAction;
protected System.Web.UI.WebControls.PlaceHolder _phSearch;
protected System.Web.UI.WebControls.TextBox _txtLName;
protected System.Web.UI.WebControls.TextBox _txtLogin;
protected System.Web.UI.WebControls.Button _btnSearch;
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
_phAction.Visible = true;
_phSearch.Visible = false;
}
this.SmartNavigation = true;
}

override protected void OnInit(EventArgs e)
{

InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this._rblAction.SelectedIndexChanged += new
System.EventHandler(this._rblAction_SelectedIndexC hanged);
this._btnSearch.Click += new
System.EventHandler(this._btnSearch_Click);
this.Load += new System.EventHandler(this.Page_Load);
}

private void _rblAction_SelectedIndexChanged(object sender,
System.EventArgs e)
{
switch (_rblAction.SelectedIndex)
{
case 0:
{
break;
}
case 1:
{
_phAction.Visible = false;
_phSearch.Visible = true;
break;
}
}
}

private void _btnSearch_Click(object sender, System.EventArgs e)
{

}
}

Would you mind give it a try?

Thanks.

Nov 19 '05 #5
After further investigation, I found that when enable smartnavigation
in the form, this problem start to happen. So it is a Bug from
Microsoft.

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Scragg | last post by:
Hi all: Through a Session variable, I am populating among other things the password field in a user's profile page (the Webform); this.TextBoxConfirmPassword.Text = Convert.ToString(Session);...
1
by: DesignerX | last post by:
In classic ASP/HTML you set the length and maxlength of a textbox (so the width of the control is appropriately drawn for the number of characters that can be entered. How is this done with a...
2
by: Shailesh | last post by:
Hello everybody! I am facing one strange problem with my asp.net application. I have created an asp.net web application, in which I added only one web form. In this web form I have placed some...
4
by: Neil Stevens | last post by:
Hi, Merry Christmas to you all. I have a problem with server controls, i am writing a C# ASP.NET web project and i am creating custom server controls for some of the more common element. One...
1
by: Jitendra Singh via .NET 247 | last post by:
If I start a thread in code behind and that thread, after the page got loaded, want to update the value in TextBox(Server control or HTML control). It gives no error but value is not shown on the...
7
by: walter | last post by:
Here is my case : I create a user control which contains One checkbox control to enable/disable the other two textbox control. I'm using server control instead of HTML control, and I don't want to...
4
by: sreejith.ram | last post by:
What is the difference/advantages/disadvantages of using Textbox Web Control over HTML Text Box with Run at Server? I could'nt figure out a convincing answer. I was testing it this morning.. I...
1
by: dotnetguys | last post by:
Hi there, I want to pass textbox server control value through anchor tag to some other form how do i do Can somebody help me for this. Thanks
3
by: sudhashekhar30 | last post by:
i have dropdownlist with data. based on selected item(dropdownlist) i am retrieving data(single value) from database(sql server) using sqldataadapter and wanted to show this value in textbox. I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.