asp.net-2.0

jquery script not working after postback even with pageLoad

Hi all, I've got some trouble with JQuery script on my Asp.net page. During first load it works well, after postback it does not. Initiali I thought that it is because script is not load again, but alert told me that script runs as I use function pageLoad() instead of $(document).ready(function(). In script I just read value from one ...

Is there any way to modify query strings without breaking an ASP.Net postback?

From reading here and around the net, I'm close to assuming the answer is "no", but... Let's say I have an ASP.Net page that sometimes has a query string parameter. If the page has the query string parameter, I want to strip it off before, during, or after postback. The page already has a lot of client-side script (pure JavaScript and j...

How do I link to an ASP:DetailsView's Insert mode via an external page

Unlike many of the ASP.NET documentation and examples, I'm doing a gridview list on one page, and it links to a 2nd page to do the edit/update view, sending the ID for the record in the GET string. On my edit/update view, I'm using an ASP:DetailsView for viewing, editing and inserting records. All of this works fine. On the detailsV...

SQL Login failed when enableviewstate = false

Good day, I'm having a problem with asp.net 2.0 viewstate. Basically, I want to disable the viewstate for a gridview. However, when I do so, as soon as there is a post-back, before even getting into Page_Load, I get a 'Login failed for user sa ...'. If I enable the viewstate back, everything runs smoothly. In PageLoad, I set the conn...

ASP.NET Protected Configuration - How to encrypt with just public key?

When using ASP.NET protected configuration, how can I encrypt the config with just the public key? I can export a public key file. I would like to then use this public key to encrypt the configuration files on another server for later deployment. However, I can't figure out how to get aspnet_regiis to use the exported public key. Bas...

How can I use the URL to set the current culture in ASP.NET 2.0 Web App?

Hi, I am looking in to ways to enable a site to basically have something like: http://mysite.com/en-US/index.aspx` Where the "en-US" can vary by culture.. This culture in the URL will then basically set the CurrentUICulture for the application.. Basically, we currently have a page where the user explicitly clicks it, but some are fa...

Is there any native way in ASP.NET to do a "success message"?

Say you have something like an ASP.NET ASP:DetailsView to show and edit a single record in a database. It's simple to record the error cases... you add validation and a validation summary. When your update form fails validation it naturally makes noise: it shows the validation message and/or the validation summary. Not a single code b...

.NET IHttpHandler and HTTP/1.0

How can I set the HTTP protocol version to HTTP/1.0 in the response of a IHttpHandler? ...

Is Roles.IsUserInRole behaving as expected in the following simple scenario?

In a custom role provider (inheriting from RoleProvider) in .NET 2.0, the IsUserInRole method has been hard-coded to always return true: public override bool IsUserInRole(string username, string roleName) { return true; } In an ASP.NET application configured to use this role provider, the following code returns true (as expected): Ro...

How do I use an ASP.net asp:RangeValidator to validate a date properly?

Here's my code: <asp:TemplateField HeaderText="* License Setup Date"> <EditItemTemplate> <asp:RequiredFieldValidator ID="LicenseSetupDateRequired" ErrorMessage="License Setup Date can't be blank." ValidationGroup="EditClientDetails" ControlToValidate="BeginDate" Text="*!" ...

ASP.NET configuration not attached with the library

I'm working on a solution that has two projects: One ASP.NET web application, and one Custom Web Control library. The custom control library is used in the asp.net application. When I compile the solution, the app.config file of the custom web control library is not transfered with the dll to the ASP.NET apllications bin folder? How can...

Get the source of some website from asp.net code.

Is there any way that I could get the source of a website (as a string preferably), let's say www.google.com, from some c# code inside code behind of asp.net website? edit: of course i mean html code - in every browser you can view it using "view source" in context menu. ...

Capturing HTML generated from ASP.NET

How do I best capture the HTML (in my instance, for logging) rendered by an aspx-page? I dont want to have to write back to the page using Response.Write, since it messes up my site layout. Using the Response.OutputStream or Response.Output's stream results in an ArgumentException ({System.ArgumentException: Stream was not readable.) ...

Data collection methods. (ASP.NET 2.0 - VB)

I'm stumped again on how to proceed with a survey system I am working on. We have database data for matrix sytle questions (rows are various questions, columns are various answer types), where each cell needs to be able hold a different kind of control. We have a database framework for this. The problem comes with how to dynamcially r...

Asp.net session expiry redirect to login page

What is the best way to redirect to the login page when the session expires. I'm using sessionState mode="InProc" Can I set this in the web.config file? ...

Contents not able to be found in an Update Panel?

I have a table for a contact form and this table contains another table which is hidden whether the extended form is desired or not because this control is used on several pages. All of this worked fine until I put an update panel around it. I can see the controls in the code behind and the page builds successfully but when I run it it t...

Learn step by step about Crystal Reports

Hello friends, please suggest how to learn step by step about Crystal Reports. Is there any online e-book? ...

Sending data between an asp.net page and a pop up page?

What are the different ways of communication between asp.net page and a popup page? Query strings etc. Which is most secure? ...

ASP.NET 2.0: Specifying an instance of an object for an ObjectDataSource

I'm using an ObjectDataSource to bind data to a GridView; it works fine except that it always creates a new object to use as a data source. I can do all the setup just fine but I cannot use an instance of an existing object to specify as the "data source" for it. Is it possible to do this? If so, how? If it's not possible, why? ED...

How to submit a form using the Enter key in asp.net

I have 3 buttons in a form. One of them is the submit button. How can I make it the default button to be clicked when I press the enter key. Is there a property for this? ...