Javascript function is not firning

M

mrajanikrishna

Hi

I am designing an application. I have developed an user control
for sidebar links(User details, edit details, change password). These
are given in LoginView control, LoggedInTemplate.

These targets are located in ~/Users folder.

I placed these links in a table with anchor tag. I have given href as
~/Users/filename.aspx

This is working fine but I wrote code to fire javascript function
when the user clicks on table->tr->td

I put the script tag in Master page(external js file). When I am at
the root folder, the javascript function is firing(clicking on TD).
When I move to /Users folder, the javascript functions is not firing.

Whats the problem.

And, how can I refer ~/Users/filename.aspx in javscript function? ~/
Users link works with server side controls. How can I use this
javascript function.

thanks in advance
 
B

bruce barker

the "~/" is translated by server code for url properties. of course a
<script src="~/somepath"> will not be converted because its not a server
control, and if you place at runat=server, then its not client script.

to get around this issuse, asp.net supports javascript files as a
resource, and has an api to register them as a webresource or
scriptresource if using ajax.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top