hi guys, well i have created a repeater control and have made it expand on mouseover by using javascript , also i have returned the value of an id in a label on mouse click. i want to make the datalist on the page visible ob this click and also send this id to the datalist .. problem is this can be done as the label's value can be checked on page load and on page load , the label loses the value passed to it in jscript .... please help

Recommended Answers

All 3 Replies

well it is hard to understand exactly where the problem is. From what I read, I believe you are losing the label's value that is being sent to the javascript when you click on the label? Go step by step so a first grader can understand:

1. created a repeater control to expand on mouseover using javascript.
2. onclick of a label? javascript retrieves the label's id and sends it to the datalist that becomes visible on this click also. What are you clicking, a label, hyperlink, or button?

You can always send the value via querystring if that isn't a problem, otherwise you can use the viewstate to hold the value for you. This only works on postbacks though.

Like I said, I am not quite exactly sure what you're doing. Maybe post some code?

If you want to pass the id to the datalist and activate the datalist onclick, you should make the datalist visible via the block method in jscript. Create a function in javascript that retrieves both the current id of the current label and sets visibility of the datalist to block.

But if your datalist requires the id from the label, then you need to do a postback. Then why use javascript to pass the id? Explain please.

hi pregy
well i have a repeater , in which i am using javascript to hide and show details of a heading on mouse over, each row has details of a employee, when clicked on this row , i want to make a datalist on same page to be made visible , that is quite possible but i have to supply emp id to the datalist too so that it can show details accordingly . when i post this value to a label , i am not able to read the same , because the value to the label is supplied by javascript and if i have to check and load in datalist , page has to be loaded back , which in turn clears the id.
my options are, either i put this bvalue some how into viewstate which is very ditchy or in cookies etc . problem is to make the id t/f from client side to server side . i'm working upon using hidden textboxes

hey peggy , u r quite right , i should use server side coding to send id , thanks , i shall tell u after doing
saurabh

well it is hard to understand exactly where the problem is. From what I read, I believe you are losing the label's value that is being sent to the javascript when you click on the label? Go step by step so a first grader can understand:

1. created a repeater control to expand on mouseover using javascript.
2. onclick of a label? javascript retrieves the label's id and sends it to the datalist that becomes visible on this click also. What are you clicking, a label, hyperlink, or button?

You can always send the value via querystring if that isn't a problem, otherwise you can use the viewstate to hold the value for you. This only works on postbacks though.

Like I said, I am not quite exactly sure what you're doing. Maybe post some code?

If you want to pass the id to the datalist and activate the datalist onclick, you should make the datalist visible via the block method in jscript. Create a function in javascript that retrieves both the current id of the current label and sets visibility of the datalist to block.

But if your datalist requires the id from the label, then you need to do a postback. Then why use javascript to pass the id? Explain please.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.