asp.net

Prevent special characters in a TextBox

I want to prevent users from entering url's (like a href="") in a TextBox. I want to use a regular expression validator but no idea what to write? How can I do it? ...

AyncFileUpload cannot load png file

I have asp.net project that uses an AsyncFileUpload to allows user to upload local files to a database. I occasionally have a problem uploading files getting a message "Server Response Error unknown server error. Do you have to see the response page", I click Ok get Unhanded exception message and it repeats Server Response Error unknown ...

IIS7 doesn't seem to like <soapExtensionTypes>, what's the alternative?

I'm essentially logging errors to ELMAH in the same way as this SO answer suggests but initially I got an error from IIS suggesting the setting wasn't used and then when I cleared up the error (by turning of legacy config validation) my hooks don't appear to be called. HTTP Error 500.22 - Internal Server Error An ASP.NET setting has bee...

How to disable filemonitoring on IIS using c# code

I have found a code snippet as given below which is used to disable file monitoring (file change notification) on IIS server, but the code is not working as expected. The monitor object below is getting NULL value. Not sure if there is some more additional code required or any other settings required. Can anyone suggest why this could b...

What alternatives exist for Data Generation Plans for Visual Studio Express users?

I'm wondering if there is a good option for those of us using Express (or even Professional) editions without having to go outside the Visual Studio project (i.e. writing a ruby/perl/etc script to populate test/seed data). If it helps I'm working on a C# .NET MVC 2 app within MS Web Developer 2010. ...

Scroll to a position in page Jquery Asp.net ?

Hi fellow, I have a long form which I want to be scrolled at a point where my gridview is located after a successfull partial postback with an update panel. How can I achieve this with JQuery. I am using update panels in VSS 2005. ...

Asp.net using GridView

How to generate dynamic rows in grid view and fill textbox from data base? ...

Error Redirect for Ajax Froms in asp.net mvc2

I'm building an asp.net mvc2 website and using a lot of ajax form elementes (Ajax.BeginForm to be exact) to asynchronously populate data on the page. I would like to redirect the user to the sign in page after x amount of time of inactivity on the site. When I do this currently, either through ActionExecutingContext, or HttpContext, the ...

ASP.NET Custom Templated Control - Is there a way to modify where databound data is output to?

Basically, I have a custom templated control with a custom data container class. When a developer adds an instance of my control to a page, they can define the controls in the LayoutTemplate however they like, as follows: <ml:MyControl id="MyControl1" runat="server"> <LayoutTemplate> <span><%#Container.ErrorMessa...

how to update dynamicaly generated gridview textboxes

i have done to create the parent textbox and child gridview dynamicaly add row in child and all the data is save..... but now i want to update all the data against the Purchase order number and all data must be papolate in specific text boxes like parent txtboxes and gridview dynamicaly (generate gridview textboxes agains the purchase or...

ASP.Net MVC: Entity Selection in View without using dropdownlist

I have an EditTask View for editing the following properties for a Task that I am modeling. [Task Name] [Project Name] [Assigned Employee] Task Name and Project Name are just simple text boxes. I want Assigned Employee to be a selection from all the available Employee's currently in the database. Dropdownlist is not ...

ASP.net renders form tag weirdly

Hi! My code on my ASPX page: <form runat="server" action="productEditCat.aspx?mid=2&catID=<%=catID%>&action=update"> This is rendering as: <form name="aspnetForm" method="post" action="productEditCat.aspx?mid=2&amp;catID=&lt;%=catID%>&amp;action=update" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm"> It seems to ...

ASP.NET Unauthorized access when downloading from fTP

My code can be found here http://stackoverflow.com/questions/3604864/c-asp-net-ftp-error I am trying to download a file from an FTP server when I try to download it it says I do not have access I have been googling this all morning and have not had any luck. I went to the designated folder and added Everyone with full permissions hoping...

How can I use asp.net to generate and return an HTML document as a string (outside of a web context)

Hello, I need to write a system to generate HTML email from a data model - I was going to create a templating system to build the model into an HTML representation using HTML 'fragments' stored in an xml template. But it occurs to me that these it might be better to use asp or asp.net than write my own templating system? What I am w...

order datatable by relevance using linq by column values which are comma sperated

I have a Datatable that contains a column called Tags, Tags can have values such as row[0] = Tag1 row[1] = Tag1, Tag2 row[2] = Tag2, Tag3 row[3] = Tag1, Tag2, Tag3 row[4] = Tag4, Tag6 and are seperated by comma's etc.. I have the value of Tags for the current document and have run a query to select all other documents that have eith...

Textboxes are not filled

I am creating a content web page which is inherited from BasePage. There is a drop down on the page.On selectedindex changed of dropdown i m filling some values in text boxes on the page.No error is coming.Even when debugging by applying breakpoint on selectedindexchnaged everything seems fine..But textboxes are empty after page load.Plz...

How to execute JavaScript in Visual Studio design mode?

I have a JavaScript that generates HTML on my web page (AJAX control). Now I need to create a ASP.NET Control that is visible at design time. It should look exactly like the original AJAX control. Any ideas about how to execute JavaScript at design time? Unfortunately I cannot create all the required HTML in .Net as it is too large and c...

ASP.NET MVC 2 Problem with custom ModelValidator

I am trying to validate that either of 2 textbox fields in my view have a value supplied. I made this Model Validator: public class RequireEitherValidator : ModelValidator { private readonly string compareProperty; private readonly string errorMessage; public RequireEitherValidator(ModelMetadata metadata, ControllerCont...

ASP.NET Submit but don't validate?

I have a form that looks like this : [ enterdata: [______] ; more data: [_____] ; (SUBMITBUTTON) ] [ Filter: [_______] ; (SUBMITBUTTON) ] The top half has validators. I want to be able to type into the Filter textbox and press enter to fire it's submit button - but when I press enter, it validates the top half of the form also. How ...

WCF Service Reference in ASP.net Page - When to Dispose?

I have an ASP.net page that is creating a service reference to a WCF service and making calls in multiple places in my page. I instantiate the service reference in Page_Load and have an instance variable to store it: private FooClient _serviceClient; protected void Page_Load(object sender, EventArgs e) { _serviceClient = nwe FooCli...