asp.net

CrmImpersonator and IFD

I have an asp.net page which works fine for internal calls to the services, however when used on an externally facing site I just cannot get it to function at all. The CRMImpersonator works ok when accessed internally but when using the IFD interface all I get is a message saying 'Microsoft.Crm.WebServices.Crm2007.CookieAndSoapHeaderAu...

Parsing HTML Fragments

What's the best way to parse fragments of HTML in C#? For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit tests, and I want to...

Is asp.net session information stored in a cookie?

If I write Session["asdf"] = 234; In my asp.net web app, does this mean the client will have a cookie stored on their browser? ...

ASP.NET Ajax: close window after Ajax call?

I'm using ASP.NET Ajax. How can I tell the browser to close the current window after the server call finishes (server-side code)? I managed to do this using the ASP.NET Ajax's ScriptManager method "RegisterDataItem" in the server method (inside a button click handler): sm.RegisterDataItem(ActionLabel, "action:closewindow") and a hidd...

Best way to create a search function ASP.NET and SQL server

I have an SQL database with multiple tables, and I am working on creating a searching feature. Other than having multiple queries for the different tables, is there a different way to go about said searching function? I should probably add that a lot of my content is database driven to make upkeep easier. Lucene will not work for th...

Lucene.net with IndexSearcher/IndexWriter in a Web Application

I'm currently running Lucene.net in a web application and am wondering about the best method, performance-wise. I currently have it set up so that all index writes get processed together in a scheduled process, along with optimizing the index. However for searching - I'm currently opening and closing the searcher per search, which I kn...

Can you rename the App_Code folder?

I realize this would violate convention, but I'm curious to know if you can do this through configuration. Edit: I understand why I wouldn't want to do this. BUT, I do want to understand the internals of this time of project. ...

Leveraging SOAP in Classic ASP

Clarification: this is not about user agent calls to pages, but Classic ASP calling ASP.NET! I have applications that are midway through a transition from Classic ASP to ASP.NET. There are a half million lines of code, so a complete rewrite of everything at once was simply not plausible, or frankly prudent considering that the vast ...

Thumbs up/Thumbs Down Rating Implementation

Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site. However instead of having a generic overall score, we will display the total amount of "thumbs up" and "thumbs down". The overall score will be needed for filtering purposes, such as "sort by...

Is there any CMS better than WordPress or should I roll my own?

I'm developing a small business website and want to give some control over content to the client but also allow myself control over the outputted code. Indeed allow the user to fill in the content gaps while not creating havoc. I'm leaning towards WordPress rather than reinventing the wheel in asp.net, which would be my code of choice,...

Format columns for ASP.Net GridView based on data type.

I have a very simple ASP.Net page that acts as a front end for a stored procedure. It just runs the procedure and shows the output using a gridview control: less than 40 lines of total code, including aspx markup. The stored procedure itself is very... volatile. It's used for a number of purposes and the output format changes regularl...

Testing Functions for ASP.net (The Object Test Bench)

Edit I noticed that the Object Test Bench is a good example of what I'm looking for, but it doesn't seem to work with ASP.net. I always get an error that an instance could not be created. Is there a way to test your functions in ASP.net without needing to create a web page and click on a button. For example, if I create a controller...

Share Styling Between CSS Classes

In this question, I was given a really cool answer to alternating an image and its description between left and right, respectively. Now I want to apply styling to both, e.g. padding-top, padding-bottom etc. How do I apply a style to both the RowStyle and AlternatingRowStyle in this scenario. <AlternatingRowStyle CssClass="ProductAltIt...

wsdl.exe results in "SOAP 1.1 binding was not found"

Hi all, I'm trying to implement an HTML Parsing web service as described in Chapter 23 of ASP.NET Unleashed (1st ed.) and this MSDN article. So far, so good! However, I do get an annoying warning when using wsdl.exe to generate the class: Microsoft (R) Web Services Description Language Utility [Microsoft (R) .NET Framework, Version ...

GridView/ObjectDataSource inside runat=server container does not bind

I've got a small web form with 2 radio buttons, call them PickFromList and EnterValue. When PickFromList is checked I want to show a GridView that I've configured to bind to an ObjectDataSource. When EnterValue is checked I want the GridView to disappear. This form is laid out using a table and want to hide/show the appropriate rows b...

Howto? Parameters and LIKE statement SQL

I am writing a searching function, and have thought up of this query using parameters to prevent, or at least limit, SQL injection attacks. However, when I run it through my program it does not return anything: SELECT * FROM compliance_corner WHERE (body LIKE '%@query%') OR (title LIKE '%@query%') Can parameters be used like this? or ...

How do I use an asp.net user control in another user control?

I have a user control (gallery.ascx) and I want to use the photo.ascx control in the gallery control. I've added this register at the top of gallery.ascx, but it still can't find photo: <%@ Register TagPrefix="ssctrl" TagName="photo" Src="controls/photo.ascx" %> Any ideas? ...

Changing the name in the header for a resource handler in C#

I have a resource handler that is Response.WriteFile(fileName) based on a parameter passed through the querystring. I am handling the mimetype correctly, but the issue is in some browsers, the filename comes up as Res.ashx (The name of the handler) instead of MyPdf.pdf (the file I am outputting). Can someone inform me how to change the n...

Design Question - Control Array

Ok, I know how to do this, but I want to know if this is the BEST way. I have a table called "Topics" which has a list of topics(obv). I have a page with about 20 (+/-10) check boxes with all the different topics a user can subscribe to. I figured the best way to do this is to make a control array of check boxes and populate it on page...

Validate QueryStrings in ASP.NET

Hi, Is there a library out there which I can use in my current ASP.NET app, to validate queryStrings? Edit ~ Using Regex to look for patterns, like string, only, numeric only, string with length x,...etc Thanks ...