Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Thursday, March 29, 2012

Newbie -- pls help

Hi all,

Reali need some help here.

I'm using <repeaterto display few thing taken from the dB.
1. hidden field, which contains the Language code (stored in dB)
2. Textbox

Code goes:

<asp:repeater id="myRepeater" runat="server">
<itemtemplate>
<asp:panel id="pnlCountry" runat="server">
<asp:table>
<tr>
<td>
<asp:label id="lblCounty" runat="server" text="T&Cs: "></asp:label><br>
<%# Container.DataItem("LanguageCode") %>
</td>
<td>
<asp:textbox id="txtTnC" runat="server" textmode="multiline" rows="10"
columns="45"></asp:textbox>
</td>
</tr>
<tr><td>
<INPUT id="hdnLanguage" type="hidden" runat="server" NAME="hdnAltLanguage"
value=<%# Container.DataItem("LanguageCode") %>>
</td>
</tr>
</asp:table>
</asp:panel>
</itemtemplate>
</asp:repeater>

OnClick of a button, i want to get the values entered in the textfields for
the different languages.

How do i do that? What events to use??

Pls help me!!!

Thanx lotz..

RegarDx..Well if you want to do something when someone click a button then put it in
the OnClick event handler. If you want to access the values in the labels
and textboxes in the repaeater control then you would use the command

myRepeater.FindControl("ControlID")

This will return a reference to the relevent control, although all controls
within the parent container (i.e. myRepeater) must have unique IDs.

your code for the asp:table markup is wrong. You have created an asp:table
but left out an ID and a runat=server which are required. You have also used
HTML row and column markup, to create rows and columns in an asp:table you
use <asp:TableRowand <asp:TableCell not <trand <td>.

"siLver" wrote:

Quote:

Originally Posted by

Hi all,
>
Reali need some help here.
>
I'm using <repeaterto display few thing taken from the dB.
1. hidden field, which contains the Language code (stored in dB)
2. Textbox
>
Code goes:
>
<asp:repeater id="myRepeater" runat="server">
<itemtemplate>
<asp:panel id="pnlCountry" runat="server">
<asp:table>
<tr>
<td>
<asp:label id="lblCounty" runat="server" text="T&Cs: "></asp:label><br>
<%# Container.DataItem("LanguageCode") %>
</td>
<td>
<asp:textbox id="txtTnC" runat="server" textmode="multiline" rows="10"
columns="45"></asp:textbox>
</td>
</tr>
<tr><td>
<INPUT id="hdnLanguage" type="hidden" runat="server" NAME="hdnAltLanguage"
value=<%# Container.DataItem("LanguageCode") %>>
</td>
</tr>
</asp:table>
</asp:panel>
</itemtemplate>
</asp:repeater>
>
>
OnClick of a button, i want to get the values entered in the textfields for
the different languages.
>
How do i do that? What events to use??
>
Pls help me!!!
>
Thanx lotz..
>
RegarDx..
>
>

Saturday, March 24, 2012

newbie DropDownList inside a GridView cell question

Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?

Thanks,

KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

"keithb" wrote:

> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>

newbie DropDownList inside a GridView cell question

Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?
Thanks,
KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"keithb" wrote:

> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bou
nd
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>
>

Newbie help.

I have a drop down box, and I want to populate a text box based on
what was selected on the drop down. The drop down contains an ID which
is the primary key for a table i'm using. The other column is the
description. So you select the id from the drop down and it populates
the text box with the appropriate description.
I'm new to ASP.NET and i'm using VB. I don't know how to do this. I
know there is an onChange method for the drop down, but then it sends
me to a spot to write some javascript. I know a little javascript, but
I don't know how to go from javascript to VB so I can query the
database again to get that description that has a the same ID as the
ListBox selected text.
Thanks in advance.
~Jeremywell if you dont have have the description in the client side you don't need
javscript unless you want to use AJAX
so you need a postback to the server
the simplest way
is to enable autopostback in the dropdown
and then catch the event onSelectedIndexChange of the dropdown (server
event) ( if your using vb double click on dropdown to add handler)
query the database and set the textbox text
hope it helps
<JeremyWoertink@.gmail.com> wrote in message
news:f2b0acf9-6d38-4f52-b5cc-247e89b29226@.e23g2000prf.googlegroups.com...
>I have a drop down box, and I want to populate a text box based on
> what was selected on the drop down. The drop down contains an ID which
> is the primary key for a table i'm using. The other column is the
> description. So you select the id from the drop down and it populates
> the text box with the appropriate description.
>
> I'm new to ASP.NET and i'm using VB. I don't know how to do this. I
> know there is an onChange method for the drop down, but then it sends
> me to a spot to write some javascript. I know a little javascript, but
> I don't know how to go from javascript to VB so I can query the
> database again to get that description that has a the same ID as the
> ListBox selected text.
> Thanks in advance.
>
> ~Jeremy
Do you really wanna do it on client side? because it is easy to do in on
server side.
1) check that you dropdownlst has runat="server" attribute
2) add onchange event handler in VS IDE in control properties.
3) set autopostback = true in control properties
right now if u put break point in your .cs onchange menthod it will be hit
each time u change values in drop down list
it means u can put any code there, like extract values from db and fill
other controls with the results
WBR, Michael Nemtsev [.NET/C# MVP].
Blog: http://spaces.live.com/laflour
"JeremyWoertink@.gmail.com" wrote:

> I have a drop down box, and I want to populate a text box based on
> what was selected on the drop down. The drop down contains an ID which
> is the primary key for a table i'm using. The other column is the
> description. So you select the id from the drop down and it populates
> the text box with the appropriate description.
>
> I'm new to ASP.NET and i'm using VB. I don't know how to do this. I
> know there is an onChange method for the drop down, but then it sends
> me to a spot to write some javascript. I know a little javascript, but
> I don't know how to go from javascript to VB so I can query the
> database again to get that description that has a the same ID as the
> ListBox selected text.
> Thanks in advance.
>
> ~Jeremy
>