asp.net

ASP.NET: adding controls client-side

Hi there. If I have a page with a form (imagine a simple one with just TextBoxes and a submit button) and I want to allow the user to dinamiccally add more TextBoxes to the form via javascript, what is the best way to handle the request server side? Example: I have a page rendered like the following : <input type = "text" id = "control...

asp.net update UI using multi-thread

I have an ASP.NET website containing the following <asp:UpdatePanel ID="UpdatePanel1" runat="server" > <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> I have created a thread function. And during the execution of thi...

Get data being bound to ListView on DataBound event

Hi, I have a ListView control and I have added a DataBound event (don't know if this is the correct one) to the control. I'm wanting to access the data being bound to that particular ItemTemplate from this event, is that possible? ...

Any quick way to find out if a ASP.NET control property is backed by viewstate or ordinary fields?

In all my Page_Load() events I have to do a if(!IsPostBack) { //code runs on initial get //Set properties backed by viewstate } else { //Code runs on each get and post //Set properties backed by ordinary fields } Is there any quick way to determine this short of reflector, reading documentation, or creating a test page? Is i...

Remove column from datareader.

I have a small C# function that takes any generic SQLDataReader and converts it to a csv file. However I now need to ignore 1 column from a datareader that gets passed into it. How can I remove 1 column from the SQLDataReader? This column is needed in the query mainly for ordering but is used in another area on the same pageload, but ...

CausesValidation not working in MultiView

I have a back button in a MultiView which has CausesValidation set to false. I have three views in the MultiView and on the second View the back button with the CausesValidation is placed. It all works nicely if I click it when I am on that View. But if I go to the next View and then back again, remove a value from a TextBox which has ...

how to show contents which include html tag?

I am using FckEditor in Create.aspx page in asp.net mvc application. Since I need to show rich text in web pages, I used ValidateInput(false) attribute top of action method in controller class. And I used Html.Encode(Model.Message) in Details.aspx to protect user's attack. But, I had result what I did not want as following : <p> H...

Get table Id in code in .Net

I have two tables on a webform. On a button click I want to hide one and show the other. I gave them both an Id and I want to set the tables' style="display:" I tried this in javaScript using a function and document.getelementbyid(id).style.display='none' but it did not work. any ideas? Solution: OnClientClick="javascript: tbl2.styl...

Multiple UpdatePanels and onload

I have a page that has 2 dynamically loaded user controls each within it's own update panel. On load of the user controls, I execute javascript that updates the css of the table cells. ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Load_RunScript()", true); Both user controls have a button each that causes a postback an...

Custom Configuration Sections

Hi guys, I am currently trying to implement a Custom Configuration Section in a project I am busy with and no matter what I try I keep getting the error below: {"An error occurred creating the configuration section handler for pageAppearanceGroup/pageAppearance: Could not load type 'Samples.AspNet.PageAppearanceSection' from assembly 'S...

SQL Report Service - Chart Option

Hello Friends, I am using .Net 2008, Framework 3.5, Sql Express 2005. I am using SQL Report. I created couple of reports using dataset and create charts. Chart is create as per date range selected by user. I have problem that if user select long date range then chart is not readable (The bar is very near and number is overlap). Is ther...

Problem with Excel to Gridview C# ASP.NET

Hi, I got 2 different EXCEL FILE (.xls).And there is a Column named "KATIP" in excel1.xls , and there is a column named "SAVCI" in excel2.xls.I wanna get this 2 column from excel1.xls and excel2.xls and merge themn into a table named "Nobet" with 2 column "SAVCI" and "KATIP". and show them in Gridview Control in ASP.NET .. I got working ...

What causing this "Invalid length for a Base-64 char array"

I have very little to go on here. I cant reproduce this locally, but when users get the error I get an auto email exception notification. Message: Invalid length for a Base-64 char array. Call Stack: at System.Convert.FromBase64String(String s) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.Obje...

ASP.Net page methods execution time monitoring.

could anybody advice me, are there any approaches to calculate the methods execution time in asp.net page? ASP.Net Trace doesn't suit me since it ignores ajax partial postbacks though just they are the tight place. I have the page event which for some unknown reason executes slowly. Since the logic and event execution chain is rather c...

Extend the exception thrown from ASP.NET when calling a Webservice from JQuery

I'm using JQuery to load controls dynamically in an ASP.NET development environment using JSON and WebServices. Within this solution I have a business logic layer which has a built in validation mechanism (i.e. validating properties and business rules similar to that of CSLA) When requesting a new control to be loaded dynamically using ...

Beginning unit tests long after the project has begun?

I have taken on a project that has been underway for months. I've yet to ever do unit tests and figured it would be a decent time to start. However, normally unit tests are written as you go and you plan for them when beginning the project. Is it reasonable for me to start now? Are there any decent resources for setting up unit tests...

jQuery not working on Windows Server 2008, IIS 7

I am deploying an ASP.NET MVC to Windows Server 2008. I have installed ASP.NET MVC 1, but jQuery is not working on any of the pages. Anyone had this problem? ...

Setting value of paramter containing " ' " (apostrophe) used in LIKE query

I have the following query in ASP.NET/C# code which is failing to return any values using a parameter... select * from MyTable where MyTable.name LIKE @search I have tried the following query alternatives to set this parameter in SQL commands... select * from MyTable where MyTable.name LIKE %@search% select * from MyTable where MyTa...

Nerd Dinners Controllers Question

On this page: http://nerddinnerbook.s3.amazonaws.com/Part4.htm After the controller is added, I can browse to http://localhost:xxxx/dinners and it works as expected. My question is how does it know to use "Dinners"? Where is "Dinners" located? My controller is named DinnersController so how did the word Dinners become meaningful. I...

How to import a file when SSIS is on another server

I want users to upload a file via our website (ASP.NET), which then gets imported into SQL Server 2005 using SSIS. Our web app is separated into a web server (IIS) and a database server (SQL Server). The problem is that after the file has uploaded to the web server, you cannot directly call the SSIS package from the ASP.NET code, becaus...