asp.net

Global routing parameter in ASP.NET MVC

When a user clicks on a link, I want to log some information. I can't do an AJAX request because if they clicked on a link, the page will unload (since they're going to a new page), and I don't want to force them to stay on the page until a synchronous event finishes. So one idea I had was to add a parameter to the url. I.e. the urls w...

Difference between properties of an object showing in debugger vs proprties in Intellisense

When I inspect an object in the debugger, I see a lot more properties in the debugger than what is available in Intellisense or code. For example, the Page object in ASP.NET in the debugger shows a property RelativeFilePath which has a value. But when I try to use it in code, it doesn't exist. Why is that? I looked up the property Rel...

Check for a value in ViewState

Hey all, i am new at the ViewState and i am looking to see what values are stored within it. I know how to loop through an array to check for a value but i do not know how to go about doing that for a ViewState("test") property. Let's say i have added "bob, tom, Jim" to a ViewState called ViewState("test"). I would like to be able to se...

Prevent Empty Gridview data from populating " " into textbox

I have this code that populates a textbox based on a cell in the selected row of a gridview protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { txtComment.Text = row.Cells[14].Text.Trim(); } It displays   in the txtComment textbox if Cell[14] has no data. Is there a way to prevent t...

ASP.NET MVC Lightweight Login/Registration system

I'm on my first MVC project and am at a point where I need to implement my membership system. I'm not sure whether using the out-of-the-box membership system is a good choice for me given that all I need is a simple login/registration system like the one at Digg. My UserId field is a foreign key to many other tables, which is why I th...

How can i build my class architecture for my asp.net web application

I'm building a web application using .net 2010, c#. I want to create several projects in one solution. A asp.net web application A class library to hold normal business logic. A class library to hold business logic to call a third party API. When i call third party API, I need to login first, and third party API will return a session...

How to use Facebook Graph api

Hi, I am using facebook graph Api for my application where i want the data of this page. http://www.facebook.com/pages/ In this page there is option TV SHOW I want collect all information of that page. But i didn't any graph api method for this page. Please help me for this problem. ...

How to get asp:textbox value on code behind file?

The error I get is :The name agentName does not exist in the current context" On default.aspx I have <asp:TextBox ID="agentName" runat="server" /> On code behind file I have agentName.Text But is says the above error message. when I pass hard coded value like "John", it works. I need a way to recognize the textbox on code-behind. Th...

Should I use the DotNetOpenAuth OpenIdRelyingParty RedirectingResponse.AsActionResult or RedirectToProvider in MVC?

I've implemented an OpenID controller using Dnoa. I was using the approach found in the RP MVC template for dnoa, which returns IAuthenticationRequest.RedirectingResponse.AsActionResult() from the controller action. However, I've now found the controller very difficult to test using Moq because of this method. I changed the controller ...

diacritics in asp.net querystring collection

I'm trying to get a value out of the querystring that has diacritics. The diacritics are encoded in utf-8 %uxxx format, and when I check Request.QueryString["name"] they are incorrectly decoded. However, if i check Request.RawUrl, they are there and correct. I've tried adding <globalization fileEncoding="utf-8" requestEncoding="utf-8"...

Detecting NON mobile browsers

So I'd like to redirect mobile users to a different page. But instead of trying to detect any number of mobile browsers, I'd just like to see if the user is using IE, Firefox, Safari, Chrome, or Opera; all other users go to the mobile site. My biggest problem is detecting regular Safari from mobile Safari. Any good way to do this? ...

asp.net mvc outbound routing from a GET form post

I have a route that looks like this: new { controller = "ControllerName", action = "PhotoGallery", slug = "photo-gallery", filtertype = UrlParameter.Optional, filtervalue = UrlParameter.Optional, sku = UrlParameter.Optional} and I have a form that looks like this: <%using(Html.BeginForm("PhotoGallery", "ControllerName", FormMethod....

HowTo Publish ASP.NET Project on Web to work as it does locally?

Hi. I just followed a tutorial that created a database and two .aspx web forms.. And it runs perfectly when I view the asp pages in my browser. But when I FTP'd the files: Default.aspx AddEntry.aspx And my entire App_Data folder (with the .mdf and .ldf files) It doesn't view at the URL. For example.. When I go to http://www.mysite....

Determine HTTP Protocol Version in ASHX Handler

Is it possible to determine the HTTP protocol version (e.g. 1.0 vs. 1.1) used for a request within a .ashx handler? I can see all of the header information except for the version in Request.Params. If not, what avenues are available to discover the HTTP protocol version when processing an HTTP request in ASP.Net? ...

ASP.NET - sharing Columns between GridViews

Is there a way to define a <Columns> outside of a GridView in my .aspx file such that I can use those <Columns> in multiple GridViews in the same page? I have two GridViews that will have the same DataSource type, just with different content, and I'd rather not repeat all my customized TemplateFields in each. This seems simple enough, ...

Configurable Content System in ASP.NET

I need to design a configurable content system for all of the text in our web application that will tie together our need for Translation with the ability for Groups of users, Subgroups of users, and single Users to configure what a given label, Error Message, or piece of system text says. Because everything needs to be configurable th...

How to display xml data in OWC 10 component in ASP.net?

Hi We are using Office Web component V10.0 in ASP.NET 3.5 website. The rquiremetn is to display xml data in OWC Pivot table component. How can I acheive that? Thanks ...

Pluggable ASP.NET MVC framework query

I am trying to create a pluggable ASP.NET MVC framework. I have extensively used Prism (CAB for silverlight) and am a huge fan and wish to implement the following items in my pluggable ASP.NET MVC framework The framework will have a host to load the unity container and other infrastructure items like logging services and all. Plugins w...

ASP.NET Development Server permissions and Network Resources

My ASP.NET 4.0 Web App is unable to access Network Printers, while debugging on VS 2010. It can access local printers. Seems like it may be a permissions issue. Since VS2010 Debugging runs on ASP.NET Development Server, it must be running under the account I used to log into Windows, right? Does that user need to be added as an Admin...

How to restrict a user to enter data when a session expired in ASP.NET?

I have developed a ASP.NET application,I have used sessions for parameter passing. I dont want to let the user to enter data when the session expired.Please suggest me how to do that. ...