MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

javascript and asp.net

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ASPNet
Author Message
Mel



Joined: 07 Nov 2007
Posts: 2

PostPosted: Wed Nov 28, 2007 4:34 pm    Post subject: javascript and asp.net Reply with quote

Is there a way to use the same javascript code for 2 pages? For
maintenance reasons, if I make a fix or a change I will need to
remember do it for both pages. Is there any way to get around this?
For example, I have one calculator but when I click a link on one page
it is just displayed as a popup window and on another page it is
displayed as a full page (using master page and content).

(Using Asp.net 2.0, javascript, Visual Basic.net, Win XP Pro)

Archived from group: microsoft>public>dotnet>framework>aspnet
Back to top
View user's profile Send private message
Mike



Joined: 08 Aug 2007
Posts: 3

PostPosted: Wed Nov 28, 2007 8:02 pm    Post subject: Re: javascript and asp.net Reply with quote

Create a js file. Put your javascript in that file and then just include it
on your pages.




"Mel" wrote in message @b40g2000prf.googlegroups.com...
> Is there a way to use the same javascript code for 2 pages? For
> maintenance reasons, if I make a fix or a change I will need to
> remember do it for both pages. Is there any way to get around this?
> For example, I have one calculator but when I click a link on one page
> it is just displayed as a popup window and on another page it is
> displayed as a full page (using master page and content).
>
> (Using Asp.net 2.0, javascript, Visual Basic.net, Win XP Pro)
Back to top
View user's profile Send private message
Mel



Joined: 07 Nov 2007
Posts: 2

PostPosted: Wed Nov 28, 2007 6:05 pm    Post subject: Re: javascript and asp.net Reply with quote

On Nov 28, 2:02 pm, "Mike" wrote:
> Create a js file. Put your javascript in that file and then just include it
> on your pages.
>
>
>
> "Mel" wrote in message
>
> @b40g2000prf.googlegroups.com...
>
> > Is there a way to use the same javascript code for 2 pages? For
> > maintenance reasons, if I make a fix or a change I will need to
> > remember do it for both pages. Is there any way to get around this?
> > For example, I have one calculator but when I click a link on one page
> > it is just displayed as a popup window and on another page it is
> > displayed as a full page (using master page and content).
>
> > (Using Asp.net 2.0, javascript, Visual Basic.net, Win XP Pro)

Thank you, I'll give it a whirl.
Back to top
View user's profile Send private message
Braulio Diez



Joined: 08 Aug 2007
Posts: 14

PostPosted: Thu Nov 29, 2007 6:31 am    Post subject: Re: javascript and asp.net Reply with quote

That approach has one known issue... the js file get cached into the client
computer, if you make any update final users would be forced to press CTRL+F5
to avoid loading that file from cache.

A workaround is to add to the js call a querystring with the date and the time

http://blogs.msdn.com/cbeiter/archive/2006/11/16/caching-and-crunching-your-js-files-on-office-live.aspx

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------




"Mel" wrote:

> On Nov 28, 2:02 pm, "Mike" wrote:
> > Create a js file. Put your javascript in that file and then just include it
> > on your pages.
> >
> >
> >
> > "Mel" wrote in message
> >
> > @b40g2000prf.googlegroups.com...
> >
> > > Is there a way to use the same javascript code for 2 pages? For
> > > maintenance reasons, if I make a fix or a change I will need to
> > > remember do it for both pages. Is there any way to get around this?
> > > For example, I have one calculator but when I click a link on one page
> > > it is just displayed as a popup window and on another page it is
> > > displayed as a full page (using master page and content).
> >
> > > (Using Asp.net 2.0, javascript, Visual Basic.net, Win XP Pro)
>
> Thank you, I'll give it a whirl.
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
using javascript with datagrid I can not seem to figure this out, but really haven't work a lot with javascrip and .NET. I have a data grid and I want to put a button in it and when the button is pressed it will call my javascript. Now the grid is in a .ascx file. The other kicker is

how to get selectedvalue of radiobuttonlist in Javascript? Hi, I need the SelectedValue of a in a Javascript variable. The is only used in a form for inputting data into a database. Before sending it to the database, i check the inputted values in Javascript. (By the way there is a

Javascript Escape function when using the Javascript function is there any advantage to using Javascript's Escape() function + function versus ASP.NET's

Microsoft JavaScript Menu Dear friends, I want design web site by MS JavaScript menu like Microsoft.com site in left & top of pages. How can I do it? Do I need further software for this reason. Thank you so much, Pejman Mousavi,

runtime Javascript error after conversion from 1.1 to 2.0 I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 (.NET v2.0.50727). The entire solution currently uses the following technologies - Windows Server 2003 Windows Mobile 2003 Windows XP Professional SP2 Windows 2000 Professiona
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ASPNet All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group