.net - Load-time Initialization For Hidden Controls?
Jul 9, 2010
Our web application started out as a big, honkin' ASP.NET AJAX 'page' with oodles of controls on it. They all shared a small set of large .js and .css files. I need to use some of these controls in other, unrelated pages around our site. The difficulty is in all the other stuff the .css and .js files bring along with them when I try to use those controls elsewhere - too much and there's a lot of bloat, too little and the controls don't work.
So, I've been experimenting with breaking up the .css and .js and writing the controls to register the .js and .css they need. Initially I will end up with many more but smaller .js and .css files, but I can combine them at run-time later. I just want to encapsulate these controls so the pages that use them know less about what it takes to use them.But I am running into a problem. I am using OnInit or OnLoad to register the .css and .js as needed. Unfortunately, none of these methods is called if the control is not visible the first time you hit the page when all the .css and .js needs to make its way to the client. It isn't until later on that the controls are enabled for thier specific functions that they are visible and could emit the .js or .css. Then it's too late!
Do I have to bite the bullet and hand-include the right .css/.js on the pages I use these controls on, or is there a better way to 'inventory' the controls in use to get them to emit what they need?
View 2 Replies
Similar Messages:
Jun 21, 2011
I am using a third party gateway. The third party gateway does not support query-string , so i will need to post the form to pass the values to the given URL and another thing is that they don't expose the web-services so we need to use their page and that means we need to host it in an iframe in asp.net
so what i did is that i have hidden fields that will be used as parameters as depicted below
Code:
<input type="hidden" name="p1" value='4635' />
<input type="hidden" name="p2" value='Reference_test' />
<input type="hidden" name="p3" value='Purchase credits' />
[Code]..
Now the purpose of this , is to load the iframe after the page load event of the asp.net gets fired.
Now my problem here is that when the iframe loads , it does not pass the parameters to the url that is being set in the iframe.
I have attached the example, project. (2kb)
When you run the project you will notice when the iframe loads there is an Error
"NO VCS ID"
now this means that the parameters were not passed when the Iframe loads , i can understand because it seems like iframe does not do a full form post. so to demonstrate what i want, click the proceed button and you will notice it will give you a page with no errors and it will be a page where credit card details are required , i want to iframe to load that the first time.
View 1 Replies
May 18, 2010
I've got an odd issue with my pages. My pages include a login modal pop-up and registration modal pop-up. When the page loads, the panels briefly flicker (appear) and then are hidden. It looks very unprofessional so i was wondering if anyone had a clue to how i can avoid this.Here's a URL to see whats happening:[URL]
View 2 Replies
May 20, 2010
Server Error in '/MedTegraSL.Web' Application.
Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Description:
An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Source Error:
[Code]....
Source File:
c:ProductiveTeamsMedTegraPresentationMedTegraSLMedTegraSL.WebMainMaster.Master Line: 16 Assembly Load Trace: The following information can be to determine why the assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be loaded.
[Code]....
Stack Trace:
[Code]....
View 2 Replies
Apr 30, 2010
I am working on a ASP.NET 2.0 application. It is hosted on IIS 6 on Windows 2003 server.
Few pages have jpeg images (around 50 images and 50 KB each). It takes long time to load the page for the first time. But when i open the same page for the second or third time it is faster.
why does a web page take long time to load for the first time?
Is it cached somewhere when it loads for the first time? Do we have any control over it?
View 5 Replies
Aug 25, 2010
Issue:
As my pages are taking time to load first time.
So user has to wait till full page gets loaded and thats irritating . Was this the reason MVC was evolved?
Solution :Should i use partial rendering on all pages including home page, and all forms getting called from home page.
So even if half page is loaded thats less frustrating
For Partial rendering what i plan is : i will put Scriptmanager with Enable partial renderingand update panel for half part of page.
So that user dont have to wait for full page to load.
Is my plan correct? Problem is i cannot regenerate page load issue every time.
View 4 Replies
Jul 30, 2010
I am working on Scott Mitchell's ASP.Net in 24 hours book. I am running into what looks like a simple problem that is getting the best of me.
When a page loads, the UserId of the currently logged in user will be retrieved in the page Load event and placed into the Text value of a Label. But, when the page opens when I am running the app, I am getting an error in the lower left corner of the browser. When I open up the error message, I see this:
Webpage error details
Message: 'UserIDValue' is undefined
Line: 92
Char: 1
Code: 0
URI: http://localhost:51035/PhotoAlbum24hrs/PhotoAdmin/ManageCategories.aspx
Here is the web page's Load event (VB) code:
[Code]....
Here is line 92 and the surrounding lines from the page source when I run the app:
[Code]....
This matches what is in Scott's book. (Or else I have been looking at it too long and have missed something.)
If I make the UserId Label visible, I can see the logged in user's ID displayed on the page. So, what is going on here? Why am I getting this error?
View 6 Replies
Feb 12, 2011
[Code]....
I am retrieving records from database nearly 380 records and binding them to a repeater control.My page is taking long time to load. how to improve the performance and here is the code of my repeater.
View 1 Replies
Apr 5, 2010
i used these codes. and when i go and run the page and input the details, this message appears on the webpage:
"Format of the initialization string does not conform to specification starting at index 0."
View 1 Replies
Jan 24, 2010
The code I am using is underneath this.
Server Error in '/' Application.
Format of the initialization string does not conform to specification starting at index 0.
Description:
An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
Source Error:
[code]....
View 7 Replies
Mar 3, 2010
In the codes below, I got an error on the 2nd line. The "Connection" string is defined in Web.Config.
What does the Exception Details mean? How to solve the error?
Dim strConn
As
String = ConfigurationManager.ConnectionStrings("Connection").ConnectionString
Dim conn
As
New SqlConnection("strConn")
Dim queryString
As
String =
"SELECT CustomerID, CompanyName FROM dbo.Customers"
Dim adapter
As SqlDataAdapter =
New SqlDataAdapter(queryString, conn)
Dim customers
As DataSet =
New DataSet
adapter.Fill(customers, "Customers")
Exception Details: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
View 2 Replies
Jan 19, 2010
For some reason I have noticed that at run time when looking at my source of my ASP.NET page there are tags being created.
<input type="hidden" name="_VIEWSTATE" id="_viewstate" value="..lots of text.." />
and
<input type="hidden" name="_EVENTVALIDATION" id="_EVENTVALIDATION" value="..lots of text.." />
Why is this and what is it for?
How can I make sure that these are not created?
View 2 Replies
Oct 4, 2010
I have a web page which has about 11 gridviews.Hence the page takes bout 15 seconds to load.The grids are 1 below the other.They are populated at the page load.
I need a solution to reduce page load time. Is there a way,where the gridview loads only if user scrolls to it. I donot want the user to make selection for everytime he wishes to see a gridview. The page should show gridview if its data is bound to it, not waiting for entire page gridviews to get populated.
View 3 Replies
Jan 10, 2011
I have an ASP.net MVC 2 application that runs well locally. However when I move the files to my production server, I get a first time lag of about 30 seconds, I assume this is a first compile. After that the application works fine. Then after about 20-30 minutes of non use, the applications takes another 30 seconds or so to load.
I did try to precompile the code, but there is still a lag during the first load.
Are there any trick to getting the application to work faster on the first load?
I am using ASP.net 3.5, IIS 6 , visual studio 2010, MVC 2.
View 3 Replies
Feb 9, 2011
In a page load routine I put items in a listbox. I only want to do this one time. I have the following code which works but I'm thinking there's a better way to do this.
if HiddenField.Value = 0 then
HiddenField.Value = 1
other stuff
end if
View 2 Replies
Aug 28, 2010
My question is that how to maintained page load time in c# and what page time load is good for site to crawl google index
View 1 Replies
Apr 14, 2010
I want to create a page with 4 UpdatePainels but when this page loads in the browser only the first UpdatePanel will load and others will be hidden. This others will be load when I click on the buttons located on the first UpdatePanel. My intention is that the page doesn't load entirely at once, just when I click on the buttons. How can I do this?
View 2 Replies
Dec 18, 2010
I have a problem of image loading. My site contains around 20 images on home page. It will take to much time to load.
So is there any code in asp.net framework 3.5 that will reduce the load time without jquery or javascript.
View 2 Replies
Oct 29, 2010
I am having a Gridview which takes much time to load its data, I tried to make the loading faster by implementing paging in gridview and reducing the rows to render in the grid and it got worked to an extent but still it lags in processing to bind data. The database i am using is SQL Server 2005 and the code is as follows
DataTable dtProducts = objProducts.GetProductDetails(iCat.ToString(), userId);
dgrdProductList.DataSource = dtProducts;
dgrdProductList.DataBind();
public DataTable GetProductDetails(String CatID, String UserID)
{
DataAccess DAB = new DataAccess();
DataTable dtbProducts = new DataTable();
try
{
string SQL = "select *,CAST(ShortDescription AS varchar(200)) AS ShortDescriptionList from vw_products where IsActive=1 AND CategoryID = " + CatID +
" AND LanguageID in( SELECT PW_UserLangRel.LanguageID FROM PW_Language INNER JOIN " +
" PW_UserLangRel ON PW_Language.ID = PW_UserLangRel.LanguageID WHERE PW_Language.IsActive=1 AND PW_UserLangRel.CompanyID=" + UserID +
" ) Order By ID Desc,LanguageID";
dtbProducts = DAB.Fill(SQL, CommandType.Text).Tables[0];
}
catch (Exception ex)
{
throw new Exception(ex.Message + "WebShopPaolo.CProducts.AddProductImages");
}
return dtbProducts;
}
View 1 Replies
Dec 9, 2010
I designed a multilanguage site. When I click languages at home, but the remaining pages does not change the language at the same time (not related to the database, just change the text of the controls). What function should I use to load all of the project.
View 4 Replies
Apr 9, 2010
For some reason it takes 7 seconds to open a connection to a sql server database for the firt time, subsequent connections takes a second.
I'm using C# and asp.net
Its after compilation, i essence every time i restart the site, which means every time it needs to actualy create the "first" connection. i understand that setting up connection pooling has overhead, but i have never seen that i should take 7 second to set it up.
View 3 Replies
Aug 4, 2010
My website has 500 *.dll in bin folder. I write a page with only one TextBox At aspx file.and cs code as below. After iisreset , it costs a long time to open the page.The trace log show itspend much time between Begin PreRender and End PreRender. Please tell me why it takes so long ?
cs code:
protected void Page_Load(object sender, EventArgs e)
{
RegularExpressionValidator _regularExpressionValidator = new RegularExpressionValidator();
_regularExpressionValidator.EnableClientScript = true;
_regularExpressionValidator.Display = ValidatorDisplay.None;
_regularExpressionValidator.ControlToValidate = "TextBox1";
Page.Form.Controls.Add(_regularExpressionValidator);
}
trace log:
aspx.page Begin LoadComplete 0.000986438220500092 0.000158
aspx.page End LoadComplete 0.00100739060411309 0.000021
aspx.page Begin PreRender 0.00102359378077381 0.000016
aspx.page End PreRender 16.6258622255063 16.624839
aspx.page Begin PreRenderComplete 16.6259253620223 0.000063
.net framework 2.0
View 2 Replies
Jun 30, 2010
How to decrease the page load time in ASP.NET application? What should be the precautions and specially when we are interacting with databases
e.g.
wise use of viewstate
Set in web.config when deploying the app
etc
View 9 Replies
Jan 22, 2011
find page load time,i want to put some progress gif or animation untill the fully page load with all it content
for example.....u have familiar with facebook or orkut u will find some progress animation untill the all data content load
Is there any other way by not using updatepane...ajax
View 7 Replies
Oct 4, 2010
I have tested my pages in Firefox & IE and looking at Firebug in Firefox for some reason some images are taking a long time to load. They are not very big in comparison to the ones which are loading quicker.
Attached is a screenshot of Firebug.
I especially notice it in IE with the progress bar at the bottom of the page, it just sits there saying loading image...
Could it be the path or something which is http://localhost:49211/Content/_layout/images/bg-footer.png for example
View 2 Replies