Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asp panel

Posted on 2004-09-22
9
Medium Priority
?
654 Views
Last Modified: 2012-05-05
Hi Experts,

Is there any way to do get some session variable value into asp:panel element onMouseOver event ?

Thank you.
0
Comment
Question by:fpoyavo
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 2

Expert Comment

by:netjkus
ID: 12125785
Store the session value in a variable on Mouseover event,

then access the value in the element  Text as <%#DataBinder.Eval(Container.DataItem, "SessionVar")%>

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 12126098
Netjkus,

Not following. Please more details.
I already have session variable populated in another class.
I need just to access it onmouseover texbox without Javascript.

Thank you.
0
 
LVL 2

Expert Comment

by:netjkus
ID: 12126141
The session variable is accessible anywhere in the program.. But I dont quite clear why you dont see that. You dont need to use Javascript.. Do you need to display that value on tooltip or something?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
SimonTocker earned 2000 total points
ID: 12130951
If your talking about accessing things on the client browser in the page when its already rendered, too late.  You need to understand the difference between server side and client side, all the c# code you have in your code behind once rendered is now not accessible to the client in the rendered page uless you spat it out to the client.

Like netjkus says, do you want a tooltip, thats one way to get that info without using Javascript use title="fred" in the label/panel.

Otherwise if you want something more complicated than that you are talking javascript, the onMouseOver event IS a client scripting event, your are using client side script from that point.  


BTW.   A panel, whilst being a handy place holder and all the vb guys are used to panels, renders different in non-ie browsers, it becomes a table, something you might not want.  Use a place holser and labels instead of panels if you dont want that unwated behaviour.



0
 
LVL 1

Author Comment

by:fpoyavo
ID: 12133153
Netjkus,

I just need to get session variable value on mouse over textbox.

Thank you.
0
 
LVL 3

Expert Comment

by:w_shaila
ID: 12138309
TextBox1.Attributes.Add("onmouseover","javascript:getSession('"+ Session["ID"].ToString() + "')");

getSession is a Javascript function

function getSession (id)
                  {
                        alert(id);
                  }

Like this you can get it
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 12143390
W_Shaila,

Yep. The only problem is that this Javascript has to be server side to get Session variables which does not work in C#. I was trying it along time ago.

Thanks anyway.
0
 
LVL 3

Expert Comment

by:w_shaila
ID: 12143757
The code which I posted is in C# only. it is working for me.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 12162967
W_shaila,

In fact VS does not compile your code at all.

Thank you.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question