Page 1 of 1

text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:19 am
by ranjita.damle
Entering "`" inside a text box and submitting a page, generating

<INPUT id=_ctl0_SearchFilter_SearchText value=` name=_ctl0:SearchFilter:SearchText>
on the screen onstead of a text box control.

Here the problem is with value = ` which should be "`"

but this code is getting called from many other places. and there it is not a issue.
From some pages, it is causing this problem.

Does anybody have any idea about this kind of issue?

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:23 am
by adroit
Hi,

Use text box like this

<INPUT id="_ctl0_SearchFilter_SearchText" value="" name="_ctl0:SearchFilter:SearchText">

Regards,
Pravin

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:34 am
by ranjita.damle
No, i can't, this name and values are getting generated dynamically, with client side registration of each control. This means Text box name and values are generated on client side registration of a text box control.

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:42 am
by adroit
You need to edit the generating code and apply quotes ('' or "").

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:47 am
by ranjita.damle
i tried appending " " to the generated value but then it shows the value with " " inside the text box. someting like "`" or "abc" inside a text box.

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:53 am
by adroit
Can you please paste the generation code here.

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 5:58 am
by ranjita.damle
in the code generated, it doesnt show that control with the value, but on the screen, it shows this code as it is....

<INPUT id=_ctl0_SearchFilter_SearchText value=` name=_ctl0:SearchFilter:SearchText>


generated code i cant paste, since it is around 63 pages of word doc.

But the above line of code is getting displayed on the screen.

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 6:01 am
by adroit
I mean the script used to generate this textbox.

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 6:21 am
by ranjita.damle
it is a normal control defined in HTML,

<asp:textbox id="SearchText" runat="server"></asp:textbox>

only its value is assigned on server side.

and it is working fiine for some other places. the same code gets called from around 20 places, among that 4-5 places this issue i am getting.

i am confused why it has different behavior.

Re: text box is diaplayed as <input tag on screen

Posted: Wed Oct 08, 2008 10:30 am
by pickle
Proper XHTML should have all attribute values inside double or single quotes. If they're not, behaviour is not predictable.