bulletedlist control
-
hi, I am using bulletedlist control and have set displaymode as linkbuttons. And binding data to that. Till here it is working fine. Now when i select some link on that it has to move to some other page. but how to do this i am not able to retrieve the text from the bulleted list. I mean based on the value present in the bulletedlist i need to write the query. But finding difficult since it does not have either a text property or selecteditem property.
Chaitra N
-
hi, I am using bulletedlist control and have set displaymode as linkbuttons. And binding data to that. Till here it is working fine. Now when i select some link on that it has to move to some other page. but how to do this i am not able to retrieve the text from the bulleted list. I mean based on the value present in the bulletedlist i need to write the query. But finding difficult since it does not have either a text property or selecteditem property.
Chaitra N
-
protected void BulletedList1_Click(object sender, BulletedListEventArgs e) { int ind = e.Index; string txt = BulletedList1.Items[ind].Text; }
But since it does not possess navigateurl property, how can i give the link to that?
Chaitra N
-
protected void BulletedList1_Click(object sender, BulletedListEventArgs e) { int ind = e.Index; string txt = BulletedList1.Items[ind].Text; }
Thank you. It is working. One more doubt. I am uploading files (.doc,.gif,.excel,etc) and storing in the server. Now I want to open those files when i click the link buttons. But I am able to get only the path but how to open it. what changes i need to the following code? Dim SQLString As String = "SELECT filepath FROM pictures WHERE title = '" & BulletedList1.Items(e.Index).Text & "'" Dim dr As Data.SqlClient.SqlDataReader Dim comm As New Data.SqlClient.SqlCommand(SQLString, dbconn) If dbconn.State <> ConnectionState.Open Then dbconn.Open() End If Dim str As String dr = comm.ExecuteReader While dr.Read str = dr.Item(0) End While dr.Close() TextBox1.Text = str
Chaitra N
-
Thank you. It is working. One more doubt. I am uploading files (.doc,.gif,.excel,etc) and storing in the server. Now I want to open those files when i click the link buttons. But I am able to get only the path but how to open it. what changes i need to the following code? Dim SQLString As String = "SELECT filepath FROM pictures WHERE title = '" & BulletedList1.Items(e.Index).Text & "'" Dim dr As Data.SqlClient.SqlDataReader Dim comm As New Data.SqlClient.SqlCommand(SQLString, dbconn) If dbconn.State <> ConnectionState.Open Then dbconn.Open() End If Dim str As String dr = comm.ExecuteReader While dr.Read str = dr.Item(0) End While dr.Close() TextBox1.Text = str
Chaitra N
hi.... sorry for late reply.... here u r selecting filepath in query.... so, .. your data reader will give you only path of that file... if you want to open u need to download on client machine .. at that time it will give option for save or open file.... OR .................. OR ............... OR ............. Use System.IO and using this class create streamreader and read file .... ..... Try ... this.... - Best of work...........