Hello,
I have an existing repeater on my web application that has descriptions, item numbers, and prices. The marketing person at my company wants me to add a field so that the sales people can enter discounted prices next to the regular prices. So I'm going to have to add a asp:textbox to the repeater.
What would be the easiest way of adding text fields in the repeater so that when there is input the values would add up in a label. I won't know how many items there will be in the repeater.
I'll probably need to write some javascript for this but I'm wondering what the best way of doing this is?
Thanks!
JamesIt might help if I knew how to check to see if a control exists or not? Anyone know?
The repeater should have a .Controls property with a .Length or .Count. (Count, I beleive).
From there, just start a standard FOR loop and check each control. The .ToString on the control indexer (myRepeater.Controls[i].ToString()) will tell you what TYPE of control it is. Only check the textbox types...
Showing posts with label input. Show all posts
Showing posts with label input. Show all posts
Saturday, March 31, 2012
Wednesday, March 28, 2012
Text direction in textbox
Hi guys, is there any property in the textbox control that allows the user to input text in a right-to-left text direction?
Thanks.There is a CSS style attribute calledlayout-flow
In the html header of you page, put the following to control the flow in all form elements (e.g. textboxes included):
<STYLE>
INPUT {layout-flow : vertical-ideographic}
</STYLE>
Thursday, March 22, 2012
TextArea in a Web Service
I added a TextArea to my aspx form to store user input. However, when I use
strComment = txtComment.text
I get an error saying 'text' is not a member of 'System.Web.UI.HtmlControls.HtmlTextArea'.
This is because TextArea is an HTML control. So how do I use a TextArea and store user input as a string?? I cannot get away with using a textbox in this situation.
Much Appreciated.txtComment.Value gets the string.
textbox
hello
I need a text box the enables input numbers from right to left. does any
know of such a control?
yoramo.You can achieve this through css:
Put the following between the <HEAD></HEAD> tags in your html view. ( or use
a style sheet )
<style>
..sample {text-align: right;}
</style
In the designer, assign the textbox's "CssClass" = sample;
You should be good to go.
David Young
"yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> hello
> I need a text box the enables input numbers from right to left. does any
> know of such a control?
> yoramo.
thats not what i need.
i need to be able to key in numbers from right to left.
example: "123" should be key in '3','2','1'
"dm_dal" <REMOVE_THIS.dmy75252@.yahoo.com> wrote in message
news:eigBSu17DHA.2416@.TK2MSFTNGP10.phx.gbl...
> You can achieve this through css:
> Put the following between the <HEAD></HEAD> tags in your html view. ( or
use
> a style sheet )
> <style>
> .sample {text-align: right;}
> </style>
> In the designer, assign the textbox's "CssClass" = sample;
> You should be good to go.
> David Young
> "yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
> news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> > hello
> > I need a text box the enables input numbers from right to left. does any
> > know of such a control?
> > yoramo.
Ok...you want to reverse the order in which the values are typed in?
Let me chew on that a little and I'll get back with you.
David Young
"yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
news:elwLh217DHA.3380@.tk2msftngp13.phx.gbl...
> thats not what i need.
> i need to be able to key in numbers from right to left.
> example: "123" should be key in '3','2','1'
>
> "dm_dal" <REMOVE_THIS.dmy75252@.yahoo.com> wrote in message
> news:eigBSu17DHA.2416@.TK2MSFTNGP10.phx.gbl...
> > You can achieve this through css:
> > Put the following between the <HEAD></HEAD> tags in your html view. ( or
> use
> > a style sheet )
> > <style>
> > .sample {text-align: right;}
> > </style>
> > In the designer, assign the textbox's "CssClass" = sample;
> > You should be good to go.
> > David Young
> > "yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
> > news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> > > hello
> > > > I need a text box the enables input numbers from right to left. does
any
> > > know of such a control?
> > > > yoramo.
> >
You may need to create a custom textbox that does some JavaScript
manipulation on the client side. Handling the key events and adding the new
keystroke to the beginning of the existing string. Not being a guru at
JavaScript I can't give you details, but the concept should hold.
-- Jim --
"yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> hello
> I need a text box the enables input numbers from right to left. does any
> know of such a control?
> yoramo.
I need a text box the enables input numbers from right to left. does any
know of such a control?
yoramo.You can achieve this through css:
Put the following between the <HEAD></HEAD> tags in your html view. ( or use
a style sheet )
<style>
..sample {text-align: right;}
</style
In the designer, assign the textbox's "CssClass" = sample;
You should be good to go.
David Young
"yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> hello
> I need a text box the enables input numbers from right to left. does any
> know of such a control?
> yoramo.
thats not what i need.
i need to be able to key in numbers from right to left.
example: "123" should be key in '3','2','1'
"dm_dal" <REMOVE_THIS.dmy75252@.yahoo.com> wrote in message
news:eigBSu17DHA.2416@.TK2MSFTNGP10.phx.gbl...
> You can achieve this through css:
> Put the following between the <HEAD></HEAD> tags in your html view. ( or
use
> a style sheet )
> <style>
> .sample {text-align: right;}
> </style>
> In the designer, assign the textbox's "CssClass" = sample;
> You should be good to go.
> David Young
> "yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
> news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> > hello
> > I need a text box the enables input numbers from right to left. does any
> > know of such a control?
> > yoramo.
Ok...you want to reverse the order in which the values are typed in?
Let me chew on that a little and I'll get back with you.
David Young
"yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
news:elwLh217DHA.3380@.tk2msftngp13.phx.gbl...
> thats not what i need.
> i need to be able to key in numbers from right to left.
> example: "123" should be key in '3','2','1'
>
> "dm_dal" <REMOVE_THIS.dmy75252@.yahoo.com> wrote in message
> news:eigBSu17DHA.2416@.TK2MSFTNGP10.phx.gbl...
> > You can achieve this through css:
> > Put the following between the <HEAD></HEAD> tags in your html view. ( or
> use
> > a style sheet )
> > <style>
> > .sample {text-align: right;}
> > </style>
> > In the designer, assign the textbox's "CssClass" = sample;
> > You should be good to go.
> > David Young
> > "yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
> > news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> > > hello
> > > > I need a text box the enables input numbers from right to left. does
any
> > > know of such a control?
> > > > yoramo.
> >
You may need to create a custom textbox that does some JavaScript
manipulation on the client side. Handling the key events and adding the new
keystroke to the beginning of the existing string. Not being a guru at
JavaScript I can't give you details, but the concept should hold.
-- Jim --
"yoramo" <yoramo@.[NOSPAM]hotmail.com> wrote in message
news:OGHAhi17DHA.1596@.TK2MSFTNGP10.phx.gbl...
> hello
> I need a text box the enables input numbers from right to left. does any
> know of such a control?
> yoramo.
Textbox
Dear The Expert,
I need to set the textbox to allow numeric input only and it automatically display with thousand separator and 2 decimal symbol.. how to do this?
Please help
Thanks
WinanjayaThere are a few ways to do it. there are validator controls that will check tha value of your text box client side or you can validate on the server side using regular expressions.
public static bool Validate(string DirtyString, string RegularExpresion)
{
bool passed = true;
System.Web.HttpContext curr = System.Web.HttpContext.Current;
string currcell = curr.Server.HtmlEncode(DirtyString);
currcell = currcell.Trim();
if (passed == PassedFilter(currcell,RegularExpresion))
{
return true;
}
else
{
return false;
}
}
public static bool PassedFilter(string DirtyString, string FilterExp)
{
string cleanstring = "";
foreach (Match charMatch in System.Text.RegularExpressions.Regex.Matches(DirtyString, FilterExp))
{
cleanstring = cleanstring + charMatch;
}
if (cleanstring.Length == DirtyString.Length)
{
return true;
}
else
{
return false;
}
}
This is the server side way. Pass the string you want to validate and the regular expression to validate against it.
I need to set the textbox to allow numeric input only and it automatically display with thousand separator and 2 decimal symbol.. how to do this?
Please help
Thanks
WinanjayaThere are a few ways to do it. there are validator controls that will check tha value of your text box client side or you can validate on the server side using regular expressions.
public static bool Validate(string DirtyString, string RegularExpresion)
{
bool passed = true;
System.Web.HttpContext curr = System.Web.HttpContext.Current;
string currcell = curr.Server.HtmlEncode(DirtyString);
currcell = currcell.Trim();
if (passed == PassedFilter(currcell,RegularExpresion))
{
return true;
}
else
{
return false;
}
}
public static bool PassedFilter(string DirtyString, string FilterExp)
{
string cleanstring = "";
foreach (Match charMatch in System.Text.RegularExpressions.Regex.Matches(DirtyString, FilterExp))
{
cleanstring = cleanstring + charMatch;
}
if (cleanstring.Length == DirtyString.Length)
{
return true;
}
else
{
return false;
}
}
This is the server side way. Pass the string you want to validate and the regular expression to validate against it.
Tuesday, March 13, 2012
textbox and password type input
Hello!
just would like to know. when i set an ASP textbox control to be of input
type password, i can't do a "txtPassword.Text = "value"". when the page
renders the control just appears empty. why would that be? is this by
design? how would i get passed this, cause i do need to populate that box
with a value?
Thanks
JasonIt is by design, for security reasons - so that the password is not in the
HTML in plain text.
Now, you could write out javascript to set the value property of the textbox
on the client, of course this would still mean that you have the password in
plain text in the HTML.
"Jason" <c_bananas@.mighty.co.za> wrote in message
news:el9It5l6DHA.632@.TK2MSFTNGP12.phx.gbl...
> Hello!
> just would like to know. when i set an ASP textbox control to be of input
> type password, i can't do a "txtPassword.Text = "value"". when the page
> renders the control just appears empty. why would that be? is this by
> design? how would i get passed this, cause i do need to populate that box
> with a value?
> Thanks
> Jason
its by design. to set the value, use attributes.
txtPassword.Attributes["value"]="password";
-- bruce (sqlwork.com)
"Jason" <c_bananas@.mighty.co.za> wrote in message
news:el9It5l6DHA.632@.TK2MSFTNGP12.phx.gbl...
> Hello!
> just would like to know. when i set an ASP textbox control to be of input
> type password, i can't do a "txtPassword.Text = "value"". when the page
> renders the control just appears empty. why would that be? is this by
> design? how would i get passed this, cause i do need to populate that box
> with a value?
> Thanks
> Jason
just would like to know. when i set an ASP textbox control to be of input
type password, i can't do a "txtPassword.Text = "value"". when the page
renders the control just appears empty. why would that be? is this by
design? how would i get passed this, cause i do need to populate that box
with a value?
Thanks
JasonIt is by design, for security reasons - so that the password is not in the
HTML in plain text.
Now, you could write out javascript to set the value property of the textbox
on the client, of course this would still mean that you have the password in
plain text in the HTML.
"Jason" <c_bananas@.mighty.co.za> wrote in message
news:el9It5l6DHA.632@.TK2MSFTNGP12.phx.gbl...
> Hello!
> just would like to know. when i set an ASP textbox control to be of input
> type password, i can't do a "txtPassword.Text = "value"". when the page
> renders the control just appears empty. why would that be? is this by
> design? how would i get passed this, cause i do need to populate that box
> with a value?
> Thanks
> Jason
its by design. to set the value, use attributes.
txtPassword.Attributes["value"]="password";
-- bruce (sqlwork.com)
"Jason" <c_bananas@.mighty.co.za> wrote in message
news:el9It5l6DHA.632@.TK2MSFTNGP12.phx.gbl...
> Hello!
> just would like to know. when i set an ASP textbox control to be of input
> type password, i can't do a "txtPassword.Text = "value"". when the page
> renders the control just appears empty. why would that be? is this by
> design? how would i get passed this, cause i do need to populate that box
> with a value?
> Thanks
> Jason
Subscribe to:
Posts (Atom)