webforms

How could I display a hierarchical org chart with directors, managers, and staff, using webforms and c#?

Assume I have an XML doc with employees and who reports to them. Something like this: <?xml version="1.0" encoding="utf-8" ?> <employees> <employee> <id>1</id> <name>Ashley King</name> <title>Director</title> <directReports> <employee> <id>2</id> <name>Jim Warden</name> <title>Manager</tit...

ASP.Net ImageButton stealing Enter key press

I have an ASP.Net page with a usercontrol on it. The submit button for the page is within the usercontrol. There is an ImageButton on the page itself (outside of the usercontrol). Whenever I hit the enter key to submit the form, it always executes the ImageButton click instead of the submit button within the usercontrol. I'm using a Mas...

What constructs/patterns do you use for accessing state?

Let's say you're building something simple, like a data entry/CRUD form for working on an entity called Customer. Maybe you pass the CustomerID in via Session state. I tend to write a lot of fairly boilerplate plumbing code around handling that Session variable in a particular way. The goals vary slightly but tend to be things like: A...

Combine ASP.Net MVC with WebForms

Would it be possible to create a MVC root application (Portal with masterpages and themes) and add a couple of WebForms based subprojects (we already have an existing WebForms application that we would like to integrate into the Portal)? How would you centralize navigation (sitemaps, url routing)? How would you share the masterpages? Ho...

Asp.Net Mvc - Don't clear error input in form

When I validate a form with Asp.Net Mvc and there's an error on the form, Asp.Net return me the form with the correct error message but clear the content of the input. I would like the content of the input to stay even if this content is wrong. How can I do that ? UPDATE Maybe this is because I don't use the default validation. I use t...

How to bind a Dictionary<Int32, CustomClass> to a dropdown

Hi, I've seen lots of posts about binding a dictionary to a drop down when the value is a string. What if the value is a class with a particular property of that class being the one thats displayed in the drop down? Dictionaty // Value class MyClass { public String Yer="123"; public String Ner="321"; } How do I display property Yer ...

ASP.NET Routing not firing when site is published to remote host

Hi, I have a website that was originally written in webforms to which I have added MVC functionality. When debugging locally it works fine, however, once published and uploaded to my host the routes do not work and return a 404. I am pretty sure that I have uploaded all the correct files. Would just appear that routing is not working. A...

jQuery DataTables server side processing and ASP.Net

I'm trying to use the server side functionality of the jQuery Datatables plugin with ASP.Net. The ajax request is returning valid JSON, but nothing is showing up in the table. I originally had problems with the data I was sending in the ajax request. I was getting a "Invalid JSON primative" error. I discovered that the data needs t...

C# ASP.NET, WebForms to MVC : Does it make sense to change in our case?

We have a WebForms based web application with these properties: Large Business Object Framework (Close knit DAL / Business Objects / Serverside Validation, similar to CSLA) Precompiled and placed in the Bin folder. Uses a lot of UserControls. Looking at overviews of MVC it seems there is a distinctive split on how the code is split up,...

How to force clicking on "Refresh" link button after saving some data into DB , by javascript?

Hi I'm completely newbie in JavaScript. Now my problem is: I have a page (Default.aspx). The page has a link button "Refresh" (lbtnRefresh) and another linkbutton (lbtnSave) which saves some data users has entered into DB. I want the page be refreshed after saving data into DB, by using javascript. Is that possible or not? Thank you ...

Jquery to display success message in asp.net webforms...

I have started using jquery in one of my new asp.net webform application... I want to display a success message after an insert on a button click event... Here is my link button.. <asp:LinkButton ID="LbOk" runat="server" CssClass="regular" onclick="LbOk_Click" OnClientClick="return validateEmployee();" > </asp:LinkButton> And my On...

What are the pros and cons when choosing ajax enabled WCF service in an asp.net webform application?

I have just experimented my first ajax enabled WCF service in a sample asp.net webform application... If i have 10-15 pages in my webapplication which involves add,edit,view and delete operations, is it possible to make them ajax post and get without using .cs(codebehind) of all pages... What are the pros and cons when choosing ajax en...

Why is OnBeforeUnload firing twice with asp:LinkButton?

I have the following Jquery function to notify the user with a prompt when they have unsaved changes (similar to how SO does it) and are trying to leave the current screen. <!-- in my aspx page --> <script type="text/javascript" language="javascript"> window.onbeforeunload = function() { if (HasPendingUpdates()) ...

Dynamically outputting checkboxes to aspx page in VB.NET

I have 50 checkboxes that I need to write onto an aspx page. Each checkbox comes with 3 textboxes. Example: chkbox State Name donation new donation chkbox CA Sam 10 15 chkbox AK Sam 15 20 Now this shall go for all 50 states, depending on which states the person wishes to donate. In each state's r...

MVC in a Webforms .net Webapplication

I'm interested in integrating MVC and Webforms to extend ScrewTurn Wiki that use webforms. Essentially my problem is that to keep ScrewTurn flexible and upgradeable I should write this as a plugin. I'm contemplating making it as a seperate web application, but then there would be some issues in sharing masterpages and I understand that I...

RequiredFieldValidator places display:inline on the text

Hi. I have a RequiredFieldValidator with Display="Dynamic" on my ASP.NET WebForm. I have assigned it a class using the CssClass property. I want the error message to be displayed using display: block, so I have placed this on the css class in my style sheet. Unfortunately, the validator places a display: inline on the element on the we...

Using jquery ajax and omitting a value for the form action attribute

I've created an ajax sign up form using jquery to a PHP backend. My question is whether it's prudent to leave the form attribute action="", that is between blank quotation marks and let the ajax interface handle everything. Are there any pitfalls to this method if I'm not interested in users with javascript turned off? $('#signUp...

How do I pass Json data back to the client from a standard ASP.NET WebForm uising the Response object?

I'm trying to return simple Json data back from a standard WebForm. It sounds very dumb, but I actually need this to happen. I'm using MVC, and this is one of only 3 pages that I use that is NOT an MVC view. Otherwise, I'd write a controller to return Json(myData), but I can't do that. Here is what I'm doing: var serializer = n...

ASP.Net WebForms or MVC which is right for me as a .Net newb?

I am aware of the differences between webforms and MVC, I am trying to determine in which environment I will feel most at home but yet not in over my head. I have been building web apps for 9 years in ColdFusion using an MVC design pattern. I am used to having full control over the rendered HTML & CSS as well as utilizing the jQuery li...

How Design A Software to InputData In WebForm Automatically?

Hi All I Want Create A Software to Input Data in WebForms Automatically (like Robot) And Accept Input Data. How I Can Create this Software in C# (Windows Application)? what Technologies Must Be Used? What OpenSource Project Exist for use? Sample Code And etc... Please Help Me ...