asp.net

Is is possible to determine when an element has been rendered using JavaScript?

Is there a jQuery equivalent to do the following: $(document).ready(function() { for an element: $(a).ready(function() { I have content in an updatepanel and I am calling jQuery UI's .button() on some anchor elements. After the updatepanel refreshed, the anchors are rerendered and lose the UI styling. I already know how to detect ...

What is the best ViewModel naming convention?

I'm writing an asp.net mvc2 project with a lot of views/partialviews. Reading on good MVC practices, I've been encourage to create ViewModels. Its really nice and makes sense to do so but I'm noticing recently that I can no longer easily remember what model is for what view. I'm hoping there is a nice naming convention for ViewModels tha...

How do I resolve the "maximum request length exceeded" exception?

please any one help me when I upload image i had this error maximum request length exceeded ...

Is it possible to run tests using the nUnit framework in a hosted website?

First, let me pledge my allegiance to unit testing over integration testing, I like unit testing very much. But I have other tests that are essentially deployment tests (you can't test how the production deployment went using a unit test on a build server) and I'd like to use the nUnit framework to run these. But, the production server...

asp.net store object class in viewstate (or other ideas)

Hi all, I've build a class like this: private class TestResults { public bool IsAdmitted { get; set; } public bool IsDuplicate { get; set; } public bool IsVerified { get; set; } } The values of this class are set at postback by clicking a radiobutton list. Problem however is I don't know how to save this values across...

Trouble with ASP.NET MVC SelectList with IEnumerable<DateTime>

As usual, having trouble with SelectList in the MVC framework. The selected value is never set for some reason: public class MyViewModel { public DateTime? SelectedServiceTime { get; set; } public IEnumerable<DateTime> AvailableServiceTimes { get; set; } public SelectList ServiceTimesList { get { ...

How to get my dropdown to default to first row name in table

Edit: more code Dim oControl As New Forms.Control() Using types As New DataSet With oDal .Parameters.Clear() .Execute(sql, types) End With Wi...

.NET UpdatePanel + LiveQuery

I have used LiveQuery to detect when an element is added to the page. The element is inside an .NET AJAX UpdatePanel. When the UpdatePanel is refreshed, live query does not detect the new element. <asp:UpdatePanel runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="refresh" /> </Triggers> ...

Will code in finally run after a redirect?

Take for example the following code: try { Response.Redirect(someurl); } finally { // Will this code run? } Will the code in the finally block run? ...

IIS7 application using wrong SQL Server 2008 Express database

I'm stumped. I have a client site on a virtual private server - Windows Web Server 2008 SP2, IIS7, SQL Server 2008 Express. I'm trying to setup a second web application, to allow him to review updates prior to their going live. I've created the web application in IIS7, and I have added a second database to SQL Server. The second db i...

Asp.net mvc client side validation - show errors in the same div

How do I list all generated errors in the same div? Something like this: <div id="errors"> <ul> <li>Email is invalid</li> <li>Firstname is required</li> </ul> </div> ...

Run method on server without Refreshing

Hello, I know how to use UpdatePanels and so on but I would like to know if its possible to run method on the server (after clicking a button) which doesnt change anything in controls on the site but for example updates database. I know that I can use WebService but is there any way to use simple code behind methods ? thanks for help ...

How to call UserControl javascript when parent page submits to server?

Hi I have an asp.net usercontrol located on on my aspx page. In the usercontrol there is a javascript function that I would like to fire everytime the page that contains the usercontrol submits to the server. (directly before this happens) Ideally I prefer to not have to write any code in the parent to make this happen, but I am not sur...

Is it possible to modify the default outputcache settings

I'm trying to do something similar to this question, I have a multitenant application and want to configure the output cache to be per tenant. However i'd rather not have to use a custom outputcacheattribute or have an outputcache profile and remember to use this everywhere. Is it possible to change the default outputcache profile setti...

MVC ASP.net session is null

I have the following code which was ok until someone else put some other code in the site which sorta mucks it up now. This is my code: var existingContext = HttpContext.Current; var writer = new StringWriter(); var response = new HttpResponse(writer); var context = new HttpContext(existingContext.Request, response) { User = existingCo...

Custom thread started in Application_Start

I have to deal with legacy ASP.NET application written in .NET Framework 1.1. When checking the application code I found interesting part. The application starts custom thread in Application_Start event handler (Global.asax). This thread must run whole life of the application. Long time ago I read that this should be never used but I do...

I am trying to hide text in a ASPX page that is tied to a textbox

So there is a a table and a text box in one of the cells <td> <asp:TextBox ID="tbSomeTextBox" Columns="5" runat="server"> % </td> This textbox gets shown if a certain selection is made in a drop down. The problem is that I would like the "%" character to also be hidden or shown with the textbox. I have tried putting the whole t...

ASP.NET MVC Areas

I want the follow URLs in my MVC application: /Admin/Accounts/Groups and /Admin/Accounts/Users I know i could create an area named Admin,and then create Groups and Users controllers inside that area. Can i create "nested areas" to accomplish that full URL above? i.e: An area Admin,and inside this area another area named Accounts? ...

IE 7 with Webforms and Proxy Server

I have started having problems with our asp.net webform applications running behind a proxy since the user base have upgraded to IE7. Some postbacks seem to drop out and at times it is difficult to make controls on a page raise an event. It appears to be intermittant and I have been told there are issues around using IE7 behind a proxy w...

Is it ok to call Powershell from an ASP.Net process

Is there any problems with creating a powershell runspace in an asp.net application and running commands? I have a basic example working fine but I'm wondering if there are any pitfalls waiting for me. I'm particularly wondering: Is this an a light-weight inprocess operation or is it firing up another processes that could lead to unp...