I have the following line inside the <ItemTemplate> tag:
<a href=""><%# {I want to put something here but dont know how} %> </a>
In my code behind I have a NameValueCollection variable that contains all strings:
NameValueCollection myListofStrings = //calling a method here that populates myListofStrings
this.EquipmentList.DataSource = myListofStrings;
this.EquipmentList.DataBind();
can someone tell me how to bind this NameValueCollection variable to my datalist tag in the markup? Also additional knowledge on how to bind a datalist to a dataset, sqldatareader, IList<>
but for now what do I write inside the tag if lets say i HAVE to bind to a NameValueCollection variable like in my case above. It has no properties or columns so I cannot write anything like Eval("propertyname") which is the answer that most here gave me. It is just like I am binding it to an array of strings. So what do I write now?
I have a DataList containing an ImageButton whose ImageUrl property I want to set by combining it with a string returned from a codebehind file property and a database value.
I have a protected property in my codebehind called strPath.
I want to combine it with a database value in my aspx file. Like so:
So that gives me a series of URLs in the repeater:
[URL]
OK, so with a simple proxy tool someone can replace either of the parameters with some OTHER number to get access to what they shouldn't see.
server-side validation and authentication aside, is there a better method other than passing parameters when trying to create a dynamic URL within a repeater?
I'm using a NameValueCollection to set the style of a column in my datagrid. Is it possible to specify the css class instead of the style as I'm doing it?
I am building a DropDownList control dynamically. Constraining this discussion to within just the OnInit() method / state in the asp.net lifecycle, is the only way to see the dropdownlist's posted value to look at the Request.Form NameValueCollection? I m aware that the dropdownlist's viewstate is restored by the time OnLoad() is reached, but I need it's value before then (im pretty sure LoadViewState($object) is of no use?)
I am using datalist to bind the generic list. On databind() command I am getting error "nable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
I have 2 datalist in my page that use 2 procedure to fill data how i can use 2 datalist with 2 different procedure in my page i write these code in my page but occur error...
protected void Page_Load(object sender, EventArgs e) { SqlConnection _cn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["behtopConnectionString"].ConnectionString); SqlCommand _cmd2 = new SqlCommand("house_1st", _cn);
I have a collection of objects that are display in google maps. This map is refresh (using Javascript, a call to the server using WebServices) every minute.
I need to display some of the information of these objects in a gridview control.
When I get the collection I store them in a session variable.
Can i use this variable (session) to bind to my gridview? I would like to avoid to go twice to the server, one to get the collection for display the map and other to get the collection for the gridview.
I have a Datalist and when a button is clicked I would like to send the values of the fields to a new page to fill some text boxes. What is the best way to do this. I had thought that since the DataList had itemtemplates that were labels I could reference them like regular labels ( str = Label1.text ). That isn't working. I was just going to send the values through a query string. Which I have an example of that, unless there is a better way.
i m trying to something new for myself...actually before some day i post a thread that how to fire item command event of Runtime genrated datalist, in this datalist i creating item template and hadder template at runtime, and in this item template i m creating a button at run time.No problem was that i cant handle the item command event of datalist through that button, but no luck, no one show thir interest and i couldnt find any thing regarding this.so i decided to do the work with client side ajax scripting, i found a liitle bit success, now i can delete the particular record from the database. but now problem is that i cant rebinding the datalist again, with new updated dataset.
I want to bind my dataliadt with scroll event .. I got the solution in the article [URL]....
But my binding method is also associated with some control of page so i cant use sotred procedure as suggested in article ....... how I have to bind my datalist ?
I have this list of names where I want the location underneath each name but nothing is showing up. Is it not actually possible to bind the repeater's datasource to the items in the datalist because nothing is really selected in the datalist - it's just all there?
i have datalist.i can bind datalist but problem is that null value does not bind.but all values are not null.
my scenerio is asign click btn click then view open then insertion and save.if free class btn click then another view open and then insertion...in asign class it can bind but free class not bind.while i m providing day and period also.so why they canot bind?