asp.net

Redirect to Error page when user clicks the Browser Refresh button

i need to check whether the user clicking the browser Refresh button and redirect to error page. Can we do this in javascript or any server side methods in ASP.net ...

ASP.NET Ajax ErrorSys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server

Hi, I created an Ajax website in Visual Studio, added a simple page with a textbox and button, when I click the button once everything works, when I click it twice I get the error Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the ...

ASP.NET trace level

This question is related to my another question. With trace enabled I can get the following(not quite verbose) trace of a page request: [2488] aspx.page: Begin PreInit [2488] aspx.page: End PreInit [2488] aspx.page: Begin Init [2488] aspx.page: End Init [2488] aspx.page: Begin InitComplete [2488] aspx.page: End InitComplet...

Asp.net Ajax Error

I added the ModalPopupExtender to an existing ASP.NET application. At runtime I get the following error Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Me...

.net 3.5SP1 on a .net 3.0 Server - Is it possible to use the /bin Folder in ASP.net?

One of my Websites is on a Shared Hosting Provider, running either .net 2.0 or .net 3.0, but not 3.5 SP1. I wonder if it would be possible to still use 3.5 SP1 by simply deploying all the 3.5 assemblies into the /bin Folder, since technically it's all still the 2.0 CLR. I know that if my Host ever updates I have to remove them or else ...

Formatting strings in C# consistently throughout a large web application

I'm looking for a consistent way to structure my use of formatting strings throughout a large web application, and I'm looking for recommendations or best practices on which way to go. Up until now I've had a static class that does some common formatting e.g. Formatting.FormatCurrency Formatting.FormatBookingReference I'm not convinc...

The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly

When I run my asp.net app I get the error The type ‘System.Web.UI.ScriptManager’ is ambiguous: I am having the same problem this person is having http://forums.asp.net/t/1313257.aspx , when I change the 1.0.61025.0 to 3.5 and re-compile It resets it to 1.0.61025.0 what I can I do to resolve this. I've been trying to get my app run...

ASP.NET MODALPOPUP dows not execute code

Hi, Wwhen I click the button on the popup to insert data to database, it does nothing, WHYYYYY? <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="popup" TargetControlID="cmdTrigger" PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" OkControlID="btnOk" > </cc1:ModalPopup...

Why are file uploads via Silverlight 2 limited to only .TXT files?

I have a Silverlight 2 app that sends a byte array to a Silverlight-enabled WCF service. However, (unless I try to upload a .txt file) the service's SaveFile() method is never reached and I get an error: "The remote server returned an error: NotFound" Am I missing something really obvious? Why can't I upload .doc files? Why only .txt...

Web page designers

Are there any Web page designing software out there that allow me to drag and drop controls just like desktop applications. I found it quite difficult to design a web page using the designer in Visual Studio 2008 as it constrains me to a flow or grid layout. (I am not an accomplished designer but there should be some ease as one experien...

asp.Net GridView bind custom object with nested List

Hi All, I have a List of custom object, which consist of a custom list. class person{ string name; int age; List<friend> allMyFriends; } class friend{ string name; string address; } I'trying to bind a list of these objects to a GridView and the Grid should create for each friend a column and write the name in it. If some p...

ASP.NET Security Best Practices

What are others ASP.NET Security Best Practices? So far identified are listed here: Always generate new encryption keys and admin passwords whenever you are moving an application to production. Never stored password directly or in encrypted form. Always stored one ways hashed passwords. Always store connection strings in tag of Web.c...

Client Rendering Problem after 'page.' calls

I have tried, 'PreviousPage', 'PreviousPage.IsCrossPagePostBack' 'Page.previousPage', page.title It causes the client to stop rendering the page after this line. simple example protected void Page_Load(object sender, EventArgs e) { response.write("I can see this"); string test = PreviousPage.IsCrossPagePostBack.toString(); //Any page ...

Not using e-mail address in a custom MembershipProvider?

I'm writing a custom MembershipProvider for a legacy database. Users are authenticated by login and password, there is no e-mail attribute attached. What is the best way to "short-cycle" the FindUsersByEmail() and GetUserNameByEmail() methods? My naive approach was to leave them unimplemented, since I assume if there is no need to restor...

How do I get the TotalRowCount from a LinqDataSource into a Literal?

I have a LinqDataSource that I use to calculate the number of rows in a table. I would like to update the value of literal with the number, with the following code, taken from MSDN (linqdatasourcestatuseventargs.totalrowcount.aspx): protected void linqDataSource1_Selected(object sender, LinqDataSourceStatusEventArgs e) { Literal1.Te...

What resources, outside of the Microsoft site(s), are available for learning about Form and MVC web applications?

I've found a few pages (some that even link to a number of other pages) on the Microsoft website that I bookmarked last night for reading today, but I'm curious as to other good non-Microsoft resources for discussing ASP.NET web applications, both Forms and MVC (including comparisons/contrasts between the two). ...

ASP.NET - Hierarchical grid view

Any ideas on how I can acheive 'Hierarchical' gridview? Basically I want when the user clicks on the '+', i "expand" and insert new rows without a full page post back. Does this sound like a lot of AJAX stuff? Or should I read on ASP.NET MVC Please point me in right direction ...

Moving ModalPopup Outside the IFrame. Possible?

I have an iframe inside my main page. There is a modalpopup inside the iframe page. So when the modalpopup is shown, the parent of the modalpopup is the iframe body and the main page parent body. Thus the overlay only covers the iframe and not the entire page. I tried moving the modalpopup from the iframe to the parent windows body elem...

ASP.NET URL validation

We have a custom REST handler on ASP.NET that is configured like this to handle all incoming requests: <add path="*" verb="*" type="REST.RESTProtocolHandler"/> However, passing it a pipe character, properly encoded or not at all, triggers a validation error that seems to come from inside ASP.NET. Accessing http://localhost:8080/%7c o...

Easy way to catch all unhandled exceptions in C#.NET

I have a website built in C#.NET that tends to produce a fairly steady stream of SQL timeouts from various user controls and I want to easily pop some code in to catch all unhandled exceptions and send them to something that can log them and display a friendly message to the user. How do I, through minimal effort, catch all unhandled ex...