Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Saturday, March 31, 2012

text box misbehaviour

Hi

I have a text box which provides a parameter for a query which does a search against a database. the text will be populated on load. But if I edit the text box like say add a few letters then the search is not working. So I did the search by doing the test query feature of the wizard giving the exact parameter value ,it gave me the results. So I went back again and deleted everything upto the first first letter and manually re-entered the parameter in the textbox and searched this time I got the results. Seems like there is some hidden values in the TextBox which I have to delete manually . Has anyone come across a situation like this . Please advice how to solve this behaviour.

Thanks

How are you pre populating the textbox?

<asp:TextBox id="foo" runat="server">bla bla bla </asp:TextBox>

or

<asp:TextBox id="foo" runat="server" Text="bla bla bla" />

Note how the first way leads to a phantom space in your textbox...


I am populating it from a dataRow cell.

building1TextBox.Text = BuildingAddressTable[0].BuildingAddress;

What do you think

Thanks


hmm.

What does the Text property look like if you view it in the debugger when it is assigned to your parameter collection? Do you seen any phantom characters?


maybe something like this

building1TextBox.Text = Trim(BuildingAddressTable[0].BuildingAddress);

or

building1TextBox.Text = BuildingAddressTable[0].BuildingAddress.ToString().Trim();

not sure about the syntax - could be just .Trim()

This will trim whitespace from the beginning and end of the specified string.

Saturday, March 24, 2012

text selection problem

hi

I have a page full of panels!!! and I have a problem to select text in my pages. when I try to select a part of text, the whole text will select. what should I do with this problem. I have found some other websites that have exactly this problem, for examplehttp://www.elkjop.no/

Select as in select the text with the mouse on the page that is displayed in the browser? If not, can you please give a bit more detail?
yes. when a user want to select the text with his mouse, then the whole page text will select. no matter he drag the mouse on one word or one sentence or...

It has nothing to do with your code. The problem is either with how the browser you're using handles text selection or how you actually try to select the text.

By the way, I have no trouble selecting only the text I want from the website you mentioned.


Hiashk1860,

When I select text on the website you gave, there is no problem as you said.

It may be your browser's problem or other things.

HTH


yes

I used IE 6 and have selection problem but not with firefox and opera. but why??


But I check it out using IE7 and there is no problem. So it's not web site problem, it's your browser's problem.

Text Structure

Hi

I am in the middle of writing a form which takes a description of a product and saves it to a memo field in Access. However if this description has two or more paragraphs before it is saved to the databse, when it comes out again, it has lost the paragraphs and is just one lump of text.

Does anyone know how you go about retaining the structure of the text? Does the code have to check for paragrapgh and instert the <p> tags?

Thank you in davance for any tip you may have.You can do two things, put the paragraph in an asp:textbox / textarea, or surround the paragraph with <pre></pre>, which tells the browser not to mess with the formatting.
Thanks Michael your help is much appreciated.

Simple when you know how!
Hi,

You may use strMemo.Replace( Environment.NewLine, "<br>" )

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 - enter value and display record in FormView

Hi:

I would like to have user enter a value in the text box and have a record shown in the FormView. I know how to do it with the dropdown list showing the values but the list would be too long to display. I onder to find a record I would need to have user type it in. The field to seach on is a unique (key) field.

CAn you suggest a method?

Thanks.

It is exactly the same, except that you will need a submit button

<asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />

and on postback

Sub submit(sender As Object, e As EventArgs)
re-bind using this query "SELECT * FROM SomeTable Where ID = " & txt1.Text
End Sub

Is this what u mean?


I think he just want to know the TextChange event on TextBox.you can use this to show you record in FormView.but this textchange event i think prefer for Asp.net Ajax enabled website.i also think there is one event name like textbox lose focus,you can found this.

Wink


you mean onBlur (maybe OnServerChange?)

Anyway... I'm pissed of cause I had 199 points and now I have only 195 miserable points... somethign stinks in here!!!

kidding,
Mauro


Hi:

Thanks for your advise. I tried few things as follows:

1) I created a textbox txt1 and a button

2) I placed controls in the Ajax update panel

3) I added formview based on the query and added a parameter as follow: (permit# is my search field and my key)

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"

SelectCommand="SELECT [PermitNo], [TaskId], [ProjectManagerId], [OnSiteFirstName] FROM [Permits] where PermitNo = @.PermitNo">

<SelectParameters>

<asp:ControlParameterControlID="txt1"Name="PermitNo"PropertyName="Text"/>

</SelectParameters>

</asp:SqlDataSource>

So, when I type Permit number in my box it runs a query and show my record in formview.

This works perfectly. But I need to write something so it will test for "not found" so I could display message "Record not found". Do you have any ideas how I can do it? I use C# but possibly I can do it with ASP??

I would appreciate your assistance.


Hi:

Thanks for your advise. I tried few things as follows:

1) I created a textbox txt1 and a button

2) I placed controls in the Ajax update panel

3) I added formview based on the query and added a parameter as follow: (permit# is my search field and my key)

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"

SelectCommand="SELECT [PermitNo], [TaskId], [ProjectManagerId], [OnSiteFirstName] FROM [Permits] where PermitNo = @.PermitNo">

<SelectParameters>

<asp:ControlParameterControlID="txt1"Name="PermitNo"PropertyName="Text"/>

</SelectParameters>

</asp:SqlDataSource>

So, when I type Permit number in my box it runs a query and show my record in formview.

This works perfectly. But I need to write something so it will test for "not found" so I could display message "Record not found". Do you have any ideas how I can do it? I use C# but possibly I can do it with ASP??

I would appreciate your assistance.


FormView lets u define a template for "no data"

<emptydatatemplate>
No records available.
</emptydatatemplate>


More info at:http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.emptydatatemplate(VS.80).aspx

Regards,
Mauro


Yes, thank so much for your help. I got this working!!!!


It is Friday afternoon - I will check it on Monday - but I am sure it will work! Thanks for all your assistance .

TextBox and Buttons

Hi!

I have a page with a textbox with a OnTextChange property, and two buttons (save and cancel).

In the OnTextChange method I would like to know which button was clicked (save or cancel), and suggestions how to check for that?

- LasseTake a look at a similarpost made couple of days ago
the method-OnTextChange for adding text into the textbox,how can i get the handle of the button,i cant understand your words(ps:sorry for saying this).
may be it can solve by the js

TextBox and XML

Hi;

I try to fetch data and show in the textbox as follows;
..
..
..
..
<asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1"
</asp:XmlDataSource
..
..
..
..
<asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
Width="100%" /
How can I put the result into textbox ?

Thnx.

--
Devinim LEN

TO - Technology Services

Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..

Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
GSM : +90 (532) 555 5500
Tel : +90 (212) 473 2020
Fax : +90 (533) 981 4653> I try to fetch data and show in the textbox as follows;

I'm afraid I DON'T follow. What "follows" is an ASPX Control tag, followed
by some ellipses indicating that something was omitted, followed again by
another Control tag.

Therefore, what the "Result" is, is unknown to me, and I can't answer the
question.

Good rule of thumb: To get a good answer, ask a good question.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Devinim LEN" <devinim.solen@.global-bilgi.com.tr> wrote in message
news:eCD0PS2mEHA.3812@.TK2MSFTNGP10.phx.gbl...
> Hi;
> I try to fetch data and show in the textbox as follows;
> .
> .
> .
> .
> <asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
> DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1">
> </asp:XmlDataSource>
> .
> .
> .
> .
> <asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
> Width="100%" />
> How can I put the result into textbox ?
>
> Thnx.
> --
> Devinim LEN
>
> TO - Technology Services
> Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..
> Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
> GSM : +90 (532) 555 5500
> Tel : +90 (212) 473 2020
> Fax : +90 (533) 981 4653
Hi Again;

What I need to learn, it is simple to understand. By following code, I want
to get data from XML into textbox via XmlDataSource.

<asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1">
</asp:XmlDataSource
..
..
..
<asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
Width="100%" /
XML source is;

<?xml version="1.0" encoding="UTF-8" ?>
- <root xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<Ch_Hm_Vw_MenuItem Id="1" Alias="Administration" />
<Ch_Hm_Vw_MenuItem Id="2" Alias="Users & Groups" />
<Ch_Hm_Vw_MenuItem Id="3" Alias="Users" />
<Ch_Hm_Vw_MenuItem Id="4" Alias="Groups" />
<Ch_Hm_Vw_MenuItem Id="5" Alias="Settings" />
<Ch_Hm_Vw_MenuItem Id="6" Alias="Menu" />
<Ch_Hm_Vw_MenuItem Id="7" Alias="Menu Item List" />
</root
--
Devinim LEN

TO - Technology Services

Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..

Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
GSM : +90 (532) 555 5500
Tel : +90 (212) 473 2020
Fax : +90 (533) 981 4653
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:udKDIP$mEHA.1152@.TK2MSFTNGP11.phx.gbl...
> > I try to fetch data and show in the textbox as follows;
> I'm afraid I DON'T follow. What "follows" is an ASPX Control tag, followed
> by some ellipses indicating that something was omitted, followed again by
> another Control tag.
> Therefore, what the "Result" is, is unknown to me, and I can't answer the
> question.
> Good rule of thumb: To get a good answer, ask a good question.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
> "Devinim LEN" <devinim.solen@.global-bilgi.com.tr> wrote in message
> news:eCD0PS2mEHA.3812@.TK2MSFTNGP10.phx.gbl...
> > Hi;
> > I try to fetch data and show in the textbox as follows;
> > .
> > .
> > .
> > .
> > <asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
> > DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1">
> > </asp:XmlDataSource>
> > .
> > .
> > .
> > .
> > <asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
> > Width="100%" />
> > How can I put the result into textbox ?
> > Thnx.
> > --
> > Devinim LEN
> > TO - Technology Services
> > Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..
> > Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
> > GSM : +90 (532) 555 5500
> > Tel : +90 (212) 473 2020
> > Fax : +90 (533) 981 4653

TextBox and XML

Hi;
I try to fetch data and show in the textbox as follows;
.
.
.
.
<asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1">
</asp:XmlDataSource>
.
.
.
.
<asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
Width="100%" />
How can I put the result into textbox ?
Thnx.
Devinim LEN
TO - Technology Services
Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..
Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
GSM : +90 (532) 555 5500
Tel : +90 (212) 473 2020
Fax : +90 (533) 981 4653> I try to fetch data and show in the textbox as follows;
I'm afraid I DON'T follow. What "follows" is an ASPX Control tag, followed
by some ellipses indicating that something was omitted, followed again by
another Control tag.
Therefore, what the "Result" is, is unknown to me, and I can't answer the
question.
Good rule of thumb: To get a good answer, ask a good question.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Devinim LEN" <devinim.solen@.global-bilgi.com.tr> wrote in message
news:eCD0PS2mEHA.3812@.TK2MSFTNGP10.phx.gbl...
> Hi;
> I try to fetch data and show in the textbox as follows;
> .
> .
> .
> .
> <asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
> DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1">
> </asp:XmlDataSource>
> .
> .
> .
> .
> <asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
> Width="100%" />
> How can I put the result into textbox ?
>
> Thnx.
> --
> Devinim LEN
>
> TO - Technology Services
> Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..
> Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
> GSM : +90 (532) 555 5500
> Tel : +90 (212) 473 2020
> Fax : +90 (533) 981 4653
>
Hi Again;
What I need to learn, it is simple to understand. By following code, I want
to get data from XML into textbox via XmlDataSource.
<asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"
DataFile="http://localhost/ChHumanica/template/ChMenuItem.xml?Id=1">
</asp:XmlDataSource>
.
.
.
<asp:TextBox ID="m_ChAliasTextBox" CssClass="ChTextBox" Runat="server"
Width="100%" />
XML source is;
<?xml version="1.0" encoding="UTF-8" ?>
- <root xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<Ch_Hm_Vw_MenuItem Id="1" Alias="Administration" />
<Ch_Hm_Vw_MenuItem Id="2" Alias="Users & Groups" />
<Ch_Hm_Vw_MenuItem Id="3" Alias="Users" />
<Ch_Hm_Vw_MenuItem Id="4" Alias="Groups" />
<Ch_Hm_Vw_MenuItem Id="5" Alias="Settings" />
<Ch_Hm_Vw_MenuItem Id="6" Alias="Menu" />
<Ch_Hm_Vw_MenuItem Id="7" Alias="Menu Item List" />
</root>
Devinim LEN
TO - Technology Services
Global Bilgi Paz., Dan. ve ar Servisi Hiz. A..
Fatih C. Dereboyu S. No:8 34660 Halkal-stanbul/Trkiye
GSM : +90 (532) 555 5500
Tel : +90 (212) 473 2020
Fax : +90 (533) 981 4653
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:udKDIP$mEHA.1152@.TK2MSFTNGP11.phx.gbl...
> I'm afraid I DON'T follow. What "follows" is an ASPX Control tag, followed
> by some ellipses indicating that something was omitted, followed again by
> another Control tag.
> Therefore, what the "Result" is, is unknown to me, and I can't answer the
> question.
> Good rule of thumb: To get a good answer, ask a good question.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
> "Devinim LEN" <devinim.solen@.global-bilgi.com.tr> wrote in message
> news:eCD0PS2mEHA.3812@.TK2MSFTNGP10.phx.gbl...
>