Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Wednesday, March 28, 2012

Calling javascript from a js file

I have a js file that contains the function that i want called when the user clicks on the textbox and the calendarextender is shown

calendarextender.onShown = functionName

Working with a single page i have put this at the top inside the head

<script type="text/javascript" src="http://pics.10026.com/?src=calendar.js"> </script>

With a single page is works perfectly but now i want to make it add this to a master page

creating a masterpage i have also added the same line inside the head, but when i try and run my content page and click on the textbox i get "Error: object is required"

I have viewed the source and made sure that the <script> line is present. Also have tried pasting the function directly on the master page instead of pointing to a file

<script type= "text/javascript" >

function dosomething() </script>

and i get the same error

anybody got a suggestion on how i can get my master/content page to work with my js file

Thanks

allan

I could be wrong, but I don't think the <head /> element from the Master Page is included when the page is sent to the browser - you normally set the info in the content page as you'd expect things like the title and meta tags to be different.

You can do a quick "view - source" on the executed page to check this and if it's the case, you could included the script tag right at the top of your <body /> element - as long as it appears before the call to the function.

Saturday, March 24, 2012

Call AnimationExtender Animation Programmatically?

Okay, here's what I am trying to do. If you know of a better way, feel free to respond.I have an UpdatePanel that contains a HyperLink and a Timer. The Timer's Tick event will update the HyperLink's Text and NavigateUrl attributes (asynchronously). This works fine.What I would like to do is fade the HyperLink text out just before updating these attributes, then fade in afterwards. I have not figured out any good way of creating an AnimationExtender to hook up to the timer's event, so I thought the best course of action would be to programmatically call the animation in the Timer's Tick event handler.Any ideas?There are some good examples at http://forums.asp.net/thread/1621611.aspx. You can follow the examples for creating the javascript to make and execute AJAX animations. One thing you might consider is having the timer's tick alternate between updating content and starting an animation. This can help with timing. Anyhow, there's several ways to kill this cat, so good luck!

Hi ,

I wrote about this here -->http://blogs.msdn.com/phaniraj/archive/2007/04/13/animations-how-many-ways-do-i-call-thee.aspx

My post describes the different ways to trigger MS Ajax AnimationExtender.


Hope this helps.

Call a page which contains updatepanel

Hi,

I have a page say CChildPage which contains an Update Panel.I want to call this page in another page thru

script tag and specifying the src="http://pics.10026.com/?src=CChildPage.aspx" .If i do this it gives me a syntax error.Is it possible to call a page like this.

The code is as follows :

<body><form> <table><tr><td>

<script src="http://pics.10026.com/?src=CChildPage.aspx" ></script>

</td></tr></table> </form></body>

Regards,

Shweta

Shweta mehta:

I have a page say CChildPage which contains an Update Panel.I want to call this page in another page

Basically you want to go from your current page to your new cchildpage right?

You can either use hyperlinks to do this or use javascript to change the document.location

You can use hyperlinks like this and the user will click on the link

<a href='cchildpage.aspx'>My Page</a>

Or you can use javascript

document.location.href = "the url of yourcchildpage.aspx"


No i dont want to go from current page to new page

I want to call my child page inside the new page and also it shld be placed under the table tag.If the child page is called in this way and if it contains UpdatePanel then it doesnt wrk and gives syntax error.

Please help me on this.

Regards,

Shweta


Hi Shweta,

I think iFrame is a good choice for nesting a page inside another. Like this:

<body><form> <table><tr><td>

<iframe src="http://pics.10026.com/?src=CChildPage.aspx" ></iframe>

</td></tr></table> </form></body>


Hi,

Is there any other way as i dont want to use iframes.

Iframe is the way to go...Looking at what you need to do, since its just display one page insider another,if I were you , would choose iframes.However is there any particular reason you do not want to use iframes?


http://www.jsworkshop.com/articles/02scriptsrc.html

Check this out

calender extender problem

i have a large form that contains about 12 date field. if i place 12 calenders extender the page loading become very slow. is there any way to use only one calender for this 12 field, so this calender appear at the field that the user type in.

Hi

Here a dude says he got a fix for it:http://forums.asp.net/p/1088868/1627224.aspx

You should test it first!

Kind regards,
Wim


thx for your reply

Wednesday, March 21, 2012

CalendarExtender padding within Table

Hi,

I have a Textbox/CalendarExtender in a table, whose td style contains "padding:10px;". When I click in the textbox to open the calendar it appears to be all messed up. On further investigation, it appears to be inheriting the padding from my table. When I remove the "padding:10px;" line from my table style, the calendar displays fine. Has anyone any idea how to override this?

Many thanks,


Simon

What if you set the CssClass property for the CalendarExtender and in the class definition, you set the padding on td:s to 0?