asp.net

Making a SOAP Web Service call using a WebRequest

We have an ASP.Net web application which calls Web Services deployed in the same virtual directory. The call returns without any problem in the development machine. But when deployed to the production server, it gives back a '400 Bad Request' error. The call was made by creating a WebRequest and setting the SoapAction header and then W...

change physical path for virtual directory or site in IIS using command line for IIs6 or IIs7

I need to implement some versioning for deployment for the app I support where I can copy the site to say c:\inetpub\wwwroot\app_v2 and then switch the virtual directory from c:\inetpub\wwwroot\app_v1. Is there a way to change the physical path for a virtual directory in IIS from the command line? Edit: i found that in IIS7 you can ...

Why does ASP.NET re-compile (re-JIT) everything when only one thing changes?

I have an ASP.NET 2.0 application (installed on IIS 6.0 from an MSI) which was compiled as a "web site", and precompiled/packaged using a web deployment project, in Visual Studio 2005. (I have put in a request to the developers to consider changing to a web application for the next version, but it won't change for this version). Whenev...

How to stop CompositeControl TabIndex property from setting tabindex on container span

I wrote a custom server control that inherits from CompositeControl. When the control is instantiated, I am dynamically adding a TextBox to its Controls collection. I have overridden the TabIndex property so that when it is set, it applies the value to the TabIndex property of the child TextBox control. The problem is that when the Co...

Firing the JQuery Dialog using an ASP.NET Button?

I have a Page which has a Control on it with 2 textboxes (username and password) and an asp:Button. If the user's membership is going to exipre within 30 days and the button is clicked, I want the JQuery dialog to popup. Inside the JQuery dialog, I have some text and an asp:LinkButton. The link button has an event attached to it, but ...

How do you use ASP.NET Cache object in a not ASP.NET application ?

I'd like to use System.Web.Caching.Cache object in my application, but this code throws a NullReferenceException. Cache cache = new Cache(); cache["key"] = new object(); Any ideas ? Update HttpRuntime.Cache solve my problem but does somebody has a solution to use multiple instance of cache in my application ? ...

printing Problem Through Crystalreport Viewer

hi, I'm trying to print a report or export it to pdf file. The CrystalReportViewer binding is ok, but, when I click the Print Button of the NAV, nothing happens, could you help me please? Thanks ...

how to use css control adapters only on specific pages

I found a control adapter for asp.net wizard control. I would like to use it on my website. But I already have a few pages that use wizard controls. I don't want those pages to use the new adapter. Is it possible? ...

Do I have to pay a fee to develop or deploy a .NET application?

I have heard that .NET is not free and that I have to pay Microsoft if I develop a .NET application. Is this true? If so: What do I have to pay? I'm a subscriber to the MSDN via the Academic Alliance (we download a variety of Microsoft Software products for free, like VS2008 and Windows Server 2008). Do I have to pay for the software...

Why won't my SMTP Server send my ASP.NET mail?!

I have an ASP.NET program that sends a confirmation email with the following code: String msgTxt = "My Message"; try { MailMessage message = new MailMessage(); message.From = new MailAddress("[email protected]"); message.To.Add(new MailAddress(emailParam)); message.Bcc.Add(new MailAddress("NPClie...

ASP.NET 3.5.1 GridView in Update Panel requerying on row select?

Hi all, I have a GridView that is bound to an ObjectDataSource, and I am handling the full row select using the standard solution provdided all over of putting this line in the OnRowDataBound(): e.Row.Attributes["onclick"] = this.Page.ClientScript.GetPostBackEventReference(this, "Select$" + e.Row.RowIndex); All of this is working swi...

Disable an image button in gridview

Here is the code: <asp:GridView ID="MyGridView" runat="server"> <Columns> <asp:BoundField Text="Name" DataField="Name" /> <asp:TemplateField HeaderText="Delete"> <ItemTemplate> <asp:ImageButton ID="DeleteButton" runat="server" ImageUrl="~/images/delete.png" CommandName="DeleteItem" Command...

compare all rows in DataTable - identify duplicate records

I would like to normalize data in a DataTable insertRows without a key. To do that I need to identify and mark duplicate records by finding their ID (import_id). Afterwards I will select only the distinct ones. The approach I am thinking of is to compare each row against all rows in that DataTable insertRows The columns in the DataTa...

rules/attr in jQuery validation

I'm trying to add custom validation to a dynamically created control. Can I use .attr() to set a rule for a control? $.fn.addValidationExpression = function(field) { if (field.ValidationExpression != null) { $("#fld"+getFieldIdSuffix(field)).attr("validateExpression", field.ValidationExpression); } return this; }...

How to call a client-side method from an asp.net method?

I have the following javascript: <script type="text/javascript"> function showjQueryDialog() { $("#dialog").dialog("open"); } $(document).ready(function() { $("#dialog").dialog({ autoOpen: false, modal: true, buttons: { "Renew Membership": function() { $(this).dialog("close")...

How do I get just the exceptions from ViewData.ModelState with Linq?

Hi, I wrote the following code to extract out the exceptions along with a string key referencing the property from the ViewData.Modelstate property in ASP.Net MVC. I think it should be possible to do this with a Linq expression but it utterly flummoxed me. var exceptions = new Dictionary<string, Exception>(); foreach (KeyV...

sitemap trimming is not working

Hey guys, I have read up on articles and done a lot of research but this is kicking my butt and it should be easy. I'm hoping its easy to fix. Im trying to trim my sitemap based on roles however the menu control never changes. Sitemap: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/Site...

Pros/Cons to increasing the scope of a repository instance?

The title to this question isn't written very well. Sorry 'bout that. I'm curious what the pros or cons would be to increasing the scope of an object instance within a method to the class level. As a specific example, I have a non-static service class that wraps access to a repository class which is used to manage CRUD activity as w...

MVP on Asp.Net WebForms

I'm not clear about this.... When having a gridview on the View, is the controller who has to set up the Data source, columns, etc? or I just have to expose the DataBinding stuff, fire it from the controller and let the html/codebehind on the view handle all the rendering and wiring up? To be more precise: on the view should I have p...

using hyperlink column in gridview and getting 'does not exist in the current context' error in page_load

HI, I have a HyperLink column in a gridview that when clicked should navigate the user to another page. I pass parameters to the page using a querystring. I am implemeting this action in the grid's onrowdatabound event. here is the code: HyperLink btnDetails = (HyperLink)ea.Row.FindControl("btnDetails"); btnDetai...