asp.net

Prettifying ASP.NET Markup

So, my personal site is running on a custom blog engine that I wrote, and I'm really happy with it. However, it uses a master page, which means that ASP.NET prepends (for no good reason) 'ct100' to all of the id's...For example: <div id='menu'> <ul> <li id="ctl00_homeTab" class="active"><a href="/">Home</a></li> <li id="ctl00...

user is authenticated but Ticket.UserData is missing

I have the following code: if (HttpContext.Current.Request.IsAuthenticated == false) { // this isn't reached so i know user is Authenticated return; } FormsIdentity fIdentity = HttpContext.Current.User.Identity as FormsIdentity; string[] delimitedUserData = fIdentity.Ticket.UserData.Split('|'); // but at this point delimitedUser...

Draggable Columns in ASP.NET GridView

Is there any open source that extends ASP.NET GridView, which allows Column order to be changed after it's rendered, raises a server side event when a Column is Dragged & Dopped ? I should be able to do this myself. I am wondering If there's any already. Also, am just curious How long would it take for you to get this feature implemente...

ASP.NET Ajax: 'PageMethods is undefined' script error on production server (works on localhost)

In a javascript file I'm calling an ASP.NET Ajax PageMethod (ASP.NET 3.5), correctly defined in the page class a static method using the WebMethod attribute. This works on my development machine, but on the production server the PageMethod object is undefined when my javascript function is called (clicking a button). Some debugging info...

Is it possible to use SmtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory on Development Server?

I do not have access to an IIS development server -- only the production one. So, for my development, I have to use the ASP.NET Development Server thats built into Visual Studio. I get Failure to send message when I have the SMTP client configured this way. SmtpClient.Host = "localhost"; SmtpClient.DeliveryMethod = SmtpDeliveryMethod....

"500 Internal Server Error" when adding HttpModule in my Website??

I am having a website (developed in ASP.NET 2.0 (C#)) registered with godaddy.com But when I am adding HttpModule in my web.config as follow: <httpModules> <add type="WwwSubDomainModule" name="WwwSubDomainModule" /> </httpModules> but it gives me "500 Internal Server Error". When I removed the above tag then my website is working f...

using asp.net mvc for REST based endpoint

I'm looking at using ASP.Net MVC as a platform for a REST based Service. I know WCF has built in support for REST services; however, I'm looking at returning multiple types of data depending on the request. I would like the client to request the content type. So if they send text/html for example I would render my model into Html, if t...

Visual Studio 2008 debugger not catching exceptions

I'm working in a new VS2008 installation with an ASP.NET web application project, and for some reason it's not catching exceptions at all. Where I used to get the helpful little green popup in the IDE notifying me of an unhandled exceptions and allowing me to examine the values of local variables etc., it now goes straight to the Yellow ...

Bind a DataTable to a gridview and add Edit Capability to the grid

Hello , I want to know the best way about when we want to bind a dataTable generated based on a searchResult to a gridview ( Just for now we want to show one record ) , now how can we add edit-delete capability for this record shown in the gridview ? How many ways do we have for this , I know some but I want to reshape my knowledge , ...

How to allow simple HTML tags in comments or anywhere?

In my web application I am developing a comment functionality, where user's can comment. But I am facing a problem which is I want to allow simple HTML tags in the comment box. HTML tags like <b>, <strong>, <i>, <em>, <u>, etc., that are normally allowed to enter in a commenting box. But then I also want when user presses enter then it w...

ASP.NET/Static class Race Condition?

I have an ASP.NET application with a lot of dynamic content. The content is the same for all users belonging to a particular client. To reduce the number of database hits required per request, I decided to cache client-level data. I created a static class ("ClientCache") to hold the data. The most-often used method of the class is by ...

When to use Request.Cookies over Response.Cookies?

As title really. Do I use response when at a page event (e.g. load) as this is a response from ASP.NET, and request when pressing a button as this is a response going to ASP.NET for processing? Or is there more to it? Thanks ...

IE7: tricks/plugins for seeing all the html on a page?

I'm working on an app that's sort of a bastardization of old and new tech (ASP/ASP.NET). It's all running in IE7. I'd like to be able to right click, View Source and actually see all the html that I'm seeing with my eyes. For example, I have a bit of text in the middle of the page that's in a table. I right click directly on that bit of ...

ASP.NET web forms as ASP.NET MVC

I am sorry for possible misleading about the title, but I have no idea for a proper title. Feel free to edit. Anyway, I am using ASP.NET Web Forms, and maybe this isn't how web forms is intended to be used, but I like to construct and populate HTML elements manually. It gives me more control. I don't use DataBinding and that kind of s...

Advantage of the asp.net from other technology

Do you know what the advantage of asp.net from other technology? ...

Alternatives to Iframe

I have been developing a service that allows users to insert information from my database onto their sites by using iframes. The only problem was that the iframe needs to be resizeable and this is one of the biggest problems with iframes as most people already know, aswell as the fact I can access objects on the parent page from within t...

asp.net DB: How to handle when publishing on webserver?

Should the ASPNETDB be left in default app folder created by Visual Studio when deploying on webserver? I have another DB that is in the mssql data folder, should that be placed in same directory as well? Im not clear on whether it matters one way or the other. ...

Best way to save a Stream to a file in asp.net 3.5?

I have a Stream object that is populated with the contents of an XSD file I have as an embedded resource on a project I am working on like so: using ( Stream xsdStream = assembly.GetManifestResourceStream( xsdFile ) ) { // Save the contents of the xsdStream here... } Within this using block I would like to prompt the user with a Sav...

Linq to Xml: selecting elements if an attribute value equals a node value in an IEnumerable<XElement>

I create an IEnumerable object that just contains the nodes I want from an xml file: IEnumerable<XElement> rosters = XDocument.Load("roster.xml") .Elements("rosterlist") .Elements("roster") .Where(w => w.Element("di...

Html.RenderAction. Why is it not included in MVC RC1?

I am torn between the idea of using Html.RenderAction vs. Html.RenderPartial for partial views. Using RenderPartial means manipulating and passing ViewModel, something I feel is cumbersome. RenderAction is neat and concise in this case but not included for RC1 (included with futures though). Why is it so? Any specific reason? ...