Showing posts with label dropdown. Show all posts
Showing posts with label dropdown. Show all posts

Saturday, March 31, 2012

Text Box and URL

it's not an asp issue, that's html
<body link=blue vlink=blue
and as for yout textbox/dropdown list question...It's unclear to me what you
are asking?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"Hong" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:DC295FB3-91C8-44E3-B002-8CFA3C31AF6C@dotnet.itags.org.microsoft.com...
> Once I click on the url, it will change to purple color permanetly even i
stop the program and run it again. How to change the url color back to blue
color ?
> For text box, how to remove the dropdown list ??You can turn off autocomplete for the form or for individual text boxes.
See this article:

http://msdn.microsoft.com/workshop/...omplete_ovr.asp

-Jason

Curt_C [MVP] wrote:

> it's not an asp issue, that's html
> <body link=blue vlink=blue>
> and as for yout textbox/dropdown list question...It's unclear to me what you
> are asking?

Thursday, March 22, 2012

Text value of Dropdown.

How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).
Thanks,
TomHi tshad,
Try this:
yourDropDownList.SelectecItem.Text
Guillermo G.
----
--
Guillermo Gonzlez Arroyave :: MCP ASP.Net C# :: DCE4
"tshad" <tscheiderich@.ftsolutions.com> wrote in message news:OlXi9QVkFHA.146
4@.TK2MSFTNGP14.phx.gbl...
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).
Thanks,
Tom
d1.SelectedItem.Text;
"tshad" wrote:

> How do you get the selected text of a dropdown box? Selectedvalue will g
et
> you the value and selectedindex will get you the position, but how do you
> get the text (it isn't selectedText).
> Thanks,
> Tom
>
>
Is DropDownList.SelectedItem.Value what you're looking for?
-Brock
DevelopMentor
http://staff.develop.com/ballen

> How do you get the selected text of a dropdown box? Selectedvalue
> will get you the value and selectedindex will get you the position,
> but how do you get the text (it isn't selectedText).
> Thanks,
> Tom
>
> Is DropDownList.SelectedItem.Value what you're looking for?
Oh! Indeed, DropDownList.SelectedItem.Text is what you're after. :S
-Brock
DevelopMentor
http://staff.develop.com/ballen
"HARI PRASD BARU" <HARIPRASDBARU@.discussions.microsoft.com> wrote in message
news:CB37336A-6424-4CF5-A175-C5F90A100150@.microsoft.com...
> d1.SelectedItem.Text;
That was it.
I can never seem to remember that when I need it.
I never understood why you have a SelectedValue, but not a SelectedText.
Thanks,
Tom
> "tshad" wrote:
>

Text value of Dropdown.

How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

TomHi tshad,

Try this:

yourDropDownList.SelectecItem.Text

Guillermo G.

------------------------
Guillermo Gonzlez Arroyave :: MCP ASP.Net C# :: DCE4

"tshad" <tscheiderich@.ftsolutions.com> wrote in message news:OlXi9QVkFHA.1464@.TK2MSFTNGP14.phx.gbl...
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
d1.SelectedItem.Text;

"tshad" wrote:

> How do you get the selected text of a dropdown box? Selectedvalue will get
> you the value and selectedindex will get you the position, but how do you
> get the text (it isn't selectedText).
> Thanks,
> Tom
>
Is DropDownList.SelectedItem.Value what you're looking for?

-Brock
DevelopMentor
http://staff.develop.com/ballen

> How do you get the selected text of a dropdown box? Selectedvalue
> will get you the value and selectedindex will get you the position,
> but how do you get the text (it isn't selectedText).
> Thanks,
> Tom
> Is DropDownList.SelectedItem.Value what you're looking for?

Oh! Indeed, DropDownList.SelectedItem.Text is what you're after. :S

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi tshad,

Try this:

yourDropDownList.SelectecItem.Text

Guillermo G.

------------------------
Guillermo Gonzlez Arroyave :: MCP ASP.Net C# :: DCE4

"tshad" <tscheiderich@.ftsolutions.com> wrote in message news:OlXi9QVkFHA.1464@.TK2MSFTNGP14.phx.gbl...
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
d1.SelectedItem.Text;

"tshad" wrote:

> How do you get the selected text of a dropdown box? Selectedvalue will get
> you the value and selectedindex will get you the position, but how do you
> get the text (it isn't selectedText).
> Thanks,
> Tom
>
Is DropDownList.SelectedItem.Value what you're looking for?

-Brock
DevelopMentor
http://staff.develop.com/ballen

> How do you get the selected text of a dropdown box? Selectedvalue
> will get you the value and selectedindex will get you the position,
> but how do you get the text (it isn't selectedText).
> Thanks,
> Tom
> Is DropDownList.SelectedItem.Value what you're looking for?

Oh! Indeed, DropDownList.SelectedItem.Text is what you're after. :S

-Brock
DevelopMentor
http://staff.develop.com/ballen
"HARI PRASD BARU" <HARIPRASDBARU@.discussions.microsoft.com> wrote in message
news:CB37336A-6424-4CF5-A175-C5F90A100150@.microsoft.com...
> d1.SelectedItem.Text;

That was it.

I can never seem to remember that when I need it.

I never understood why you have a SelectedValue, but not a SelectedText.

Thanks,

Tom
> "tshad" wrote:
>> How do you get the selected text of a dropdown box? Selectedvalue will
>> get
>> you the value and selectedindex will get you the position, but how do you
>> get the text (it isn't selectedText).
>>
>> Thanks,
>>
>> Tom
>>
>>
>

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 .