Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Saturday, March 31, 2012

Text Box Control MaxLenght Property Is Not Working

Hi All,

I have developed one web application.
In that I used aspnet web textBox control.
I have set maxlength property for that text box 300 and TextMode property as
multiline .

When i typed more than 3 or 4 line each line contains 30 to 40 characters,
If i clicked button for passing textbox value, that time my web page is not
responsding (no action taken).

The same page without refereshing if i delete some characters from my
textbox.
It is working.

Can someone help me for this?

--
Regards,
DhanaDhana,

What browser are you using?

"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
A TextBox in MultiLine mode is rendered as a TextArea HTML control. TextArea
as opposed to an Imput control does not have a maxlength property. It will
be ignored in the TextBox.

There are some 3rd party controls and projects out there that attempt to
control length with javascript for a multiline textbox. I haven't used any
of them so can't comment.

--

Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org

"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
Ah yeah...

Try using a javscript function like:

function limitTextarea(textarea, maxlength) {
if (textarea.value.length > maxlength)
textarea.value = textarea.value.substring(0, maxlength);
}

and set the onchange attribute (either programatically with
textbox.attribute.add() or declaratively) on the textbox to call the
function.

"Andrew Robinson" <nemoby@.nospam.nospam> wrote in message
news:%23FQJ$5hDGHA.3820@.TK2MSFTNGP10.phx.gbl...
>A TextBox in MultiLine mode is rendered as a TextArea HTML control.
>TextArea as opposed to an Imput control does not have a maxlength property.
>It will be ignored in the TextBox.
> There are some 3rd party controls and projects out there that attempt to
> control length with javascript for a multiline textbox. I haven't used any
> of them so can't comment.
> --
> Andrew Robinson
> www.binaryocean.com
> www.bellinghamdotnet.org
>
> "Dhana" <dhana@.celtycs-consulting.com> wrote in message
> news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
>>
>> Hi All,
>>
>> I have developed one web application.
>> In that I used aspnet web textBox control.
>> I have set maxlength property for that text box 300 and TextMode property
>> as multiline .
>>
>> When i typed more than 3 or 4 line each line contains 30 to 40
>> characters,
>> If i clicked button for passing textbox value, that time my web page is
>> not responsding (no action taken).
>>
>> The same page without refereshing if i delete some characters from my
>> textbox.
>> It is working.
>>
>> Can someone help me for this?
>>
>> --
>> Regards,
>> Dhana
>>
>>
>>

Text Box Control MaxLenght Property Is Not Working

Hi All,
I have developed one web application.
In that I used aspnet web textBox control.
I have set maxlength property for that text box 300 and TextMode property as
multiline .
When i typed more than 3 or 4 line each line contains 30 to 40 characters,
If i clicked button for passing textbox value, that time my web page is not
responsding (no action taken).
The same page without refereshing if i delete some characters from my
textbox.
It is working.
Can someone help me for this?
Regards,
DhanaDhana,
What browser are you using?
"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
>
>
A TextBox in MultiLine mode is rendered as a TextArea HTML control. TextArea
as opposed to an Imput control does not have a maxlength property. It will
be ignored in the TextBox.
There are some 3rd party controls and projects out there that attempt to
control length with javascript for a multiline textbox. I haven't used any
of them so can't comment.
Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org
"Dhana" <dhana@.celtycs-consulting.com> wrote in message
news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi All,
> I have developed one web application.
> In that I used aspnet web textBox control.
> I have set maxlength property for that text box 300 and TextMode property
> as multiline .
> When i typed more than 3 or 4 line each line contains 30 to 40 characters,
> If i clicked button for passing textbox value, that time my web page is
> not responsding (no action taken).
> The same page without refereshing if i delete some characters from my
> textbox.
> It is working.
> Can someone help me for this?
> --
> Regards,
> Dhana
>
>
Ah yeah...
Try using a javscript function like:
function limitTextarea(textarea, maxlength) {
if (textarea.value.length > maxlength)
textarea.value = textarea.value.substring(0, maxlength);
}
and set the onchange attribute (either programatically with
textbox.attribute.add() or declaratively) on the textbox to call the
function.
"Andrew Robinson" <nemoby@.nospam.nospam> wrote in message
news:%23FQJ$5hDGHA.3820@.TK2MSFTNGP10.phx.gbl...
>A TextBox in MultiLine mode is rendered as a TextArea HTML control.
>TextArea as opposed to an Imput control does not have a maxlength property.
>It will be ignored in the TextBox.
> There are some 3rd party controls and projects out there that attempt to
> control length with javascript for a multiline textbox. I haven't used any
> of them so can't comment.
> --
> Andrew Robinson
> www.binaryocean.com
> www.bellinghamdotnet.org
>
> "Dhana" <dhana@.celtycs-consulting.com> wrote in message
> news:O4c8lqgDGHA.1028@.TK2MSFTNGP11.phx.gbl...
>

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 value does not match value on postback

Hi All,

I have a text box that is currently being set by a javascript function
as a running total. the javascript is working fine, as values are
changing the running total is being set correctly in the text box.
When the page is posted to the button OnClick event, the value of the
text box is what was previously defaulted as part of the Page_Load
event.

Any ideas on what is happening here or how to fix this issue?

Thanks ALOT in advance.<allan.palmer@.cit.comwrote in message
news:9726ad9f-9d5a-4c98-8473-01645482697b@.e4g2000hsg.googlegroups.com...

Quote:

Originally Posted by

Any ideas on what is happening here or how to fix this issue?


Show your code...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
<allan.palmer@.cit.comwrote in message
news:9726ad9f-9d5a-4c98-8473-01645482697b@.e4g2000hsg.googlegroups.com...

Quote:

Originally Posted by

Hi All,
>
I have a text box that is currently being set by a javascript function
as a running total. the javascript is working fine, as values are
changing the running total is being set correctly in the text box.
When the page is posted to the button OnClick event, the value of the
text box is what was previously defaulted as part of the Page_Load
event.
>
Any ideas on what is happening here or how to fix this issue?
>
Thanks ALOT in advance.


Hi Allan,

The "problem" is that the POST value of the textbox is set *before*
Page_Load, then you are putting a default value in there during Page_Load
(overwriting the POST value), then your button click event is fired and you
see the Page_Load value instead of the POST value.

In your Page_Load, only set the default value of the textbox on the initial
page load:

if (!IsPostBack)
{
// Set default value.
}

text box value does not match value on postback

Hi All,
I have a text box that is currently being set by a javascript function
as a running total. the javascript is working fine, as values are
changing the running total is being set correctly in the text box.
When the page is posted to the button OnClick event, the value of the
text box is what was previously defaulted as part of the Page_Load
event.
Any ideas on what is happening here or how to fix this issue?
Thanks ALOT in advance.<allan.palmer@.cit.com> wrote in message
news:9726ad9f-9d5a-4c98-8473-01645482697b@.e4g2000hsg.googlegroups.com...

> Any ideas on what is happening here or how to fix this issue?
Show your code...
Mark Rae
ASP.NET MVP
http://www.markrae.net
<allan.palmer@.cit.com> wrote in message
news:9726ad9f-9d5a-4c98-8473-01645482697b@.e4g2000hsg.googlegroups.com...
> Hi All,
> I have a text box that is currently being set by a javascript function
> as a running total. the javascript is working fine, as values are
> changing the running total is being set correctly in the text box.
> When the page is posted to the button OnClick event, the value of the
> text box is what was previously defaulted as part of the Page_Load
> event.
> Any ideas on what is happening here or how to fix this issue?
> Thanks ALOT in advance.
Hi Allan,
The "problem" is that the POST value of the textbox is set *before*
Page_Load, then you are putting a default value in there during Page_Load
(overwriting the POST value), then your button click event is fired and you
see the Page_Load value instead of the POST value.
In your Page_Load, only set the default value of the textbox on the initial
page load:
if (!IsPostBack)
{
// Set default value.
}

Text Comparision in XSLT

hi guys,

I am working with XSLT these days. XSLT i am using is generating a HTML using a xml doc and list of arguments.

I also have a list of strings stored somewhere in cache. now I need to check if text coming from XML contains a word from string list...provide a link to that word.

Storing that string list can be changed to some text file or DB whatever is possible.

Now is it possible to do string comparision through XSLT??

Please reply asap...thanks.

-Geek

Hi

I think you can, using something like

<xsl: for-each select="t:fieldName">
<xsl: choose>

<xsl: when test="contains('value')">
' do what you want to do here
</xsl: when>

<xsl: when test="contains"('anothervalue')">
'do what you want to do here
</xsl: when>

</xsl: choose>
<xsl: for-each>

Hope that helps

Monday, March 26, 2012

text file format

I need to create a text file which I can get working but i need it to be in
this format which I'm close but not exactly there yet.
format I need:
1234569 BMW
1253252Mercedes
9876522 Lexus
9858252 Jaguar
I'm getting this format:
1234569 BMW
1253252 Mercedes
9876522 Lexus
9858252 Jaguar
here is my code I'm using to write the lines in the text file
string CarSales = string.Format("{0,-9}{1,-8}", VINNumber, CarMake);
file.WriteFile(CarSales);
am I missing something?I got it working I removed the (-) sign.
instead of this:
string CarSales = string.Format("{0,-9}{1,-8}", VINNumber, CarMake);
i did this:
string CarSales = string.Format("{0,9}{1,8}", VINNumber, CarMake);
and now the file lines up correctly
"igotyourdotnet" wrote:

> I need to create a text file which I can get working but i need it to be i
n
> this format which I'm close but not exactly there yet.
> format I need:
> 1234569 BMW
> 1253252Mercedes
> 9876522 Lexus
> 9858252 Jaguar
> I'm getting this format:
> 1234569 BMW
> 1253252 Mercedes
> 9876522 Lexus
> 9858252 Jaguar
> here is my code I'm using to write the lines in the text file
> string CarSales = string.Format("{0,-9}{1,-8}", VINNumber, CarMake);
> file.WriteFile(CarSales);
> am I missing something?
>
>

text file format

I need to create a text file which I can get working but i need it to be in
this format which I'm close but not exactly there yet.

format I need:
1234569 BMW
1253252Mercedes
9876522 Lexus
9858252 Jaguar

I'm getting this format:
1234569 BMW
1253252 Mercedes
9876522 Lexus
9858252 Jaguar

here is my code I'm using to write the lines in the text file
string CarSales = string.Format("{0,-9}{1,-8}", VINNumber, CarMake);
file.WriteFile(CarSales);

am I missing something?I got it working I removed the (-) sign.

instead of this:
string CarSales = string.Format("{0,-9}{1,-8}", VINNumber, CarMake);
i did this:
string CarSales = string.Format("{0,9}{1,8}", VINNumber, CarMake);
and now the file lines up correctly

"igotyourdotnet" wrote:

Quote:

Originally Posted by

I need to create a text file which I can get working but i need it to be in
this format which I'm close but not exactly there yet.
>
format I need:
1234569 BMW
1253252Mercedes
9876522 Lexus
9858252 Jaguar
>
I'm getting this format:
1234569 BMW
1253252 Mercedes
9876522 Lexus
9858252 Jaguar
>
here is my code I'm using to write the lines in the text file
string CarSales = string.Format("{0,-9}{1,-8}", VINNumber, CarMake);
file.WriteFile(CarSales);
>
am I missing something?
>
>
>
>

Text File Processing

I am currently working on a project in which the user will upload a flat file, text file, for processing and manipulation. I am unable to control the format of the test file because it comes from a packaged software. The file is a fixed delimited file that I must read certain value from and write out a new text file in a new format.
The problem that I am having is the starts with a 12 line header that I can through way because the first 12 line will always be the same. Where my problem is that at certain points during the file a sub set of the header file will occur. There does not seem to be any rhyme or reason as to where the entry occurs.
Does anyone have any idea how how to check for this line pattern and how I can ignore it?What I've done in cases like this is to import the file into anintermediary table, delete any rows which contain header information,and insert the remaining records into the final destination table.

Text in textbox enables button.

Hello beginner here.
I've been researching for awhile to find a way to enable a button when
text is entered into a textbox (client side). I working with asp.net
2.0 C#. I've been trying to figure this out through javascript or
someone told me to research Page.RegisterClientScriptBlock Method, but
I can't seem to figure this out. Any help will be appreciated.

ThanksHey.

in your html:
<script>
function blah(textbox,button)
{
button.disabled = textbox.value.length == 0;
}
</script>

in your C# (in page load handler or wherever):

...
this.txtBox.Attributes["onkeyup"] =
string.Format("blah(this,getElementByID('{0}'));",this.btnSubmitOrWhateverItsNameIs.ClientID);
...

Hope this helps.
Kikoz

<hledman@.gmail.comwrote in message
news:1154459595.292991.267130@.i42g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Hello beginner here.
I've been researching for awhile to find a way to enable a button when
text is entered into a textbox (client side). I working with asp.net
2.0 C#. I've been trying to figure this out through javascript or
someone told me to research Page.RegisterClientScriptBlock Method, but
I can't seem to figure this out. Any help will be appreciated.
>
Thanks
>

Saturday, March 24, 2012

Text Size

I found an issue while working on my asp.net pages in VB. When you open the browser everything looks fine. If a user clicks view and text size and changes the size to larger all my pages are distorted. The text boxes are merged and you cant read them. Does anyone have a solution for this?How are you creating your web page? The pages should look different, but shoudl still be readable. Can you send a short aspx page that demonstrates the behaviour?

Thanks,

Russell
Sounds like you are using GridLayout as you pageLayout (but I could be wrong). I would suggest putting your information (labels and textboxes) in a table. If this dosen't work let me know and I will take a closer look.

Trey
yes I am using a grid layout
I tried to see if there was a difference with a html label or a web form label but they look the same. It seems when the text size is increased by the user it drops the second word in the textbox on another line. How do you know when to use a html label or a web form label?
here a sample

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>trash</title>
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 103; LEFT: 200px; WIDTH: 128px; POSITION: absolute; TOP: 32px; HEIGHT: 30px" cellSpacing="1" cellPadding="1" width="128" border="1">
<TR>
<TD><asp:label id="Label1" runat="server" Width="95px" Height="22px">web form label</asp:label></TD>
</TR>
</TABLE>
<DIV style="DISPLAY: inline; Z-INDEX: 102; LEFT: 338px; WIDTH: 69px; POSITION: absolute; TOP: 34px; HEIGHT: 25px" ms_positioning="FlowLayout">html
label</DIV>
</form>
</body>
</HTML>
For you table width i would use percents instead of px. I feel it is the best way if you are worried about font size increases. I would also use flowlayout for what you are trying to do. here is an example:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>trash</title>
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="50%" align="center" border="1">
<TR>
<TD>
<asp:Label id="Label1" runat="server">Label</asp:Label></TD>
<TD>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></TD>
</TR>
</TABLE>
</form>
</body>
</HTML>

if you give me exactly what you are doing i can see if i can get it working for you.
It looks like that will do the trick thanks a lot.

Text to speech (TTS) application on web server

Hi.All
I'm working on a TTS application.
It runs on my local pc (WindowXP pro) without any error.
Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1,
Microsoft Speech Application SDK 1.1. are installed on my local pc.
My web server is Windows 2003 server Enterprise.
Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are
installed on the server.
The TTS application on the server gives following error message.
Please help!
Best regards
Server Error in '/speech' Application.
----
--
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: File or assembly name Microsoft.Speech.Web, or one of
its dependencies, was not found.
Source Error:
Line 1: <%@dotnet.itags.org. Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="ExploringTextToSpeech._Default" %>
Line 2: <%@dotnet.itags.org. Register TagPrefix="speech" Namespace="Microsoft.Speech.Web.UI"
Assembly="Microsoft.Speech.Web, Version=1.0.3200.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" %>
Line 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Line 4: <HTML>
Source File: C:\myWWW\Copy_of_ExploringTextToSpeech\D
efault.aspx Line: 2
Assembly Load Trace: The following information can be helpful to determine
why the assembly 'Microsoft.Speech.Web' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Speech.Web, Version=1.0.3200.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/myWWW/Copy_of_ExploringTextToSpeech
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file
(C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: Microsoft.Speech.Web, Version=1.0.3200.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL
.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Micr
osoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE
.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.EXE.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Micr
osoft.Speech.Web.EXE.
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300Speech on a web server? What are you trying to do? Have users talk to you
web page? That, if you could even get it to work, would run on the client
Jeff
"Onur" <onur@.ottoturkey.com.tr> wrote in message
news:eeBvtRVXGHA.4144@.TK2MSFTNGP04.phx.gbl...
> Hi.All
> I'm working on a TTS application.
> It runs on my local pc (WindowXP pro) without any error.
> Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1,
> Microsoft Speech Application SDK 1.1. are installed on my local pc.
> My web server is Windows 2003 server Enterprise.
> Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are
> installed on the server.
> The TTS application on the server gives following error message.
> Please help!
> Best regards
>
> Server Error in '/speech' Application.
> ----
--
> Parser Error
> Description: An error occurred during the parsing of a resource required
> to service this request. Please review the following specific parse error
> details and modify your source file appropriately.
> Parser Error Message: File or assembly name Microsoft.Speech.Web, or one
> of its dependencies, was not found.
> Source Error:
> Line 1: <%@. Page language="c#" Codebehind="Default.aspx.cs"
> AutoEventWireup="false" Inherits="ExploringTextToSpeech._Default" %>
> Line 2: <%@. Register TagPrefix="speech"
> Namespace="Microsoft.Speech.Web.UI" Assembly="Microsoft.Speech.Web,
> Version=1.0.3200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
> Line 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> Line 4: <HTML>
> Source File: C:\myWWW\Copy_of_ExploringTextToSpeech\D
efault.aspx Line:
> 2
> Assembly Load Trace: The following information can be helpful to determine
> why the assembly 'Microsoft.Speech.Web' could not be loaded.
> === Pre-bind state information ===
> LOG: DisplayName = Microsoft.Speech.Web, Version=1.0.3200.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35
> (Fully-specified)
> LOG: Appbase = file:///C:/myWWW/Copy_of_ExploringTextToSpeech
> LOG: Initial PrivatePath = bin
> Calling assembly : (Unknown).
> ===
> LOG: Publisher policy file is not found.
> LOG: No redirect found in host configuration file
> (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
> LOG: Using machine configuration file from
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
> LOG: Post-policy reference: Microsoft.Speech.Web, Version=1.0.3200.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.D
LL.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.DL
L.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Mi
crosoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.E
XE.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.EX
E.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Mi
crosoft.Speech.Web.EXE.
>
> Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
> ASP.NET Version:1.1.4322.2300
>

Text to speech (TTS) application on web server

Hi.All

I'm working on a TTS application.
It runs on my local pc (WindowXP pro) without any error.
Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1,
Microsoft Speech Application SDK 1.1. are installed on my local pc.

My web server is Windows 2003 server Enterprise.
Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are
installed on the server.

The TTS application on the server gives following error message.

Please help!

Best regards

Server Error in '/speech' Application.
------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: File or assembly name Microsoft.Speech.Web, or one of
its dependencies, was not found.

Source Error:

Line 1: <%@dotnet.itags.org. Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="ExploringTextToSpeech._Default" %>
Line 2: <%@dotnet.itags.org. Register TagPrefix="speech" Namespace="Microsoft.Speech.Web.UI"
Assembly="Microsoft.Speech.Web, Version=1.0.3200.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" %>
Line 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Line 4: <HTML
Source File: C:\myWWW\Copy_of_ExploringTextToSpeech\Default.asp x Line: 2

Assembly Load Trace: The following information can be helpful to determine
why the assembly 'Microsoft.Speech.Web' could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Speech.Web, Version=1.0.3200.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/myWWW/Copy_of_ExploringTextToSpeech
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file
(C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspn et.config).
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: Microsoft.Speech.Web, Version=1.0.3200.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.EXE.
LOG: Attempting download of new URL
file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE.

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300Speech on a web server? What are you trying to do? Have users talk to you
web page? That, if you could even get it to work, would run on the client

Jeff

"Onur" <onur@.ottoturkey.com.tr> wrote in message
news:eeBvtRVXGHA.4144@.TK2MSFTNGP04.phx.gbl...
> Hi.All
> I'm working on a TTS application.
> It runs on my local pc (WindowXP pro) without any error.
> Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1,
> Microsoft Speech Application SDK 1.1. are installed on my local pc.
> My web server is Windows 2003 server Enterprise.
> Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are
> installed on the server.
> The TTS application on the server gives following error message.
> Please help!
> Best regards
>
> Server Error in '/speech' Application.
> ------------------------
> Parser Error
> Description: An error occurred during the parsing of a resource required
> to service this request. Please review the following specific parse error
> details and modify your source file appropriately.
> Parser Error Message: File or assembly name Microsoft.Speech.Web, or one
> of its dependencies, was not found.
> Source Error:
> Line 1: <%@. Page language="c#" Codebehind="Default.aspx.cs"
> AutoEventWireup="false" Inherits="ExploringTextToSpeech._Default" %>
> Line 2: <%@. Register TagPrefix="speech"
> Namespace="Microsoft.Speech.Web.UI" Assembly="Microsoft.Speech.Web,
> Version=1.0.3200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
> Line 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> Line 4: <HTML>
> Source File: C:\myWWW\Copy_of_ExploringTextToSpeech\Default.asp x Line:
> 2
> Assembly Load Trace: The following information can be helpful to determine
> why the assembly 'Microsoft.Speech.Web' could not be loaded.
> === Pre-bind state information ===
> LOG: DisplayName = Microsoft.Speech.Web, Version=1.0.3200.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35
> (Fully-specified)
> LOG: Appbase = file:///C:/myWWW/Copy_of_ExploringTextToSpeech
> LOG: Initial PrivatePath = bin
> Calling assembly : (Unknown).
> ===
> LOG: Publisher policy file is not found.
> LOG: No redirect found in host configuration file
> (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspn et.config).
> LOG: Using machine configuration file from
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
> LOG: Post-policy reference: Microsoft.Speech.Web, Version=1.0.3200.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE.
>
> Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
> ASP.NET Version:1.1.4322.2300
Have you installed Microsoft Speech Application SDK 1.1 on the server?

If that doesn't work, try posting to microsoft.public.speech.server

Anthony

"Onur" wrote:

> Hi.All
> I'm working on a TTS application.
> It runs on my local pc (WindowXP pro) without any error.
> Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1,
> Microsoft Speech Application SDK 1.1. are installed on my local pc.
> My web server is Windows 2003 server Enterprise.
> Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are
> installed on the server.
> The TTS application on the server gives following error message.
> Please help!
> Best regards
>
> Server Error in '/speech' Application.
> ------------------------
> Parser Error
> Description: An error occurred during the parsing of a resource required to
> service this request. Please review the following specific parse error
> details and modify your source file appropriately.
> Parser Error Message: File or assembly name Microsoft.Speech.Web, or one of
> its dependencies, was not found.
> Source Error:
> Line 1: <%@. Page language="c#" Codebehind="Default.aspx.cs"
> AutoEventWireup="false" Inherits="ExploringTextToSpeech._Default" %>
> Line 2: <%@. Register TagPrefix="speech" Namespace="Microsoft.Speech.Web.UI"
> Assembly="Microsoft.Speech.Web, Version=1.0.3200.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35" %>
> Line 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> Line 4: <HTML>
> Source File: C:\myWWW\Copy_of_ExploringTextToSpeech\Default.asp x Line: 2
> Assembly Load Trace: The following information can be helpful to determine
> why the assembly 'Microsoft.Speech.Web' could not be loaded.
> === Pre-bind state information ===
> LOG: DisplayName = Microsoft.Speech.Web, Version=1.0.3200.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35
> (Fully-specified)
> LOG: Appbase = file:///C:/myWWW/Copy_of_ExploringTextToSpeech
> LOG: Initial PrivatePath = bin
> Calling assembly : (Unknown).
> ===
> LOG: Publisher policy file is not found.
> LOG: No redirect found in host configuration file
> (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspn et.config).
> LOG: Using machine configuration file from
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
> LOG: Post-policy reference: Microsoft.Speech.Web, Version=1.0.3200.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Microsoft.Speech.Web.DLL.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
> Files/speech/4e84447f/7b1e538e/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web.EXE.
> LOG: Attempting download of new URL
> file:///C:/myWWW/Copy_of_ExploringTextToSpeech/bin/Microsoft.Speech.Web/Microsoft.Speech.Web.EXE.
>
> Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
> Version:1.1.4322.2300
>

Text to Speech for Poet

I'm working with an artist-poet who is trying to writea style of poetry that is supposed to be voiced by machine rather thanhuman voice. Thus, I need a web-based text-to-speech functionality. Iunderstand there was one back in ASP 1.0, but it does not work in Visual Studio2005. Any way to do this now? I"m not trying to anything sophisticated,just voice lines of text. An advanced "Hello World" would do the job.

Anonyme

theanonymousway.com

Try the Interop.SpeechLib.dll

-

using SpeechLib;


That was it. Thanks!

Thursday, March 22, 2012

TextArea Length ??

Hi
I am using Textarea type.I want to set maximum length to the textarea.
I am using following code for the same,but it is not working,
<textarea name="txtDescription" cols=10 rows=3 axlength=50></textarea>
<asp:TextBox Font-Names="verdana" Runat="server" ID="tforumtext"
TextMode="MultiLine" Height="100" Width="300" Font-Size="10"
MaxLength="100">
</asp:TextBox>
But it is not working,it
Help me in the same
Samir (S.E INDIA).Maxlength property is not supported for textarea control. For workaround,
check out this faq
http://www.extremeexperts.com/Net/t...ineTextBox.aspx
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"Samir Patel" <sneelm@.yahoo.co.in> wrote in message
news:uParhhszEHA.2624@.TK2MSFTNGP11.phx.gbl...
> Hi
> I am using Textarea type.I want to set maximum length to the textarea.
> I am using following code for the same,but it is not working,
> <textarea name="txtDescription" cols=10 rows=3 axlength=50></textarea>
> <asp:TextBox Font-Names="verdana" Runat="server" ID="tforumtext"
> TextMode="MultiLine" Height="100" Width="300" Font-Size="10"
> MaxLength="100">
> </asp:TextBox>
> But it is not working,it
> Help me in the same
> Samir (S.E INDIA).
>

Tuesday, March 13, 2012

Textbox and OnTextChanged

Hi. I'm working on an intranet application that requires a user to input
information about themselves. I have a user control with a couple of
textboxes that I want the user to enter their weight into. One is for
Lbs and one is for kg and I'm using the OnTextChanged event to populate
the other control if one is filled in (converting between kg and Lbs).

It works, but when one TextBox is changed and it sets the other's value,
the second TextBox's OnTextChanged event fires too. I'd like to force
only the one one being typed into to fire because with rounding
involved, it may change the text just entered.

So basically, I want to ensure only one postback when the text is
changed in a TextBox and I'm currently getting two because both controls
fire their OnTextChanged events.

Thanks!

MattDo you have to round it? What type is it, an integer?
You don't have AutoPostBack set to True for these controls do you?

"MattB" <somedudeus@.yahoo.com> wrote in message
news:3ptqs9Fcb69lU1@.individual.net...
> Hi. I'm working on an intranet application that requires a user to input
> information about themselves. I have a user control with a couple of
> textboxes that I want the user to enter their weight into. One is for Lbs
> and one is for kg and I'm using the OnTextChanged event to populate the
> other control if one is filled in (converting between kg and Lbs).
> It works, but when one TextBox is changed and it sets the other's value,
> the second TextBox's OnTextChanged event fires too. I'd like to force only
> the one one being typed into to fire because with rounding involved, it
> may change the text just entered.
> So basically, I want to ensure only one postback when the text is changed
> in a TextBox and I'm currently getting two because both controls fire
> their OnTextChanged events.
> Thanks!
> Matt
I do. I thought it was necessary, or does that event work without it...

OK, I just tried it and without AutoPostBack=True, the event doesn't
fire at all. Seems like I need it.

Thanks,
Matt

Scott M. wrote:
> You don't have AutoPostBack set to True for these controls do you?
>
> "MattB" <somedudeus@.yahoo.com> wrote in message
> news:3ptqs9Fcb69lU1@.individual.net...
>>Hi. I'm working on an intranet application that requires a user to input
>>information about themselves. I have a user control with a couple of
>>textboxes that I want the user to enter their weight into. One is for Lbs
>>and one is for kg and I'm using the OnTextChanged event to populate the
>>other control if one is filled in (converting between kg and Lbs).
>>
>>It works, but when one TextBox is changed and it sets the other's value,
>>the second TextBox's OnTextChanged event fires too. I'd like to force only
>>the one one being typed into to fire because with rounding involved, it
>>may change the text just entered.
>>
>>So basically, I want to ensure only one postback when the text is changed
>>in a TextBox and I'm currently getting two because both controls fire
>>their OnTextChanged events.
>>
>>Thanks!
>>
>>Matt
>
The TextChanged event is registered as having happened at the client level,
but the actual event handler code does not fire until the form is posted
back to the server (remember, event handlers are server-side code and
changing the text happens at the client-level).

So, if you have AutoPostBack turned off for both of the textboxes (which is
the default setting), a user can change the text in one or both of the
textboxes and nothing will happen until the form is submitted to the
server... then the TextChanged event handler for one or both of the
textboxes will fire, but there will just be one postback.

The point of AutoPostBack is that *if* the control is manipulated in any way
(like changing the text in a textbox), then that action will cause a
postback. So, if you have this turned on for both textboxes, changing
either of them will cause a postback, changing both of them will cause 2
postbacks.

So, the answer is to have AutoPostBack turned off for both of them and when
the user is ready for the conversion to happen, they can just hit a Submit
button that will cause one postback to the server and whichever textbox has
been changed will then run its TextChanged event hander.

"MattB" <somedudeus@.yahoo.com> wrote in message
news:3ptu6nFc8g6eU1@.individual.net...
>I do. I thought it was necessary, or does that event work without it...
> OK, I just tried it and without AutoPostBack=True, the event doesn't fire
> at all. Seems like I need it.
> Thanks,
> Matt
> Scott M. wrote:
>> You don't have AutoPostBack set to True for these controls do you?
>>
>>
>> "MattB" <somedudeus@.yahoo.com> wrote in message
>> news:3ptqs9Fcb69lU1@.individual.net...
>>
>>>Hi. I'm working on an intranet application that requires a user to input
>>>information about themselves. I have a user control with a couple of
>>>textboxes that I want the user to enter their weight into. One is for Lbs
>>>and one is for kg and I'm using the OnTextChanged event to populate the
>>>other control if one is filled in (converting between kg and Lbs).
>>>
>>>It works, but when one TextBox is changed and it sets the other's value,
>>>the second TextBox's OnTextChanged event fires too. I'd like to force
>>>only the one one being typed into to fire because with rounding involved,
>>>it may change the text just entered.
>>>
>>>So basically, I want to ensure only one postback when the text is changed
>>>in a TextBox and I'm currently getting two because both controls fire
>>>their OnTextChanged events.
>>>
>>>Thanks!
>>>
>>>Matt
>>
>

Textbox and OnTextChanged

Hi. I'm working on an intranet application that requires a user to input
information about themselves. I have a user control with a couple of
textboxes that I want the user to enter their weight into. One is for
Lbs and one is for kg and I'm using the OnTextChanged event to populate
the other control if one is filled in (converting between kg and Lbs).
It works, but when one TextBox is changed and it sets the other's value,
the second TextBox's OnTextChanged event fires too. I'd like to force
only the one one being typed into to fire because with rounding
involved, it may change the text just entered.
So basically, I want to ensure only one postback when the text is
changed in a TextBox and I'm currently getting two because both controls
fire their OnTextChanged events.
Thanks!
MattDo you have to round it? What type is it, an integer?
You don't have AutoPostBack set to True for these controls do you?
"MattB" <somedudeus@.yahoo.com> wrote in message
news:3ptqs9Fcb69lU1@.individual.net...
> Hi. I'm working on an intranet application that requires a user to input
> information about themselves. I have a user control with a couple of
> textboxes that I want the user to enter their weight into. One is for Lbs
> and one is for kg and I'm using the OnTextChanged event to populate the
> other control if one is filled in (converting between kg and Lbs).
> It works, but when one TextBox is changed and it sets the other's value,
> the second TextBox's OnTextChanged event fires too. I'd like to force only
> the one one being typed into to fire because with rounding involved, it
> may change the text just entered.
> So basically, I want to ensure only one postback when the text is changed
> in a TextBox and I'm currently getting two because both controls fire
> their OnTextChanged events.
> Thanks!
> Matt
I do. I thought it was necessary, or does that event work without it...
OK, I just tried it and without AutoPostBack=True, the event doesn't
fire at all. Seems like I need it.
Thanks,
Matt
Scott M. wrote:
> You don't have AutoPostBack set to True for these controls do you?
>
> "MattB" <somedudeus@.yahoo.com> wrote in message
> news:3ptqs9Fcb69lU1@.individual.net...
>
>
>
The TextChanged event is registered as having happened at the client level,
but the actual event handler code does not fire until the form is posted
back to the server (remember, event handlers are server-side code and
changing the text happens at the client-level).
So, if you have AutoPostBack turned off for both of the textboxes (which is
the default setting), a user can change the text in one or both of the
textboxes and nothing will happen until the form is submitted to the
server... then the TextChanged event handler for one or both of the
textboxes will fire, but there will just be one postback.
The point of AutoPostBack is that *if* the control is manipulated in any way
(like changing the text in a textbox), then that action will cause a
postback. So, if you have this turned on for both textboxes, changing
either of them will cause a postback, changing both of them will cause 2
postbacks.
So, the answer is to have AutoPostBack turned off for both of them and when
the user is ready for the conversion to happen, they can just hit a Submit
button that will cause one postback to the server and whichever textbox has
been changed will then run its TextChanged event hander.
"MattB" <somedudeus@.yahoo.com> wrote in message
news:3ptu6nFc8g6eU1@.individual.net...
>I do. I thought it was necessary, or does that event work without it...
> OK, I just tried it and without AutoPostBack=True, the event doesn't fire
> at all. Seems like I need it.
> Thanks,
> Matt
> Scott M. wrote:

TextBox and Property

Hello,

I am working on Library which will include various controls.

One of these controls has a TextBox.

I am using a property named Value to define the TextBox text:

' Value
Private _Value As String
Public Property Value() As String
Get
Return _Value
End Get
Set(ByVal value As String)
_Value = value
End Set
End Property ' Value

And the TextBox Init event is the following:

Private Sub tbText_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbText.Init
tbText.ID = "tbText"
tbText.Text = _Value
End Sub

I added this control to a page and defined its value to "Hello".

I also added a button to the page that when clicked basically does
Response.Write(MyControl.Value)

What happens is that when I change the TextBox text to "Goodbye" and
click the button the text that Response.Write outputs is "Hello".

Why isn't the property returning the new value?

What is the right way to do this?

Thanks,

MiguelHowdy,

This is because you change the text of the text box in the Init event.
Button raises its Click event between Load and PreRender page's events
meaning after you take the value of the Value property. In addition, if the
value is set through the code or data binding its value will be lost because
it's not stored in the viewstate. You need to simplify your code to:

Public Property Value() As String
Get
Return tbText.Text
End Get
Set(ByVal value As String)
tbText.Text = value
End Set
End Property ' Value

Done

hope it helps
--
Milosz

"shapper" wrote:

Quote:

Originally Posted by

Hello,
>
I am working on Library which will include various controls.
>
One of these controls has a TextBox.
>
I am using a property named Value to define the TextBox text:
>
' Value
Private _Value As String
Public Property Value() As String
Get
Return _Value
End Get
Set(ByVal value As String)
_Value = value
End Set
End Property ' Value
>
And the TextBox Init event is the following:
>
Private Sub tbText_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbText.Init
tbText.ID = "tbText"
tbText.Text = _Value
End Sub
>
I added this control to a page and defined its value to "Hello".
>
I also added a button to the page that when clicked basically does
Response.Write(MyControl.Value)
>
What happens is that when I change the TextBox text to "Goodbye" and
click the button the text that Response.Write outputs is "Hello".
>
Why isn't the property returning the new value?
>
What is the right way to do this?
>
Thanks,
>
Miguel
>

TextBox and Property

Hello,
I am working on Library which will include various controls.
One of these controls has a TextBox.
I am using a property named Value to define the TextBox text:
' Value
Private _Value As String
Public Property Value() As String
Get
Return _Value
End Get
Set(ByVal value As String)
_Value = value
End Set
End Property ' Value
And the TextBox Init event is the following:
Private Sub tbText_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbText.Init
tbText.ID = "tbText"
tbText.Text = _Value
End Sub
I added this control to a page and defined its value to "Hello".
I also added a button to the page that when clicked basically does
Response.Write(MyControl.Value)
What happens is that when I change the TextBox text to "Goodbye" and
click the button the text that Response.Write outputs is "Hello".
Why isn't the property returning the new value?
What is the right way to do this?
Thanks,
MiguelHowdy,
This is because you change the text of the text box in the Init event.
Button raises its Click event between Load and PreRender page's events
meaning after you take the value of the Value property. In addition, if the
value is set through the code or data binding its value will be lost because
it's not stored in the viewstate. You need to simplify your code to:
Public Property Value() As String
Get
Return tbText.Text
End Get
Set(ByVal value As String)
tbText.Text = value
End Set
End Property ' Value
Done
hope it helps
--
Milosz
"shapper" wrote:

> Hello,
> I am working on Library which will include various controls.
> One of these controls has a TextBox.
> I am using a property named Value to define the TextBox text:
> ' Value
> Private _Value As String
> Public Property Value() As String
> Get
> Return _Value
> End Get
> Set(ByVal value As String)
> _Value = value
> End Set
> End Property ' Value
> And the TextBox Init event is the following:
> Private Sub tbText_Init(ByVal sender As Object, ByVal e As
> EventArgs) Handles tbText.Init
> tbText.ID = "tbText"
> tbText.Text = _Value
> End Sub
> I added this control to a page and defined its value to "Hello".
> I also added a button to the page that when clicked basically does
> Response.Write(MyControl.Value)
> What happens is that when I change the TextBox text to "Goodbye" and
> click the button the text that Response.Write outputs is "Hello".
> Why isn't the property returning the new value?
> What is the right way to do this?
> Thanks,
> Miguel
>

TextBox and Property

Hello,

I am working on Library which will include various controls.

One of these controls has a TextBox.

I am using a property named Value to define the TextBox text:

' ValuePrivate _ValueAs String Public Property Value()As String Get Return _ValueEnd Get Set(ByVal valueAs String) _Value = valueEnd Set End Property' Value

And the TextBox Init event is the following:

Private Sub tbText_Init(ByVal senderAs Object,ByVal eAs EventArgs)Handles tbText.Init tbText.ID ="tbText" tbText.Text = _ValueEnd Sub

I added this control to a page and defined its value to "Hello".

I also added a button to the page that when clicked basically does Response.Write(MyControl.Value)

What happens is that when I change the TextBox text to "Goodbye" and click the button the text that Response.Write outputs is "Hello".

Why isn't the property returning the new value?

What is the right way to do this?

Thanks,

Miguel

You have to use ViewState. means you have to save your property value in the ViewState, so that when page postbacks all the values are retrived from viewstate.

Public Property Value()As String
Get
Return ViewState["Value"]
End Get
Set(ByVal valueAs String)
ViewState["Value"] = value
End Set
End Property' Value

I hope this will resolve your problem.
Let me know in case of any further queries


So I will not need the variable _Value in this case?

And is this the only way to do this?

Thanks,

Miguel


Hello,

I also tried the following:

Private _ValueAs String Public Property Value()As String Get Return tbText.TextEnd Get Set(ByVal valueAs String) _Value = valueEnd Set End Property' Value

This works. How?

Should I use this way or the ViewState?

Thanks,

Miguel


No, you can directly save your values in ViewState.
I don't think there may be any other way, because whenever your form is posted on server all the values are stored in ViewState.

I hope it would help!


shapper:

Hello,

I also tried the following:

Private _ValueAs String Public Property Value()As String Get Return tbText.TextEnd Get Set(ByVal valueAs String) _Value = valueEnd Set End Property' Value

This works. How?

Should I use this way or the ViewState?

Thanks,

Miguel

Yes because Textbox.Text is stored in ViewState


Just one more question. When using the code you suggested:

Private _ValueAs String Public Property Value()As String Get Return ViewState("Value")End Get Set(ByVal valueAs String) ViewState("Value") = valueEnd Set End Property' Value

How should I know define the initial value of my textbox?

In this moment I have:

MyTextBox.Text = _Value

Of course I could use

MyTextBox.Text =Me.Value
However, sometime ago, also in Microsoft forum there was a thread that I started weather in the code should I use ... = Me.PropertyName or ... = _PropertyName
It seems most people use the variable _PropertyName.
How should I do it?
I suppose using  
MyTextBox.Text = ViewState("Value")
isn't a very nice way to do it.
Anyway, just looking for a standard way (or the closest to it) to do this.
Thanks,
Miguel 


Hi ,

THis problem is due to IsPostBack property. when you intially assigned the value Hello value check the property

If Not Page.IsPostBack Then

assign your assign intial value to control...

TextBox1.Text = "sample value"

End If


Public Property Value() As String
Get
Dim viewState As Object = ViewState("Value")

If viewState Is Nothing Then
' Return your default value here instead of an empty string
Return String.Empty
Else
Return CStr(viewState)
End If
End Get
Set(ByVal value As String)
ViewState["Value"] = value
End Set
End Property

NC...