|
If you're having performance problems have you tried implementing Caching. ASP.NET from what I can gather has very powerful Caching capabilities.
For instance, you can cache the raw HTML output from the aspx page for a certain duration (10 mins say) so that the page is only being drawn every 10 mins, requests in between are just grabbing the raw HTML output will no database access etc. It's also possible to cache different versions of the same page based on a querystring parameter say (eg. showProducts.aspx?productID=5 ).
Also set Cache dependancies (data expires on certain conditions - database change etc), set timeouts, set delegates that fire when Cache is removed etc. There's loads of stuff you go do with it, too much to list here.
The Cache object can be accessed from almost anywhere it seems, Cache propety from an ASPX page, Context.Cache from the Global.asax, or from the HostingEnvironment class (ASP.NET 2.0 only) from anywhere else, making it extreme flexible to use.
Sunday Ironfoot
www.dominicpettifer.co.uk (work in progress)
|
|
|
|
|
Caching with asp.net is fun, but i actually looking for methods to write fast sites without uing of cache. you always can add caching on optimization phase but it can't help you everywhere when your site is higly personalized and each page is different according to user logged in
Thanks for your reply
and may the source be with you
|
|
|
|
|
We are upgrading our intranet's main page from classic asp to .Net 2.0. Currently there are all three type of web apps on the server, .Net 2.0, 1.1 & asp. The asp classic main page currently uses techniques similar to http://www.eggheadcafe.com/articles/20021207.asp which has worked for a couple of years now. Now we are upgrading the main page to .Net 2.0 and I am having problems finding any solution that works, much less an elegant one that will require minimal change throughout the applications.
Currently I have tried the following with out success:
http://www.asp101.com/articles/sidney/sharingsessionstate/default.asp[^]
which should work and possibly does using .Net 1.1 but not with .Net 2.0.
Microsoft solution, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp[^], fails to work in .Net 2.0 either.
I glanced at this one http://searchvb.techtarget.com/tip/1,289483,sid8_gci951935,00.html[^] but I think it would have the same issue as the previous ones.
With the asp101 & Microsoft's solution, I am unable to transfer any session information from any .Net 2.0 app to another .Net 2.0 or .Net 1.1 app. I am not sure why. I think it might be because I am running on XP and there is no option for application pooling in IIS. I know in IIS on server 2003 you have to create a new pool for .Net 2.0 apps. The actual Session will transfer with both techniques it is just getting the session to the intermediate page, SessionTransfer.aspx.
Process Flow:
ASP.Net page => SessionTransfer.aspx => SessionTransfer.asp => asp page
The trouble I am finding is the ASP.Net to the SessionTransfer.aspx page. The Session.Count value in the SessionTransfer.aspx page is 0.
Any help or link would be much appreciated and resolving this Session issue.
Thanks,
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
What is wrong with this Regex for e-mail?Thank you
Regex emailRegex=new Regex(@"^*@*.*$");
|
|
|
|
|
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
only two letters away from being an asset
|
|
|
|
|
|
How to access textbox control that is placed inside the Iframe control using javascript.
kamalnath
|
|
|
|
|
I have two small queries and hop some one can guide me in right direction
What is the difference between in below two approaches?
1) Get Data Reader and populate the data into data table and close data reader
2) Get data set and use table (0) etc…
I can understand
a) In first case, we have connected environment and not a best approach when having huge data. On the other hand in second case we had disconnected environment.
But if you observe SQL server sp_who, in both cases it keep connection live for sometime. Is it because of Garbage collector mechanism?
Amit
|
|
|
|
|
First off, are you closing your connection.
Secondly, the connection pool will remained cached but the connection itself should not. The datareader should be used where ever possible as it is more efficient then using the dataAdapter to generate a dataset. Check out this article for more information.
http://aspnet.4guysfromrolla.com/articles/050405-1.aspx
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
You must always open and close any connection you make to a database.
Use DataReader when you only want to 'read' from the database, eg select query.
Dataset is used as a 'collector' for information, in memory. By that. A dataset can have more then one table(it's called a DataTable) assigned to it to store information. In ASP.net 2.0 you now get a list object, that replaces the dataset, however you can still use a dataset.
Have a look here:
Dataset vs datareader
|
|
|
|
|
If you are using 2.0 you can have a disconnected reader.
only two letters away from being an asset
|
|
|
|
|
Hi,
I have a master datagrid in an asp.net page. Selecting a record in the master datagrid loads the details datagrid. This worked fine as long as I had both the datagrids on the same asp.net page.
Now I moved the details datagrid to a seperate asp.net page that I included in an IFRAME element in the asp.net page that contains the master datagrid. On doing this I have taken care that when a record is selected on the master datagrid the id is passed to the details datagrid in the IFRAME.
So selecting a record is now properly loading the data in the details datagrid in the IFRAME page.
Both the Master and the Details datagrid have paging enabled.
Now after using the IFRAME I am facing the following problems:
1>
I select the record in the Master datagrid and the Details datagrid loads with paging in the IFRAME. If I click on any of the pages of the Master datagrid, paging has stopped working properly : the postback takes place but the next page is not loaded for the datagrid.
2>
If I click on any page no. of the Details datagrid in the IFRAME I get the following exceptiion:
Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
The paging for the Master Datagrid works fine if I do not have the IFRAME element
The paging for the Details datagrid works fine if I independently load the page with the required params passed.
In case if anyone has faced such a problem before and knows the solution please let me know
Thanks in advance
Sid
|
|
|
|
|
The Iframe's view state will not be maintained. Why do you have to use an Iframe? If you need to refresh only part of the page then use AJAX via the Atlas toolkit or other method. I would stay away from the iframe unless you like headaches.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
hi....i m not understanding wht is happening in these lines....plz help....
<br />
<Script Runat="Server"><br />
<br />
Sub Button_Click(S as Object, e as EventArgs)<br />
enteries.innerHtml=& username.Value & comments.Value & entries.innerHtml<br />
End Sub<br />
<br />
</Script><br />
i m not understanding whts that "enteries.innerHtml".....plz help...right now its like
Regards
Geetika Munjal
-- modified at 8:37 Thursday 14th September, 2006
|
|
|
|
|
|
hey thanks for the reply
i have got my answer
thanks
regards:
Geetika
|
|
|
|
|
Thats Nice.
Regards,
Jay
|
|
|
|
|
Hi
I need to run website on FULL SCREEN. To make it done i wrote a javacript in the First Page (Default.aspx).
<br />
if (window.opener == undefined)<br />
{<br />
window.opener = 'self';<br />
window.open("Default.aspx","","fullscreen,scrollbars");<br />
window.close();<br />
}<br />
This works fine in IE. But fail to run in Full screen for MOZILLA and Netscape.
How to solve it ?
|
|
|
|
|
|
I had create data bases with one table. I add a data connection to the data base from Visual Studio 2005. I drag the table to default.aspx form. When I click on the small arrow in the right of the “GridView Task” I can’t see Enable Deleting.
N.B: I can see the data when I run the project in the default.aspx form.
What is the most case of this problem?
Thanks
|
|
|
|
|
Hi,
I'm trying to make sense of what to do!!
I have the following SQL statement in a stroed procedure:
SELECT
OrderItemID_PK,
WineID_FK,
OrderItemUnitPrice,
OrderItemQty,
OrderID_FK
FROM
OrderItems
WHERE
OrderID_FK = @OrderID;
I only need the wine ID to populate the Wine object. In my DA class I did it like this:
// Do connections and stuff here
while (dr.Read())
{
OrderItem objOrderItem = new OrderItem();
// Populate other fields
Wine objWine = Wine.GetWineByWineID(dr.GetInt32(1)); // Related Wine object
objOrderItem.OrderItemWine = objWine; // Required
}
OrderItemWine is a property in the OrderItem class that sets the Wine object. I declared the Wine object in the OrderItem class like this:
private Wine m_Wine;
And the property that sets this Wine object in the OrderItem class is:
public Wine OrderItemWine
{
get { return m_Wine; }
set { m_Wine = value; }
}
Like this I can retrieve Wine information, now how do I get the wine name into my gridview, if I didn't define a Coloumn as such for the DataField property??
Please help.
Regards,
ma se
|
|
|
|
|
You can try and add a separate function into the datafield template, that calls the name of the wine, using the id you got from the select query, for that specific field.
EG: As the following into your
GetNameForID(wineID) //Id for the wine name you want to add here
or how about using parent/child relationship repeater or datagrid?
|
|
|
|
|
Why not join the table with the wine name in your stored procedure and add the column to you grid???
The other option is to add a template column with a label. Then use the ItemDataBound event of the grid and populate the label via code. However, I would think the first method would be much more efficient and simpler.
//inside the itemdatabound method
DataRowView dr = (DataRowView) e.Item.DataItem;
//something like this
LabelWineName = objWine(dr["WineID_FK"]).name;
Note that if the wine class is make a database call then you are really making a mistake. The join in your original proc would be much more efficient.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks for this, but then what is the use of having class relations?? Or am I missing the plot her??
|
|
|
|
|
Yeah, you are missing the point. With an ASP.Net application all of the server side code has to run between postbacks. In other words 99% of your code is executed in < 1 second of time. How many class objects can you instantiate during that time interval? Not many. Even when I only working with only one database record I usually use a structure instead of class because it has less overhead.
I have been programming ASP.Net applications for 5 years now and have coded about 25 applications. Most of them have only a couple class files, not including our base class.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|