Javascript - Order Of CSS And Script Calls In A Aspx Page

Oct 19, 2010

Is there any specific order in which the external CSS or Scripts should be called in a aspx page which could help a bit in decreasing the page load time?

i.e

script type="text/javascript" src="../Includes/JavaScript/jquery.ui.tabs.js"
link href="../Includes/css/ui.all.css" rel="Stylesheet" type="text/css"

or

link href="../Includes/css/ui.all.css" rel="Stylesheet" type="text/css"
script type="text/javascript" src="../Includes/JavaScript/jquery.ui.tabs.js"

View 4 Replies


Similar Messages:

Web Forms :: Asychronous Calls From An ASPX Page`?

Mar 19, 2010

I have a method in a dll which fires of call to a wcf service after some processing. The aspx page has to make the dll method call and redirect back or redirect to another page.So I need to call the method asynchronously on the page load and then redirect without waiting. How do i do this??

View 3 Replies

AJAX :: Make Calls To Page Using JavaScript And XmlHttp

Mar 24, 2014

function addToFavorites(prod, box) {
var favPage;
var response;
if (box.checked == true) {
favPage = "xyz.aspx?type=add&product=" + prod;
} else {
favPage = "xyz.aspx?type=remove&product=" + prod;

[Code] ....

I am using the above javascript to call a page on check box click.It is working fine on my visual studio project.

But when i deploy that it is not working.javascript is calling but not able to call that page.

I am using visual stuido 2008 / 3.5  as my development server.

View 1 Replies

PageLoad Event Is Not Fired When An Aspx Is Opened Through Javascript Of Another Aspx Page

Jan 25, 2011

I have an aspx application with 2 aspx pages. Second aspx page will get opened on click of a button in first aspx page using JavaScript. The problem is, when the second aspx page is getting opened, its Page_load event is not firing. Only when I refresh the second page, page_load event of second aspx page is fired. what might be the problem and what is to be done to fire the page_load event.

View 1 Replies

Javascript - How To Embed A Static HTML Page In Aspx Page

Mar 7, 2011

I have a static HTML page complete with client-side scripts and css (both are included in the html). I was wondering if it would be possible to embed this HTML page into an ASPX page and have the ASPX page be able to respond to javascript events that are raised from within the static html document? Does asp.net provide a specific control for this or can I use a frame?

View 3 Replies

VS 2008 - Using JavaScript On ASPX Page

Oct 4, 2011

I'm not conversant with JavaScript, however I need to refresh the page in few seconds so I want to use this code-

<script type="text/JavaScript">
<!--
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);", timeoutPeriod);
}
// -->
</script>

<body onload="JavaScript:timedRefresh(10000);">
<p>

This page will refresh every 10 seconds. This is because we're using the 'onload' event to call our function. We are passing in the value '5000', which equals 5 seconds.

</p>
</body>

Now my aspx page is using Content and referencing masterpage, Page Language="VB"

When I try to add this code to a new page it works fine and page refreshes as desired, but on existing page it gives error-ErrorValidation (XHTML 1.0 Transitional): Element 'body' cannot be nested within element 'td' ....

View 7 Replies

C# - How To Register Multiple JavaScript Calls To Run On PostBack

Feb 10, 2011

I have an ASP.NET page with two instances of the same Web User Control (a simple WYSIWYG editor). On submit, the WUCs do a little JavaScript magic and then proceed with a normal postback.

The first instance seems to be working, but the second fails to post changes back to the server (it reverts to the original, and posts that). I believe the problem is that the JS only fires for the first WUC. I've traced that to the following code, from the generated client-side source:

function WebForm_OnSubmit() {
prepHtml('AddEditPopup1_ctlEditorQuestion_txtEdit','AddEditPopup1_ctlEditorQuestion_divEdit', 'AddEditPopup1_ctlEditorQuestion_divHT' );
//snip...
}

The problem seems to be that there should be two calls to prepHtml: one for the ctlEditorQuestion instance of the WUC, and one for the ctlEditorAnswer instance.

Instead, there's only the one for ctlEditorQuestion. Both controls are registering the OnSubmit event, but one of them overwrites the other.The prepHtml call is registered from the WUCs' C# code at runtime:

//Page_Load
_onSubmit = String.Format("prepHtml('{0}','{1}', '{2}' );",
txtEdit.ClientID, divEdit.ClientID, divHT.ClientID);
//OnPreRender
Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), "get-html", _onSubmit);


I should point out that I didn't write this control myself, and I've never seen this kind of runtime registration of OnSubmit JS code before. Page.ClientScript.RegisterOnSubmitStatement is totally new to me. I need to register both prepHtml calls so they run sequentially. Is this possible? I'm open to alternatives to Page.ClientScript.RegisterOnSubmitStatement, so long as the code still gets fired on submit.

View 1 Replies

Javascript - ASPX Page Closing Automatically

Feb 12, 2011

First I am new to the asp.net world and am trying to figure out a weird issue that I am having. I have a page that has a form and on submit I launch another aspx file that exists in the same directory. The problem is the aspx file is shown and the file closes immediately! However, the weird part is if I make any modifications to the aspx file and save it and then run my application it works fine only the first time? Any subsequent submit actions launch the aspx page but then the aspx file immediately closes. But after I make some modifications to the aspx file..(simple ones) it launches correctly the first time. We are targeting .net version 4.0 and using IIS7. I am thinking that the asp worker process is doing something weird like checking for timestamps and closing it?!

View 1 Replies

Passing Parameters To OnLoad In Aspx Page From Javascript?

Aug 11, 2010

I have this javascript

function myFunction(source) {
window.open(source, "Title", 'width=400, height=400');
}

and in c# code I call it by

HtmlPage.Window.Invoke("myFunction", source);

which opens up a aspx page and goes to its OnLoad function:

protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);

how do I pass in parameters to the event args in the aspx page? or is that even possible? and how can I pass these parameters from my c# code to the javascript?

View 2 Replies

Javascript - Resize IFRAME Onload In .aspx Page

Feb 8, 2011

In an .aspx page with the vb.net codebehind i am using IFRAME , which would be created inside the repeater control. Since i want to resize the IFRAME based on the content within the page i have been using the resize function Obtained from here on the IFRAME onload as shown below.

<iframe id="IframeSubsectionArea" scrolling="auto" width="100%" onload="resizeIframeToFitContent(this)" runat="server">

However it is throwing the error as the method could not be found in the form. Is there any client side script variant for the onload event? May i know,What might be the reason for the error and its solution?

View 1 Replies

Make Call From Javascript Slider Through Aspx Page

Mar 1, 2010

I've created a C# function which extracts data from an mssql database, formats it to a json string and returns that. Now I need to make a call from my javascript (jQuery) slider through an aspx page that is related to the C# code file. I have actually never done anything like this before, from what I could tell by googling I need to use xmlHttpRequest, but how exactly do I make the function get hold of this string? It would be awesome if someone had some example code that shows how this works.

View 2 Replies

Register Javascript File To Aspx Page From WebReousrce?

Jul 7, 2010

How do i add my javascript file as an embeded resource to the page after the ajax javascript already on the page? NB want to do this part dynamically to have code wrapped up in usercontrol.

in aspx page: scriptmanager

Code: Assembly: WebResource("Functions.js", "text/javascript")
Code: onPreRender:

ScriptManager.RegisterClientScriptResource(Me.Page, Me.GetType().BaseType, "Functions.js")

This code successfully adds my javascript code to the page but not after the AJAX javascript and so not all of my functions work correctly.

View 1 Replies

VS 2008 - JavaScript Datepicker Won't Work Well In ASPX Page

Sep 14, 2013

code behind:

$("input:text.inputTypeDate").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true
});
});

ASP :

<asp:TextBox ID="txtDate" runat="server" Width="120px" class="inputTypeDate">
</asp:TextBox>

It works fine on page load, but when I click on clear button to empty textbox, it stops working.

View 3 Replies

Web Forms :: Use Some Javascript Code To Make AJAX Calls To Different Handlers?

May 12, 2010

I am currently building an asp.net webforms application in ASP.NET C# using Visual studio 2008 and the Framework .NET 3.5.In my application main page, I use some javascript code to make AJAX calls to different handlers (.ashx files) in order to get some information.In this handlers définition (in the CodeBehind), I use the Oracle provider for .NET (Oracle.DataAccess.Client) to get the requested information from an Oracle database.The thing is, when I make a first call to one of these handlers, everything works just fine, but when the main page try to repeat the call in order to update the information requested, I encounter a problem.In fact, it appears that the different Oracle SQL request results that were made during the first call are still in memory and that the requests are not repeated correctly in order to obtain the updated information from the database. The application keeps the first results and this is these results that are sent back to the main page once again.I don't know how to force the handler to obtain new results and work with it instead of working with the previous results.In the handlers définition, the IsReusable methods are all set to false.I have called the Dispose() méthods of every Oracle object at the hand of the handlers définition and then the System.GC.Collect() méthod to force Garbage Collection. But this does not seem to be sufficient to be sure that nothing is kept in memory.

View 3 Replies

Calls To Successive Calls On Repeater With XML Datasource Is Not Binding New Data?

Feb 17, 2010

I have the following Page_Load function...

protected void Page_Load(object sender, EventArgs e)
{
XmlDataSource1.Data = GetXmlFromFile(Request.QueryString["file"]);
XmlDataSource1.DataBind();
Repeater1.DataBind();
}

The page in which this Page_Load resides is called by a parent page. Each time this Page_Load gets called the value of "file" in the query string will be different. So each time I will be receiving the XML contents from a different file which are inserted into the XmlDataSource and then bound against by the Repeater. Getting the XML data from the file works great but when I bind against the repeater that only works the first time through Page_Load. Each time after that when this code is executed the same results from the first XML file are displayed in the repeater.

What am I missing here. How can I get the XML data to be bound against the repeater on each page load instead of just the first one?

View 3 Replies

Multiple Webservice Calls / Some Of Its Calls Are Duplicated (with Difference Of Milliseconds)

May 10, 2010

I have a webservice (ASP.NET) deployed on a webfarm. A client application consumes it on daily basis. The problem is that some of its calls are duplicated (with difference of milliseconds). For example I have a function Foo(string a,string b). The client app calls this webmethod as Foo('test1','test2') once but my log shows that it is being called twice or sometimes 3 or 4 times randomly. Is this anything wrong with the webfarm or the code? Note that the webmethod has simple straighfarward insert and update statements.

View 1 Replies

Web Forms :: Call Javascript Function From Code Behind From Page.aspx.vb

Nov 24, 2010

how can i call javascript function from code behind from my Page.aspx.vb. in my Page i have a button i want to add this function to my button onclick="refreshParent();"

View 8 Replies

AJAX :: Unable To Access Accordion Using Javascript In .aspx Page

Apr 22, 2010

Using vb.net/asp.net 2005:

I am trying to access my accordian in my javascript so I can expand the first (and only) pane but whenever I do that I get a page error before the page loads "Object reference not set to an instance of an object'

The name of my accordian is "myAccordian". and the accordion is inside a gridview.

Just for testing I did the $find on my gridview (not the accordion) and that worked fine,

[Code]....

View 3 Replies

Javascript Calls To An Ajax WebMethod. How To Get Multiple Output Params Returned

Apr 24, 2010

I know how to call a simple old fashion asmx webservice webthod that returns a single value as a function return result. But what if I want to return multiple output params? My current approach is to separate the params by a dividing character and parse them on teh client. Is there a better way.

Here's how I return a single function result. How do I return multiple output values?

<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
[code]....

View 2 Replies

Javascript - How To Call The Jquery Function In .aspx Page To Usercontrols Controls

Jan 27, 2011

i have the following function in default.aspx.....i have webusercontrol which have 10 checkboxes and 1 button .... i want when i click on button1 of user control then it can access the function of default.aspx ...page ...if i dragged the usercontrol to default.aspx

Normally if i use 10 checkboxes and 1 button in default.aspx then it works fine ... if i use 10checkboxes and 1button in usercontrol then drag that usercontrol in default.aspx then it will not work ..

[Code]....

View 3 Replies

Custom Server Controls :: User Control Calls Javascript Code On Load?

Jul 23, 2010

I'm building this small control. It should detect client resolution and set height and width values within two separated HtmlInputHidden controls. But tester property is not getting values froms this control.

[ToolboxData("<{0}:UIControlResolution runat=server></{0}:UIControlResolution>")]
public class UIControlResolution : Control
{
HtmlInputHidden _txtwidth = new HtmlInputHidden();
HtmlInputHidden _txtheight = new HtmlInputHidden();

[Code]....

View 2 Replies

Unable To Access Dynamic Controls Inside Ascx Using Javascript On Aspx Page

Jun 2, 2010

I have a user control (ascx) which contains a control (hidden field). In the page_load event of ascx, i have the below code:

HyperLink.Attributes.Add("onclick", "JavaScript:return AccessControl('" + hdnField.UniqueID + "');");
Note: The hidden field resides in .ascx file.

I want to access this hidden field at runtime and i have the below javascript function in aspx page that loads the usercontrol.

function AccessControl(hdnFieldId)
{
var ctrl = document.getElementById(hdnFieldId);
alert(ctrl);

I am getting 'null' value in the alert. I tried using 'ClientID' and 'this' instead of 'UniqueId'. I am wondering why this is not working. I am using .net 2.0.

View 1 Replies

AJAX :: Microsoftajax.js Libraries To Make My Webservice Calls Via Javascript - Services Returning Basic Types

Mar 9, 2010

I'm working with the MicrosoftAjax.js libraries to make my webservice calls via javascript, right now all my services are returning basic types, like string, int, bool. can i also have my services return things like DataSets, DataTables, or custom Classes that I have built to my javascript side?

View 3 Replies

AJAX :: JavaScript Function To Pass Value From MasterPage.aspx To Default.aspx And Then Refresh UpdatePanel

Feb 26, 2011

For example, I have master page MyMasterPage.aspx and content page MyDefault.aspx. I have many UpdatePanels at MyMaterPage.aspx, and also I have many UpdatePanels at MyDefault.aspx.

[code]....

I want JavaScript functionClickMenu(this) at input button [id="ButtonMaster1" @ MyMasterPage.aspx] pass its value ["Menu-1"] into text box [id="TextBoxDefault1" @ MyDefault.aspx], and then performing update / doing post-back to server ONLY FOR UpdatePanelDefault1.

I am looking forward an example code for JavaScript functionClickMenu(this).

View 4 Replies

Call To Page In Any Subfolder Calls Main Page?

Oct 14, 2010

I have a handler CsvExport.ashx that resides in the root of my web application, the problem is it is called from a javascript include so I can't use ~/ how can i have it so that any call to a file name CsvExport.ashx in in folder in the web application get sent to the proper file?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved