User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,534 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,047 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2763 | Replies: 3
Reply
Join Date: Oct 2007
Posts: 6
Reputation: sauru_garg is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
sauru_garg sauru_garg is offline Offline
Newbie Poster

Question making a datalist visible from javascript

  #1  
Oct 11th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 1,058
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: making a datalist visible from javascript

  #2  
Oct 11th, 2007
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.
Reply With Quote  
Join Date: Oct 2007
Posts: 6
Reputation: sauru_garg is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
sauru_garg sauru_garg is offline Offline
Newbie Poster

Re: making a datalist visible from javascript

  #3  
Oct 12th, 2007
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
Reply With Quote  
Join Date: Oct 2007
Posts: 6
Reputation: sauru_garg is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
sauru_garg sauru_garg is offline Offline
Newbie Poster

Re: making a datalist visible from javascript

  #4  
Oct 12th, 2007
hey peggy , u r quite right , i should use server side coding to send id , thanks , i shall tell u after doing
saurabh
Originally Posted by SheSaidImaPregy View Post
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 4:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC