473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

datalist, revisited

i should have included the code in the first post.
sorry.
i've got this working but it returns the 'index' property whereas i'd like the value of what's in the property.i'll include the minimalist of code here

<asp:datalist id="Datalist1" OnItemCommand="getSelected">

<SelectedItemTemplate>
<asp:HyperLink ID="ot_job_id" Runat="server" />
</SelectedItemTemplate>

<ItemTemplate>
<asp:LinkButton Runat="server" CommandName="select">
<%# Container.DataItem("ot_job_id")%>
</asp:LinkButton>
</ItemTemplate>

<SelectedItemTemplate>
<%# Databinder.Eval(Container.DataItem,"ot_job_id") %>
<%# Convert.ToDateTime(Databinder.Eval (Container.DataItem,"balance_date")).ToShortDateSt ring %>
<%# Databinder.Eval(Container.DataItem,"bid_area") %>
<%# Databinder.Eval(Container.DataItem,"sched_start") %>
<%# Databinder.Eval(Container.DataItem,"sched_end") %>
</SelectedItemTemplate>
</asp:datalist>

thats the datalist, and i think that part is fine.
here's where i believe i get stuck, im only pulling the index and i need to get to the
actual value of the selection.

<script runat="server">
Sub getSelected(s as object, e as DataListCommandEventArgs )
dim mychoice as string
DataList1.SelectedIndex = e.Item.ItemIndex

mychoice = Datalist1.SelectedIndex.toString (i know im just pulling an index here, i
just wanted to see that i'm reaching anything)

lblMsg.text = mychoice
End Sub
</script>
thanks again to anyone who can shed some light on this
rik

original post:

does anyone know of a good place to go to get some ideas on datalists?
im building a web app, in asp.net (vb.net) and displaying data in a data list.

i want to be able to select any one of the first column items with a "onclick" and store the 'literal' in a variable (either session or global)
at this point i'm not picky at all.

ive tried using the OnItemCommand="someProc" in the code behind w/out much luck

any help is appreciated. ive been looking on the web and in books for days and found all sorts of variations, from making that column a 'link' , to making it an <asp:button>

thanks again as usual.
great great forum here
rik
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 19 '05 #1
0 902

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: pete K | last post by:
Is it possible in asp.net to have a datalist in the itemtemplate of another datalist? For example: <asp:datalist id="MyList" runat="server"> <ItemTemplate> <table border="0" width="300">...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
2
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: ...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
0
by: Les Caudle | last post by:
I have a menu system composed of a DataList nested inside a DataList. The outer DataList has it's DataSource (composed of a DataSet with two tables linked by a CategoryPagesRelation Relation) set...
1
by: AJ | last post by:
Hi all, With the following code in mind : <asp:DataList ID="dlOne" DataKeyField="myField1" DataSource="<%# GetDataSource1()" Runat="server"> <ItemTemplate> Output Value Here! <asp:DataList...
3
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.