Garbage Collection Of Strings Returned From C# Method Calls In Ascx Pages
Mar 18, 2010
For a web application developed on ASP.NET, we are finding that for user control files (ascx) we are returning long strings as a result of method calls. These are embedded in the ascx pages using the special tags <% %>When performing memory dump analysis for the application, we find that many of those strings are not being garbage collected. Also, the ascx pages are compiled to temporary DLLs and they are held in memory. Is this responsible for causing the long strings to remain in memory and not be garbage collected ?
I just having some query regarding Garbage collection. when this would be performed. It sense that whether it would be called while executing the each page or some other time.?
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?
I would like to store a collection of strings in the web.config. This collection would vary in size over time. I would like to be able to pull all of the strings in the collection into an array or collection in code. (.Net 4, asp.net) i.e.
I could use appsettings with the strings all in one value but I would like to seperate it out for organizational reasons. Not using the key/value pair complicates things a bit. I am now getting a message that states "you can't have duplicate elements in a section"
List<ReservationSlotLimitDetailEntity> sorted = (from p in slotLimitCollection.OfType<ReservationSlotLimitDetailEntity>() where p.DayOfTheWeek == dayOfTheWeek select p).ToList<ReservationSlotLimitDetailEntity>();
I want to sort in such a way so that it will add on more temp column "DayName" based on condition such that if dayOfTheWeek==1 DayName=Monday and if dayOfTheWeek==2 DayName=Tuesday and so on.
m hoping someone might know what's going on with this issue.I have a directy called _controls where I store all of my .ascx pages for use in my site.I have a master page that has a link to my .css file for the whole site.The individual .aspx pages are reading the style sheet with no issues. But the .ascx pages keep flagging the class as undefined in the code view, and when I execute them on the actual site, the style doesn't take effect.I have a theory. Because I have the link in the master page defined as
"/Public/ASP.css"
the _controls directory .ascx files aren't linking properly. Any one run across this before?
I am relatively new to asp.net. In My asp.net website, i have a method GetData(int id) which is called Repetitively, depending on id count, GetData is desinged to get data from sharepoint and sql server both. if the Id count is high say =10, my page load time increases because GetData is called 10 times and the page load time keeps adding up. so I want to ask, is there any way that this GetData() be called asynchornously or by the use of some thread, so that my page loads faster.
I would like to put a login.ascx on all pages. I would like if I write in my datas with error the usercontrol shows the error and stays on the same page.
i have an instance of ObjectDataSource with specified update method. But on update i have an old values(previously set in gridview) in method - they are not updating.
I'm struggling with renderaction, the problem is that it calls the wrong action method on my controller.On my "Users" controller there are two action methods called edit, one for get and one for post requests:
public virtual ActionResult Edit(int id) { //return a view for editing the user
Token A^*!%~Token B^*!%~Token C^*!%~Token D^*!%~Token E
Write a method that parses the string into a series of substrings where the delimiter between the substrings is ^*!%~ and then reassembles the strings and delimiters into a single new string where each of the substrings is in the reverse order from the original string. The method must return the final string. The expected output would be:
Token E^*!%~Token D^*!%~Token C^*!%~Token B^*!%~Token A
So I've got my jquery autocomplete 'working,' but its a little fidgety since I call the webservice method each time a keydown() fires so I get lots of methods hanging and sometimes to get the "auto" to work I have to type it out and backspace a bit because i'm assuming it got its return value a little slow. I've limited the query results to 8 to mininmize time. Is there anything i can do to make this a little snappier? This thing seems near useless if I don't get it a little more responsive.
I have AutocompeteExtender control in my page.it calls web method (in webservice) that have no parameter I have two web methods in webservice Method 1Geist(string PreText, int Count){....}Method 2GetList(){.......}ethod 2 calls.I want to call method 1.
In my application at some places we have used ObjectDataSource and at other normal method calls to retrieve data.My question is then what exactly are the benefits of using ObjectDataSource ?In the example below "CODE ONE" makes a call to the Business Layer and then Binds the results to the Grid abd "CODE TWO" is using ObjectDataSource to do the same.Then how is ObjectDataSource better?
SuitableApplicant sa = new SuitableApplicant(); IList<HD.Recruitment.SuitableApplicant> list = new List<HD.Recruitment.SuitableApplicant>(); list = HS.Recruitment.RecruitmentService.GetSuitableAppls(); GridView1.DataSource = list; [code]....
I have several labels in my application, and I need to manipulate every single one of them. So, I thought the easiest way would be to simply call the manipulating C# method from the aspx page when needed, but oh, I was wrong. I have spent a couple of hours now trying to figure out how to do this, but I have not come to a solution ..
protected string ManipulateLabel(string label) { return label+" some value"; }
I do not wish to assign each label to value directly from code behind (normally I would do it like this but this time there are so many labels that need a manipulated value that it simply would be too hard updating the application in the future).
When using the code behind, the application simply prints "<%= ManipulateLabel("Information") %>" on the page, which is not what I want :( Also, if I use:
It is working correctly...But It is not showing error message.So how to show the error message that is returned from the above condition ValidateField()...If the condition not satisfied i want to show a error message like length should be greater than or equal to minimum length and so on ..
I have a master page with a ascx control I use for a header. There is a label in HeaderControl1 I need to set from the content pages. I was able to make the changes in the master template as a tes by just calling the control and accessing the property.
I have a gridview control with delete asp:ImageButton for each row of the grid. What I would like is for a jquery dialog to pop up when a user clicks the delete button to ask if they are sure they want to delete it. So far I have the dialog coming up just fine, Ive got buttons on that dialog and I can make the buttons call server side methods but its getting the dialog to know the ID of the row that the user has selected and then passing that to the server side code. The button in the page row is currently just an 'a' tag with the id 'dialog_link'. The jquery on the page looks like this:
The dialog itself is just a set of 'div' tags. Ive thought of lots of different ways of doing this (parameter passing, session variable etc...) but cant figure out how to get any of them working.Any ideas are most welcome
We are developing a framework which will be shared accross applications. What is the best way to share master pages, user controls accross applications by preventing other developers to modify the master pages and the user controls ?
Is the following way suitable one ? Embedding masterpages and the user controls in a dll and using VirtualPathProvider to load the master pages and user controls dynamically.
But in this approach developers can not view the design. Is there any other way to convert master pages and user controls to a different format as developers can able to view design?
I'm using forms authentication in my C# based web site, with the authentication defined in web.config files in the various folders/sub-folders. I want to write a generic administration menu system, that lists all of the admin pages that the use is authorized to open. As I add pages, I want them to automatically show up in the menu. I need to obtain a list/collection of all pages that the active user is authorized to open. Is this possible in ASP.Net 3.5?