Showing posts with label displayed. Show all posts
Showing posts with label displayed. Show all posts

Saturday, March 31, 2012

Text box values are not being considered?

Currently i m working on a web page that edits the user information. The already stored info. from the database is being displayed in diffrent text boxes so that user can edit it. The problem is that even when user changes the information in the any of the text-boxes & clicks the submit button, then instead of current value of text-boxes the previously assigned value is being considered. Whats the possible cause of this error?

Possibly... your records arent getting updated


bh_84:

Currently i m working on a web page that edits the user information. The already stored info. from the database is being displayed in diffrent text boxes so that user can edit it. The problem is that even when user changes the information in the any of the text-boxes & clicks the submit button, then instead of current value of text-boxes the previously assigned value is being considered. Whats the possible cause of this error?

Are they data bound controls? That could be your problem. Since the page load method will run before the click handler, if those databound controls are populated on every post back, they are likely being overwritten there. You will need to only data bind the text boxes when the page isn't posting back.


No they r simple text box controls. values are being assigned to them using text property & not through data binding but still on submiting, the not the current values but the previous ones are being considered.

Doesn't matter if you are databinding or assigning the values yourself. Probably what is happening is the user changes the value and then hits submit to post back the page. At that point your code is setting the Text property for these text values to whatever the initial value is just like it does when you first load the page and is overwriting whatever change the user made. You are probably always setting the values even on postback so you never get the values the user specifies. In your code you need to only set the values if it is not a postback. So something like:

If (!IsPostBack)

{

// Set all textboxes to initial values here.

}

That is C# so if you're using VB you'll need to do the similar thing in VB. This will make sure that when the page is posted back the textboxes don't get overwritten witih the initial values and have whatever values were entered at the browser.

Wednesday, March 28, 2012

Text Box with yellow background?

Some of the text boxes on my form are being displayed with a yellow backgound, even though the yellow boxes are coded the same as the boxes appearing with a white background. Any ideas what is causing this annoying behaviour?

Thanks....Franco

Its a by product of your Google toolbar, not ASP.NET :}

DOH!


Thanks Curt. You are absolutely right. I wouldn't have thought of that in a thousand years!

Franco

Saturday, March 24, 2012

text overflow ==> "..."

Anyone know of a way, or a control, which would allow me to clip text with a
"..." displayed at the end?

We have a product comparison page, with products lied up side by side... one
of the fields displayed is the manufacturer, and some of them have VERY long
names, so id like to when the name is long, convert it from "Mr Joe Shmoes
Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of having
it crunch all the other products to the side.

Thanks in advance,
- Eidolon.What database are you using? This can be done directly in your SQL or Stored
Procedure.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
news:OCaiU6$9DHA.1392@.tk2msftngp13.phx.gbl...
> Anyone know of a way, or a control, which would allow me to clip text with
a
> "..." displayed at the end?
> We have a product comparison page, with products lied up side by side...
one
> of the fields displayed is the manufacturer, and some of them have VERY
long
> names, so id like to when the name is long, convert it from "Mr Joe Shmoes
> Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of
having
> it crunch all the other products to the side.
> Thanks in advance,
> - Eidolon.
This is an ASP example but the same principle/idea will work
http://www.darkfalz.com/1076/

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com

"Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
news:OCaiU6$9DHA.1392@.tk2msftngp13.phx.gbl...
> Anyone know of a way, or a control, which would allow me to clip text with
a
> "..." displayed at the end?
> We have a product comparison page, with products lied up side by side...
one
> of the fields displayed is the manufacturer, and some of them have VERY
long
> names, so id like to when the name is long, convert it from "Mr Joe Shmoes
> Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of
having
> it crunch all the other products to the side.
> Thanks in advance,
> - Eidolon.
One idea is to test for length, as such and take a subset of the string.

string longname;

if(longname.Length > 300)
{
longname = longname.Substring(0,299);
}

"Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
news:OCaiU6$9DHA.1392@.tk2msftngp13.phx.gbl...
> Anyone know of a way, or a control, which would allow me to clip text with
a
> "..." displayed at the end?
> We have a product comparison page, with products lied up side by side...
one
> of the fields displayed is the manufacturer, and some of them have VERY
long
> names, so id like to when the name is long, convert it from "Mr Joe Shmoes
> Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of
having
> it crunch all the other products to the side.
> Thanks in advance,
> - Eidolon.
If Len(theString) > 10 then
theString = Left(10, theString) & "..."
End If

"Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
news:OCaiU6$9DHA.1392@.tk2msftngp13.phx.gbl...
> Anyone know of a way, or a control, which would allow me to clip text with
a
> "..." displayed at the end?
> We have a product comparison page, with products lied up side by side...
one
> of the fields displayed is the manufacturer, and some of them have VERY
long
> names, so id like to when the name is long, convert it from "Mr Joe Shmoes
> Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of
having
> it crunch all the other products to the side.
> Thanks in advance,
> - Eidolon.
Thank you to everyone who has answered thus far. None of these solutions are
quite what i meant though.

In the Windows API, there is this function PathCompactPath, defined in
SHLWAPI.dll, where you can pass in the pixel width you need a path to fit
in, and it will shorten it as it needs to to fit in the desired length.

I am looking for something similar. I have a table with a variable number of
columns, each column representing a product. The first row in each column is
the manufacturers name. i want all the columns to be the same width across
the page, so i set them in code each to
<code>width='<%=Floor(100/NumCols)%>%'.
When i get one of these really long names though, it blows that column's
width way up, and crowds the other ones off to the side. I want to be able
to have the mfg name be dynamically truncated to fit in the specified column
width (probably in pixels?). Now i think of it, this would likely be more a
client-side scripting thing.

Any ideas, or solutions, appreciated.
Thanks in advance,
- Aaron.

"Scott M." <s-mar@.BADSPAMsnet.net> wrote in message
news:uRBsplA%23DHA.3648@.TK2MSFTNGP09.phx.gbl...
> If Len(theString) > 10 then
> theString = Left(10, theString) & "..."
> End If
>
> "Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
> news:OCaiU6$9DHA.1392@.tk2msftngp13.phx.gbl...
> > Anyone know of a way, or a control, which would allow me to clip text
with
> a
> > "..." displayed at the end?
> > We have a product comparison page, with products lied up side by side...
> one
> > of the fields displayed is the manufacturer, and some of them have VERY
> long
> > names, so id like to when the name is long, convert it from "Mr Joe
Shmoes
> > Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of
> having
> > it crunch all the other products to the side.
> > Thanks in advance,
> > - Eidolon.
A possibility:
In the graphics namespace, there is a MeasureString method, that you can use
to
get the pixel-length of a string (using a specific font).
You could measure your name. If it shorter than you want to allow, no
problem,
else shorten the name until it fits.

Hans Kesting

"Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
news:%239GJSdh%23DHA.1268@.TK2MSFTNGP12.phx.gbl...
> Thank you to everyone who has answered thus far. None of these solutions
are
> quite what i meant though.
> In the Windows API, there is this function PathCompactPath, defined in
> SHLWAPI.dll, where you can pass in the pixel width you need a path to fit
> in, and it will shorten it as it needs to to fit in the desired length.
> I am looking for something similar. I have a table with a variable number
of
> columns, each column representing a product. The first row in each column
is
> the manufacturers name. i want all the columns to be the same width across
> the page, so i set them in code each to
> <code>width='<%=Floor(100/NumCols)%>%'.
> When i get one of these really long names though, it blows that column's
> width way up, and crowds the other ones off to the side. I want to be able
> to have the mfg name be dynamically truncated to fit in the specified
column
> width (probably in pixels?). Now i think of it, this would likely be more
a
> client-side scripting thing.
> Any ideas, or solutions, appreciated.
> Thanks in advance,
> - Aaron.
>
> "Scott M." <s-mar@.BADSPAMsnet.net> wrote in message
> news:uRBsplA%23DHA.3648@.TK2MSFTNGP09.phx.gbl...
> > If Len(theString) > 10 then
> > theString = Left(10, theString) & "..."
> > End If
> > "Eidolon" <eidolonivanovich@.yahoo.com> wrote in message
> > news:OCaiU6$9DHA.1392@.tk2msftngp13.phx.gbl...
> > > Anyone know of a way, or a control, which would allow me to clip text
> with
> > a
> > > "..." displayed at the end?
> > > > We have a product comparison page, with products lied up side by
side...
> > one
> > > of the fields displayed is the manufacturer, and some of them have
VERY
> > long
> > > names, so id like to when the name is long, convert it from "Mr Joe
> Shmoes
> > > Super Duper Electronics Builder" to "Mr Joe Shmoes Sup..." instead of
> > having
> > > it crunch all the other products to the side.
> > > > Thanks in advance,
> > > - Eidolon.
> >

Text that will appear on a Hyperlink

Hi guys,

Do you know the property on a hyperlink where if the user puts his mouse on the hyperlink, a message will be displayed about that hyperlink. I mean like on this forum, you just hover your mouse pointer on the title of the thread and you will see the message inside. Something like that.

Thanks,

Willy David Jr

ToolTip


Do you mean tooltips?

set it like <a title="tooltips message here" href="http://links.10026.com/?link=http://forums.asp.net/AddPost.aspx?ReplyToPostID=1851390&Quote=False#">LINK</a>


Do you mean tooltips?

set it like <a title="tooltips message here" href="http://links.10026.com/?link=urlhere">LINK</a>


Hi onionpunk,

Thanks for that!

//Willy


For a Hyperlink Button , we have a property called ToolTip where we can give the message that we wish to appear when the mouse is hover on the Hyperlink Button Similarly , if you want to Navigate to the other page when you click the Button , just place the url in Navigate Url property

Thursday, March 22, 2012

Text-based controls: Formatting as inline elements

I have had a question that I have been avoiding or using workarounds for for
a while. When using text-based controls (Labels, HyperLinks displayed as
text, LinkButtons, etc.), how do I format certain parts differently? For
example, I might have a set of instructions that I want keywords displayed
in a different color, or there might be a certain word that I want to
display as a link. When the text is all on the same line, I can simply place
the controls next to each other. But when the text will need to wrap to the
next line, this causes a problem. It is also rather tedious to use so many
controls just for a few links. Does anyone know of an efficient solution to
this problem? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/How about using javascript to perform global replace on document.InnerHtml
at onload event? I've not tested it but I think it should work.

"Nathan Sokalski" <njsokalski@.hotmail.com> glsD:ut$GsMXvFHA.4032@.TK2MSFTNGP15.phx.g bl...
>I have had a question that I have been avoiding or using workarounds for
>for a while. When using text-based controls (Labels, HyperLinks displayed
>as text, LinkButtons, etc.), how do I format certain parts differently? For
>example, I might have a set of instructions that I want keywords displayed
>in a different color, or there might be a certain word that I want to
>display as a link. When the text is all on the same line, I can simply
>place the controls next to each other. But when the text will need to wrap
>to the next line, this causes a problem. It is also rather tedious to use
>so many controls just for a few links. Does anyone know of an efficient
>solution to this problem? Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/

Text-based controls: Formatting as inline elements

I have had a question that I have been avoiding or using workarounds for for
a while. When using text-based controls (Labels, HyperLinks displayed as
text, LinkButtons, etc.), how do I format certain parts differently? For
example, I might have a set of instructions that I want keywords displayed
in a different color, or there might be a certain word that I want to
display as a link. When the text is all on the same line, I can simply place
the controls next to each other. But when the text will need to wrap to the
next line, this causes a problem. It is also rather tedious to use so many
controls just for a few links. Does anyone know of an efficient solution to
this problem? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/How about using javascript to perform global replace on document.InnerHtml
at onload event? I've not tested it but I think it should work.
"Nathan Sokalski" <njsokalski@.hotmail.com> glsD:ut$GsMXvFHA.4032@.TK2MSFTNGP15.phx
.gbl...
>I have had a question that I have been avoiding or using workarounds for
>for a while. When using text-based controls (Labels, HyperLinks displayed
>as text, LinkButtons, etc.), how do I format certain parts differently? For
>example, I might have a set of instructions that I want keywords displayed
>in a different color, or there might be a certain word that I want to
>display as a link. When the text is all on the same line, I can simply
>place the controls next to each other. But when the text will need to wrap
>to the next line, this causes a problem. It is also rather tedious to use
>so many controls just for a few links. Does anyone know of an efficient
>solution to this problem? Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>

Tuesday, March 13, 2012

TextBox & label Bug

I am not able to align the numbers displayed in a textbox or a label to right side.

It is terrible problem and spent 2 hours in resolving the problem

Instead of displaying Values in the textbox or label i directly displayed in the table with right align.

Now it was working properly but every time the post back happens the values get empty

Please help to solve the problem. It urgent.

Hi,

have you tried just doing it like this

<asp:TextBox ID="TextBox1" runat="server" Text="text in TextBox"style="text-align:right" Width="200" /><br />
<asp:Label ID="Label1" runat="server" Text="text in Label"style="text-align:right" Width="200" />

Should work fine. Can you clarify what you mean by values getting empty after postback? How have you declared the controls and where do you assign the Text?


I did not get this idea.

Thanks.

I created some variables in the code file and i called this variables using <%= txtname %>

the values are getting empty when the postback happens, i have declared the variables

below the class file ?

What should i do to retain the values ?

2. I want to format the numbers like ##,##,##,###.00 ?. I have given it but the numbers

are not getting formatted in the textbox .


Wow, it's amazing how people with no clue cry out "bug in the system!" so easily

i was of thinking of windows forms where it is easy to specify the location , size & alignment

If the same property would have for webforms it would be easier for the developer.

Further , It would be great full how to do the number formatting of a text box according

to the indian style like 0:##,##,##,###.00.


Ganesh@.Nilgris:

I did not get this idea.

Thanks.

I created some variables in the code file and i called this variables using <%= txtname %>

the values are getting empty when the postback happens, i have declared the variables

below the class file ?

What should i do to retain the values ?

Standard variables created on class should use ViewState in order to preserve their state over postbacks. Reason is simple. Page class and controls are recreated for each request (also postback) so they are initialized to defaults.

Instead of using say

private int SampleInteger = 0;

Use a property

protected int SampleIntegerProperty
{
get
{

int retVal = 0;
object obj = ViewState["SampleIntegerProperty"];
if (obj != null)
{
retVal = (int)obj;
}
return retVal;
}
set
{
ViewState["SampleIntegerProperty"] = value;
}
}

Ganesh@.Nilgris:

2. I want to format the numbers like ##,##,##,###.00 ?. I have given it but the numbers

are not getting formatted in the textbox .

You can use String.Format.http://msdn2.microsoft.com/en-us/library/b1csw23d.aspx


I require a urgent solution for formatting the number , but the hyperlink is not giving a rigid answer.

Please help

Ganesh@.nilgris

TextBox and Passwords

Hi,

When you set a textbox's TextMode to password, does this just stop the
password being displayed on the client machine or does it send the data to
the server encrypted.

Cheers

gwcNo it just means that it renders an HTML input tag of type password instead
of of type text, so it displays *** instead of the text you enter into it.
No encryption takes place.

"Gary Coutts" wrote:

Quote:

Originally Posted by

Hi,
>
When you set a textbox's TextMode to password, does this just stop the
password being displayed on the client machine or does it send the data to
the server encrypted.
>
>
Cheers
>
gwc
>
>
>


So does that mean that the password data is sent as plaintext back to the
server on a postback.

How do you protected against this data being snooped. As I presume to
encrypt it the data needs to be sent to the server for encryption.

"clickon" <clickon@.discussions.microsoft.comwrote in message
news:53724A74-9451-4B14-AC50-0E16034018A4@.microsoft.com...

Quote:

Originally Posted by

No it just means that it renders an HTML input tag of type password
instead
of of type text, so it displays *** instead of the text you enter into it.
No encryption takes place.
>
"Gary Coutts" wrote:
>

Quote:

Originally Posted by

>Hi,
>>
>When you set a textbox's TextMode to password, does this just stop the
>password being displayed on the client machine or does it send the data
>to
>the server encrypted.
>>
>>
>Cheers
>>
>gwc
>>
>>
>>


Hi,

Gary Coutts wrote:

Quote:

Originally Posted by

So does that mean that the password data is sent as plaintext back to the
server on a postback.


Yes, that's correct.

Quote:

Originally Posted by

How do you protected against this data being snooped. As I presume to
encrypt it the data needs to be sent to the server for encryption.


That's what SSL (HTTPS) is for.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Yes the password is sent plain text. to encrypt it you need to use SSL on
the server.

"Gary Coutts" wrote:

Quote:

Originally Posted by

So does that mean that the password data is sent as plaintext back to the
server on a postback.
>
How do you protected against this data being snooped. As I presume to
encrypt it the data needs to be sent to the server for encryption.
>
>
>
>
"clickon" <clickon@.discussions.microsoft.comwrote in message
news:53724A74-9451-4B14-AC50-0E16034018A4@.microsoft.com...

Quote:

Originally Posted by

No it just means that it renders an HTML input tag of type password
instead
of of type text, so it displays *** instead of the text you enter into it.
No encryption takes place.

"Gary Coutts" wrote:

Quote:

Originally Posted by

Hi,
>
When you set a textbox's TextMode to password, does this just stop the
password being displayed on the client machine or does it send the data
to
the server encrypted.
>
>
Cheers
>
gwc
>
>
>


>
>
>