 |
|
|
|
| Author |
Message |
Mel
Joined: 07 Nov 2007 Posts: 2
|
Posted: Wed Nov 28, 2007 4:34 pm Post subject: javascript and asp.net |
|
|
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 |
|
 |
Mike
Joined: 08 Aug 2007 Posts: 3
|
Posted: Wed Nov 28, 2007 8:02 pm Post subject: Re: javascript and asp.net |
|
|
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 |
|
 |
Mel
Joined: 07 Nov 2007 Posts: 2
|
Posted: Wed Nov 28, 2007 6:05 pm Post subject: Re: javascript and asp.net |
|
|
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 |
|
 |
Braulio Diez
Joined: 08 Aug 2007 Posts: 14
|
Posted: Thu Nov 29, 2007 6:31 am Post subject: Re: javascript and asp.net |
|
|
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 |
|
 |
|
|
| 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 |
|
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
|