Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS problem when convert from ASP to ASP.NET

Status
Not open for further replies.

A1Pat

IS-IT--Management
Jun 7, 2004
454
US
hi all,

I'm hitting a impasse trying to convert ASP code to ASP.NET, and one of the line that central of the attention is:

Code:
<a href="label_sample.aspx?img=Big-O-Tires-Label-BigSample" onClick="return popup(this, "gloss")" target="_blank"><img src="images/Big-O-Tires-Label-Sample.jpg" border="0" style="filter:alpha(opacity=70);-moz-opacity:0.7;padding-bottom:10px" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" runat="server" /></a>

The line basically means: a display thumpnail faded in when mouse over and will be opened to a bigger image in a different window that was pre-seted Width and Height when clicked.

The best I came up so far is:

Code:
<asp:HyperLink CssClass="fad_img" ImageUrl="images/Big-O-Tires-Label-Sample.jpg" NavigateUrl="label_sample.aspx?img=Big-O-Tires-Label-BigSample" runat="server" onClick="return popup(this, 'gloss')" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)"></asp:HyperLink>

Basically, the code will display the thumpnail (w/o fade-in nor fade-out); however, it does open to a new window that was sized as told (by JScript).

Could someone show me how to get the part when the thumpnail does the fadding again with ASP.NET.

Thanks!
 
In case you ask... the CssClass="fad_img" is used to call the css style sheet that

Code:
.fad_img {
	 filter:alpha(opacity=70);-moz-opacity:0.7;
	 padding-bottom:10px;
}

could the problem is coming from here?
 
Very good question!!!

ofcourse I can keep it and save the page as .aspx. No problem there! I know because I'd tried.

I guess the reason is that I would like to learn and at least understand a little bit more about the DOTNET. Why the big fuss, because as I heard from some people, ASP.NET would load somewhat slower than others due to its more complexity coding.

All and all, I just want to learn about it.
 
I found this code from and I translated the tutorial to this,

Code:
<script for = "HyperLink1" event = "onmouseover">
HyperLink1.className = "makevisible(this,0)"
</script>
<script for = "HyperLink1" event = "onmouseout">
HyperLink1.className = "makevisible(this,1)"
</script>

It's still not do the fadding. Does anyone know the className that was mentioned related to. Is it a asp.net code or a name called.
 
There are two types on controls you can use in .NET. There are server controls and HTML controls. Essentially, server controls allow you to access them server-side and then they output their equivilant HTML element. For example, a Hyperlink control will render an anchor tag.

In this situation, it doesn't look like you need to access your anchor tag server-side (i.e. to do any manipulation or to read any of it's properties) so there isn't a need to use a server-side control (Hyperlink). It's all about knowing which controls are best suited for the job and in this case your original code is fine (apart from you have a runat="server" tag which means it will be accessible from the server and this won't be needed).

Make sense?




____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Very!

So, what you mean is all the <asp:Table... craps (sorry!) are un-needed if I basically want to display an simple HTML page?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top