asp.net

How to Call a method via AJAX without causing the page to render at all?

I am working with ASP.net. I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net. What would be the easiest way to accomplish this. I have looked at PageMethods which for some reason are not working and found...

Can a LINQ to SQL IsDiscriminator column NOT inherit?

I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have two types of pages: normal and root. Some pages are roots. Some pages are not. I have a Page database table and a RootPage database table: Page ---- PK PageId HtmlTitle PageHeading MetaDescription IsRoot R...

What is the best data access paradigm for scalability?

There are so many different options coming out of microsoft for data access. Which one is the best for scalable apps? Linq Should we be using Linq? It certainly seems easy but if you know your SQL does it really help. Also I hear that you can't run Async queries in ASP.NET using Linq. Therefore I wonder if it is really scalable? Are th...

Passing data between a parent app and a virtual directory

I have an application that runs as a child application in a virtual directory. I want to pass a value from the parent application, but I believe that Session is keyed per application, and won't work. To further complicate things, the parent application is WebForms, while the child is NVelocity MVC. Does anyone know a trick that allows...

How To Generate A Javascript File From The Server

I'm using BlogEngine.NET (a fine, fine tool) and I was playing with the TinyMCE editor and noticed that there's a place for me to create a list of external links, but it has to be a javascript file: external_link_list_url : "example_link_list.js" this is great, of course, but the list of links I want to use needs to be generated dynami...

MVC Retrieve Model On Every Request

Let’s say I'm developing a helpdesk application that will be used by multiple departments. Every URL in the application will include a key indicating the specific department. The key will always be the first parameter of every action in the system. For example http://helpdesk/HR/Members http://helpdesk/HR/Members/PeterParker http://help...

Is inline code in your aspx pages a good practice?

If I use the following code I lose the ability to right click on variables in the code behind and refactor (rename in this case) them <a href='<%# "/Admin/Content/EditResource.aspx?ResourceId=" + Eval("Id").ToString() %>'>Edit</a> I see this practice everywhere but it seems weird to me as I no longer am able to get compile time errors...

Best Practice for Creating Data Tables Without Controls in ASP.net

So, I am kinda new to ASP.net development still, and I already don't like the stock ASP.net controls for displaying my database query results in table format. (I.e. I would much rather handle the HTML myself and so would the designer!) So my question is: What is the best and most secure practice for doing this without using ASP.net cont...

DefaultButton in ASP.NET forms

What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms? ...

How can you tell if viewstate in an ASP.Net application has been tampered with?

During a discussion about security, a developer on my team asked if there was a way to tell if viewstate has been tampered with. I'm embarrassed to say that I didnt know the answer. I told him I would find out, but thought I would give someone on here a chance to answer first. I know there is some automatic validation, but is there a way...

Visual Studio basicHttpBinding and endpoint problems

I have a WPF application in VS 2008 with some web service references. For varying reasons (max message size, authentication methods) I need to manually define a number of settings in the WPF client's app.config for the service bindings. Unfortunately, this means that when I update the service references in the project we end up with a m...

Reading Body on chunked transfer encoded http requests in ASP.NET

A J2ME client is sending HTTP POST requests with chunked transfer encoding. When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded. However, when I read the Request.InputStream to the end, it returns...

How do you test cookies in MVC .net?

http://weblogs.asp.net/stephenwalther/archive/2008/06/30/asp-net-mvc-tip-12-faking-the-controller-context.aspx This post shows how to test setting a cookie and then seeing it in ViewData. What I what to do is see if the correct cookies were written (values and name). Any reply, blog post or article will be greatly appreciated. ...

What are the best books (maximum 3) on Microsoft 'Visual Web Developer 2008 (Express)'?

What are the best books (maximum 3) on Microsoft 'Visual Web Developer 2008 (Express)'? ...

Drawing a Web Graph

I'm trying to draw a graph on an ASP webpage. I'm hoping an API can be helpful, but so far I have not been able to find one. The graph contains labeled nodes and unlabeled directional edges. The ideal output would be something like this. Anybody know of anything pre-built than can help? ...

DropDownList doesn't postback on SelectedIndexChanged

I'm writing an ASP.Net webform with some DropDownList controls on it. Then user changes selected item in one of dropdowns, ASP.Net doesn't seem to handle SelectedIndexChanged event until form is submitted with a 'Submit' button click. How do I make my dropdowns handle SelectedIndexChanged instantly? P.S. It's a classic question I have a...

When should you use standard html tags/inputs and when should you use the asp.net controls?

As I put together each asp.net page Its clear that most of the time I could use the standard html tags just as easily as the webforms controls. When this is the case what is the lure of the webforms controls? ...

ASP.NET Custom Control Styling

Hi There. I am in the process of beginning work on several ASP.NET custom controls. I was wondering if I could get some input on your guys/girls thoughts on how you apply styling to your controls. I would rather push it so CSS, so for the few controls I have done in the past, I have simply stuck a string property which allows you so ty...

Does anyone know of a way of hiding a column in an asp.net listview?

I know you can put <% if %> statements in the ItemTemplate to hide controls but the column is still there. You cannot put <% %> statements into the LayoutTemplate which is where the column headings are declared, hence the problem. Does anyone know of a better way? ...

Exclude certain pages from using a HTTPModule

Is there a good way to exclude certain pages from using a HTTP module? I have an application that uses a custom HTTP module to validate a session. The HTTPModule is set up like this in web config: <system.web> <!-- ... --> <httpModules> <add name="SessionValidationModule" type="SessionValidationModule, SomeNamespace" /> ...