asp.net

New to ASP.NET

I am wanting to learn ASP.Net and am just a beginner. I have done some windows c# forms development before but have no experience of web development. I have looked at the ASP.net website but beyond this, does anyone have any ideas as to good learning resources particulary in relation to the differences to windows development. For instan...

How is skill building for Sharepoint different from ASP.NET?

How much of ASP.NET or C# is required for Sharepoint development? Do you need experience with things like developing N layered web applications, design patterns, test driven development, strong SQL background etc? I hear that Sharepoint development is different from enterprise applications thats typically built with technologies like AS...

Why is LINQ to SQL entity association creating a new (duplicate) row when inserting a new record?

I am trying to insert a new entity using LINQ-to-SQL, and entity is associated with a User entity. The insert of the new entity is successful, but my existing User entity gets inserted as if it were a new User. The code looks something like the following: var someEntity = new Entity(); someEntity.User = this.User; dataContextInstance.So...

How can i diplay my Images inside my GridView from folders?

This is my Gridview <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Height="191px" Width="333px"> <Columns> <asp:ImageField HeaderText="Image"> </asp:ImageField> <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" /> <asp:BoundField Da...

how to show time limit

Hi I'm new to c# programming language, I'm making an app regarding online exam through paging, in which I want to show the time limit for the user and it decrease as the time passes & goes to next question when the time reaches 0. I have done wd d portion wn d control goes to next question but I don't know how I'll show the time limit fo...

Publishing a .NET C# website to an external server

Hi, I have just completed my first aspx/c# project using Visual Web Developer Express and consuming some custom controls and external web services. It runs fine on my development machine. If I now want to test this on a shared hosting account, do I just upload all the files with the current project structure? Will there be any problem ...

Server-side ASP.Net Ajax exception handling

Hi, I am using ASP.net's AJAX framework and I am trying to do some exception logging on the javascript-called webservice. Looking through the web, I find some people handling them client-side and sending them back to the server. I'd prefer not doing that since it relies on an other server call (if it failed the first time, sending an o...

How to change my Image DataImageUrlFormatString Value inside my GridView in Code?

I have a gridview and the one coulmn is a image column. How would i change the DataImageUrlFormatString value in my code behind? i tried doing this but it does not work....... ((ImageField)(GridView2.Rows[0].Cells[0].FindControl("ID"))).DataImageUrlFormatString = "~/createthumb.ashx?gu=/pics/gmustang06_2.jpg"; ...

Asp.NET - Strip HTML Tags

Using Asp.NET, how do I strip the HTML tags from a given string reliably (i.e. not using regex)? Like PHP's strip_tags. Example: for the string: "<ul><li>Hello</li></ul>" return "Hello". I didn't want to write some kind of parser, so I looked for it on the stardand library, but couldn't find anything. Thanks! ...

How can I export a GridView.DataSource to a datatable or dataset?

How can I export GridView.DataSource to datatable or dataset? ...

Can an asynchronous HttpHandler's request be interrupted without an exception?

We are using an asynchronous HttpHandler in ASP.NET 3.5 under IIS 6, and in our code we're wanting to perform an external API call if we're not under too much load. We've defined "too much load" meaning that if we have more than X requests hitting this API at the same time, we'll just skip calling the API. To accomplish this, we've wrap...

Allowing nulls vs default values

I'm working on an ASP.NET project that replaces many existing paper forms. One of the requirements is that the user can save the form in any state, i.e. they could create a new blank form and immediately save it with no data or with partial data. I'm validating for data type on every save but validation for required fields does not occur...

Why are string lengths different between JavaScript and VB.NET (posted back via ASP.NET form)?

When I trim a multi-line textarea in JavaScript to a certain length (JS: .substring(0, x)), and that field is then posted back, checking the length in VB.NET will still find a length greater than the trim length from JavaScript (VB: .Length > x). I have already determined this was a problem with line breaks, but I wanted to make sure no...

Local ASP.Net connection issues

I have been trying to set-up my recently reimaged workstation for working with one of our ASP.Net applications that consists of a ASP.Net website and some C# Web Services. I can successfully start debug instances of each the services and web site. However as soon as the site attempts to connect to and use one of the web services I get ...

how do i can swich the view based on the logged in user in mvc asp.net

I need to either redirect user or show not authorized page according to usertype of the logged in user. Here is some which would give you an idea. public ActionResult Index() { if (Request.Cookies["isadmin"].Value != "true") return View("NotAuthorized","Index"); else return Vi...

Calling a ScriptMethod on form submission?

When I call a ScriptMethod from an ASP.NET button using the OnClientClick property, the ScriptMethod returns 95% of the time (alert box shows), and the page submits. If I call the method from a HTML input button, the ScriptMethod returns 100% of the time, but of course the page doesn't submit. If I change the type to submit, I'm back to...

Securely Transfer User from one ASP .NET App to Another

I have an ASP .NET web application which uses Forms Authentication. Let's call this application "Foo." I am creating another ASP .NET application called "Bar." What I want to have happen is the user logs into Foo, then clicks a link which takes them to a page in the Bar application. The Bar application should not require the Foo user to...

Autosize Text Area (Multiline asp:TextBox)

I have a MultiLine asp:Textbox (a standard html textarea for those non-asp people) that I want to be auto-sized to fit all it's content only through css. The reason for this is that I want it to be of a specified height in the web browser, with scrolling enabled. I have implemented a print style sheet however and want all text located i...

Add Attribute (System.Attribute variety) to .aspx page - not the code-behind

I am creating a custom Attribute (extending System.Attribute). I know I can put it on another class easily enough by doing the following. [MattsAttribute] public class SomeClassWhichIsACodeBehind { However, I need to be able to test this attribute easily, and putting it in the code-behind would cause a lot of extra effort to get it d...

ASP.Net button click event not firing

This is perhaps related to this question, but I have slightly more information. I recently updated an ASP.Net application to .NET 3.5 after coding a few new pieces with Linq. Now my pages intermittently stop firing event handlers. I have it narrowed down to pages with Ajax on them, and I assume it's either the ScriptManager or the Aja...