asp.net

How to preserve value of dynamic created gridview column.

Hi, I have created all gridview column dynamically and column also exists checkbox. Issue with gridview is its not preserving dynamic created column value. For example if i have selected few row through checkbox column and clicked on button to get all selected row id. As page post back the grid becomes empty with no data value. Any hel...

Setting the src attribute of an IFrame to data:application/pdf;base64?

Setting the src attribute of an IFrame to data:application/pdf;base64, isn't working for me, any ideas why? Here's the .aspx markup <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <sc...

Asp.Net MVC - Odd Form / Controller issue

I have a really odd issue with ASP.Net MVC. I have a form, which is posting 3 text values to an action method called create user (for simplicity sake, say it is the following); public ActionResult CreateUser(string FirstName, string LastName, string Email) { var s = FirstName + LastName + Email; return RedirectToAc...

How can I create a subdomain in asp.net?

How can I create a subdomain in an asp.net C# application? I am working with an asp.net portal. In that portal I need to be able to create the subdomain at runtime. The ftp for that subdomain also needs to be the same as the main domain ftp. ...

The RSA key container could not be opened.

Trying to setup web.config encryption on a Win2K3 server. I can encrypt fine, but when I load the aspx page I always get the exception "The RSA key container could not be opened." which is certainly a permissions issue. I've used the command line tool to grant NT Authority\NetworkService permissions to the container. I've even gone so...

Problem passing JSON data using jQuery $.ajax() to .NET MVC Action w/ custom BindingModel

I am trying to pass JSON data from the client browser to an ASP.NET MVC Action using jQuery $.ajax() and bind it to a .NET class using a custom ModelBinder. THE CLIENT JAVASCRIPT: $('#btnPatientSearch').click(function() { var patientFilter = { LastName: 'Flinstone', FirstName: 'Fred' }; var jsonData = $.toJSON(patientFi...

Problem finding a control within a FormView from code-behind

Here the code behind... I'm trying to retrieve this control so I can add items to the drop down list (I'm retrieving the Role Groups to add to the drop down list in the code-behind) Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim DDRoleGroups As DropDownList DDRoleGroup...

RegEx Expression Help

Hello, I need a regular expression that will not let someone continue to check out if the type in the word 'box' or 'Box' or 'BOX' followed by numbers. Both conditions have to be met for this to work, the word box and the numbers not one or the other. Does anyone know how to write this? EDIT: Hey guys, I've tried a few and the problem...

Not tracking C# designer-generated code: refuses to generate with clean checkout

In our ASP.NET MVC project we have a Strings.resx file and the accompanying autogenerated Strings.Designer.cs file. Tracking the Strings.Designer.cs file in source control creates a bunch of ugly merge conflicts and it's autogenerated anyway, so we decided to untrack it (remove it from source control and ignore the local copy of the fil...

ASP.NET virtual directory _within_ VS2008

I'm building an ASP.NET 3.5 web application. When I run the project (using Visual Studio's built-in server), it needs to be able to access a network share as a virtual directory. I can't seem to find any information about how to do this. The network resource is very large, is updated frequently, and is used by other developers and in ot...

AJAX implementation for ASP and ASP.NET hybrid

A little setup: Our shop has a mixture of different platforms. Almost all of our web development is done in classic ASP. We have a WinForms application in development that is being written using the .NET 3.5 framework. The problem: I am writing a webservice for updating information to this enterprise application. Most of the classes an...

How to create a database driven login system

I want to create a website that the login system shouldn't be handled by cookies, but on (a) table(s) in the local (on the server) SQL DB. Is there a way to do it? Even no partial way? What and where should I save instead of the cookie??? ...

Custom SiteMapProvider derived from XMLSiteMapProvider : How to load an xml document directly in BuildSiteMap()

We have a requirement to load a different XML sitemap for each user that logs in. This sitemap can come from a variety of sources (webservice, database, file) and has to be loaded at runtime. I have designed it thus: When a user logs in, the custom XML for that user is fetched and put into Session. In the BuildSiteMap() method of my cus...

asp.net: send an object's event from a UserControl to its Parent

Hi, I have a User class with functions to Login() and Logout() and GetData(). There's a UserChanged event, it fires when either of these functions are called. I have UserControls on my Default.aspx (they're added dynamically). I have a UserControl named Login.ascx. It provides the functionality to use the User class: you can Login / L...

Alternative to Office Interop for document generation

At the moment we're using office interop to generate documents from templates in office 2003 (word, excel & powerpoint). This seems to be rather frowned upon (see office-interop-with-64bit-windows-in-asp-net) and whilst it works fine I would be happier with a supported solution. What non hacky method is there to do this? Requirements ar...

Should I always call Page.IsValid in ASP.NET WebForms C#?

I know to never trust user input, since undesirable input could be compromise the application's integrity in some way, be it accidental or intentional; however, is there a case for calling Page.IsValid even when no validation controls are on the page (again, I know its bad practice to be trusting user input by omitting validation)? Does ...

Can I programmatically add a linkbutton to gridview?

I've been looking through some similar questions without any luck. What I'd like to do is have a gridview which for certain items shows a linkbutton and for other items shows a hyperlink. This is the code I currently have: public void gv_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Da...

jQuery AJAX slow in Firefox, fast in IE

I'm using jQuery to post to an ASP .NET Web Service to implement a custom auto-complete function. The code works great, except it's slow in FireFox (can't get it to go faster than 1 second). IE is blazing fast - works great. I watch the post in Firefox using Firebug. Here's the service code: <ScriptService(), _ WebService(Namespace:="h...

Storing data for client-side export. I've got a mess.

Here's my situation. I'm developing an ASP.NET (2.0) app for internal use. In it, I've got a number of pages with GridViews. I've included an option to export the data from the GridView to Excel (client-side using Javascript). The Excel workbook has 2 tabs - one tab is formatted like the GridView, the other tab contains the raw data. Eve...

How do I pass login ID as parameter to SharePoint login page?

I have an ASP.NET home page where user provides his login ID. Depending on the application (SharePoint Site) the ID is associated to- the user is directed to the respective sharepoint site. For example, if user is site1user, the ASP.NET page directs the user to sharepointsite1. I got it working this far. Now, how do I pass the login...