asp.net

Make my WCF service return json

I am trying to make my WCF service method to return JSON-object, but it doesn't work, when I open in a web browser it shows xml. How can I make this method return JSON? I have inserted [WebGet(ResponseFormat = WebMessageFormat.Json)], but that didn't help [WebGet(ResponseFormat = WebMessageFormat.Json)] protected override IEnumer...

How can I display a banner on a web page to notify the logged in user they have a new message?

I've been tasked with adding functionality to an existing ASP.net Form Application. Users are authenticated when they log in. I've been asked to program the application so that when the user logs in, they see a special message notifying them that they have a new message(s). I think that StackOverflow implements this functionality extr...

What is the best way to display a hierarchy of choices in an ASP.net Forms Application?

I am working on an ASP.net Forms Application that keeps track of information about different offices in an organization. The offices are organized into a hierarchy. Some users of the program will have access to certain information about all offices in the hierarchy. Some users of the program will have access to only a small part of th...

Add/remove a list of items for a single object

For my site, I have a list of users and a list of events. I will be assigning users to each event. I have a table named EventUsers to hold this data: ------------------------ EventUsers ------------------------ EventID | UserID ------------------------ 1 | 123 1 | 456 2 | 789 On my page, I want to be able to ...

Can an asp.net app integrate with a Google App

Looking to drive the content displayed on my Google Apps domain by using my IIS7-based webservice. Would it be more productive to ask 'how can i drive a Google Gadget with asp.net'? ...

Can't access ExtJS radio button on form

So I have an .aspx page. In this grid I'm adding a bunch of controls. The first control however is an ExtObject, not one of our preset VB.NET controls. When I go to access the value on the backend for this field with this code: form.AndOr.getValue() It doesn't work. I really have no idea what is wrong. Basically, the radio button valu...

Replace char in a string

how to change [email protected] into XXX_YYY_ZZZ One way i know is to use the string.replace(char, char) method, but i want to replace "@" & "." The above method replaces just one char. one more case is what if i have [email protected]... i still want the output to look like XX.X_YYY_ZZZ Is this possible?? any suggestions thanks ...

Getting @@IDENTITY from TableAdapter

I am trying to complete a seemingly simple task that has turned into a several hour adventure: Getting @@Identity from TableAdapter.Insert() Here's my code: protected void submitBtn_Click(object sender, EventArgs e) { AssetsDataSetTableAdapters.SitesTableAdapter sta = new AssetsDataSetTableAdapters.SitesTableAdapter(); int ins...

jQuery/JSTree/ASP.net: How to get Newly Created Node's ID from Server

I currently have a JSTree all set up to do the creation and renaming of a new node: .bind("create_node.jstree", function (NODE, REF_NODE) { $.ajax({ async: false, cache: false, type: 'POST', url: "ApplicationAJAXHandler.aspx?action=CreateMenuItem&...

Setting optimum http caching headers and server params in ASP.Net MVC and IIS 7.5

I have an ASP.Net site (happens to be MVC, but that's not relevant here) with a few pages I'd like cached really well. Specifically I'd like to achieve: output cached on the server for 2 hours. if the file content on the server changes, that output cache should be flushed for that page cached in the browser for 10 minutes (i.e. don't...

How do I use JQuery Validation in ASP.NET MVC?

I'm trying to use the JQuery Validation's "addClassRules" method in my ASP.NET MVC application. In my master page I'm including the following files... <script src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" type="text/javascript"></script> <script src="<%= Url.Content("~/Scripts/MicrosoftMVCAjax.js") %>" type="text/javascrip...

Type of Request Web Client

As identified in C # where this is requested a specific web page, I wonder if the request comes from an image <img src="http://www.mydomain.com/default.aspx?n=123" /> or if the request is directly through an http browser, for example when the client is actually accessing the page via a browser sample: http://www.mydomain.com/default.aspx...

Receive HTTP 500 error or blank page on IIS6 ASP.NET website

Hi All, I have three web servers running a number of different websites. All 3 servers are running Win2003 with IIS6. I have one troublesome website however that is an ASP.NET website. Many users at random times through the day receive a blank page when trying to load the site. Looking through the IIS logs for the site I can see that us...

Telerik RadGrid inside of ToolTip inside of RadGrid

Right now I have a RadToolTip inside of a RadGrid. The RadGrid displays a field from the datasource called "Value". The RadToolTip displays the same thing. I want to add another RadGrid inside of the RadToolTip. The function setting up the datasource of that second RadGrid should take "Value" as a parameter? How do I do that? Here's w...

RadTreeView Telerik 2007 in IE8 issue workaround?

I know - 2007 is outdated - but I can't switch to the newer controls at the moment. I've figured out that the TreeView is not showing properly in IE8 because of an internal function: RadTreeView.AlignImage=function(_4e){ _4e.align="absmiddle"; _4e.style.display="inline"; if(!document.all||window.opera){ if(_4e.nextSibling&&_4e.nextSibl...

Complex Linq Query--Trying to add a .Where() or .Any() predicate to reduce query complexity (in VB)

I'm having issues with a rather complex Linq query and I need some advice. This involves VB syntax so I need specific answers for that platform, as I have a lot of trouble translating the C# syntax to VB at times. I have to join two main tables, and I need to filter the results by elements in an ASP.NET web form. These filters are c...

What is wrong with my auto forum thread generator using HttpWebRequest?

I'm using HttpWebRequest to send request without using a browser but I always get this reply from this old school cgi forum: "duplicate thread". I'm pretty sure the thread is not a duplicate as it is the first time I send it. I'm guessing the forum software is detecting something unusual about my thread as is is machine generated. What c...

Telerik RadNumericTextBox - flicker when text right aligned

Say that a RadNumericTextBox is defined like this in an ASP.NET 2.0 aspx page : <telerik:RadNumericTextBox ID="idNum" runat="server" Type="Currency" MinValue="0" Value="0" > <NumberFormat DecimalDigits="2" /> <EnabledStyle HorizontalAlign="Right" /> </telerik:RadNumericTextBox> Note that it is set to be right aligned. Now, it work...

How to require FileUpload with actual upload, not just selecting a file

I have a FileUpload control along with a required field validator. It throws an error if the user doesn't click the Browse button to select a file (which is correct). However, if the user clicks the Browse button, but doesn't click the Upload button, ASP.NET's required validator doesn't throw an error. Any ideas how to fix? ...

Setting LDAP authentication in IIS7 and Vista

Hello guys, I am quite new with IIS7 and still confuse on some configuration. Also, I am new with LDAP authentication. I have this ASP.Net project that needs LDAP authentication. The project and LDAP authentication are both currently running fine on a debug mode with VS2008, however, when I tried to deploy it on IIS7, the LDAP authent...