Showing posts with label typed. Show all posts
Showing posts with label typed. Show all posts

Saturday, March 31, 2012

Text Box to search contents in a Gridview Control

Hello,
I have seen several examples with a dropdownlist filtering the results in a
gridview.
Is there a way to have information typed in a text box used to filter a
gridview?
I would like to for example search on a persons first name and any first
name that contains the contents of my text box appear in the gridview list.The datasource object selectParameters allows you to use the ControlParamete
r
against a TextBox, e.g.
<asp:ControlParameter ControlID="txtCustomer" Name="CustomerID"
PropertyName="Text" Type="String" />
This sample uses a dropdownlist box:
http://www.webswapp.com/CodeSamples...ridView_2c.aspx
and this sample does the same exact filtering using a TextBox:
http://www.webswapp.com/CodeSamples...ridView_3c.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"mimo" wrote:
> Hello,
> I have seen several examples with a dropdownlist filtering the results in
a
> gridview.
> Is there a way to have information typed in a text box used to filter a
> gridview?
> I would like to for example search on a persons first name and any first
> name that contains the contents of my text box appear in the gridview list.[/color
]

Text Box to search contents in a Gridview Control

Hello,

I have seen several examples with a dropdownlist filtering the results in a
gridview.

Is there a way to have information typed in a text box used to filter a
gridview?

I would like to for example search on a persons first name and any first
name that contains the contents of my text box appear in the gridview list.The datasource object selectParameters allows you to use the ControlParameter
against a TextBox, e.g.
<asp:ControlParameter ControlID="txtCustomer" Name="CustomerID"
PropertyName="Text" Type="String" /
This sample uses a dropdownlist box:
http://www.webswapp.com/CodeSamples...ridView_2c.aspx
and this sample does the same exact filtering using a TextBox:
http://www.webswapp.com/CodeSamples...ridView_3c.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

"mimo" wrote:

> Hello,
> I have seen several examples with a dropdownlist filtering the results in a
> gridview.
> Is there a way to have information typed in a text box used to filter a
> gridview?
> I would like to for example search on a persons first name and any first
> name that contains the contents of my text box appear in the gridview list.

Wednesday, March 28, 2012

Text Countdown

I want create a text countdown control that counts text down as its typed in a textbox or textarea

how do i go about doing this using c#

Not sure C# is really the way to go with this, Javascript is probably a better choice.

Here's an example I found by Googling:

http://www.smartwebby.com/DHTML/textbox_characters_counter.asp


C# example

http://www.rosshawkins.net/rfh/articles/asp.net-text-counter.html


That's a combination of c# and JavaScript - rather than one or t'other

Smile

Thursday, March 22, 2012

textarea viewstate formatting

Hello.

What I am trying to do is implement a "preview" function that displays all of the html typed within a textarea onto a webpage with HTML intact. I am using the viewstate to preserve the contents of the textarea. However, I find that doing this replaces all "<" with "<", ">" with ">". As a result, the preview does not render any HTML.

It appears that viewstate with asp.net automatically converts the chars, perhaps as insurance to "sterilize" malicious script. Can someone confirm this?

Is there a way to prevent it from converting the carat characters for the viewState preservation? Or is it a fact of life that I'll need to manually convert them back?

Thanks,
walla118Thanks niceguy.

I just realized that HtmlDecode would work for my purposes. And your idea about using javascript to display preview might be a good way to go!

Thanks again.
Hi walla118,

Have you tried using:


HttpContext.Current.Server.HtmlEncode
HttpContext.Current.Server.HtmlDecode

These may help...?

I found that it is easier to open a pop-up using javascript for a "preview" rather than doing it server side...just a thought.

Hope this helps!

Jason