webforms

SignalIR and KnockoutJS in Asp.Net Web Form

主宰稳场 提交于 2020-01-01 17:10:12
问题 I seen may samples of SignalIR and KnockoutJS samples on MVC platform but not on WebForm. Please suggest me, can we use on WebForm? Any articles link would be appreciable. 回答1: I know this is exactly a month late but here's a quick example [this is a trivial example that i have built from exploring MVC examples] lets say u have a page called MyPage in the .aspx file write the following: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %> <!DOCTYPE html

How to avoid writing messy JavaScript in an ASP.NET code-behind?

拜拜、爱过 提交于 2020-01-01 14:35:54
问题 I'm questionning about what is the best practice to use Javascript with ASP.NET. I don't know if it's the best practice but I add the javascript client side event inside the codebehind. It is working correctly but is this the best practice? For example, I got a radio button control and I add the Javascript client side event in the Page_Init. The page init can be recalled multiple time so the Javascript will be rendered each time that the Page_It is called. Also, it is hard to debug a long

Ninject.Web.PageBase still resulting in null reference to injected dependency

拟墨画扇 提交于 2020-01-01 10:44:50
问题 I have an ASP.NET 3.5 WebForms application using Ninject 2.0. However, attempting to use the Ninject.Web extension to provide injection into System.Web.UI.Page, I'm getting a null reference to my injected dependency even though if I switch to using a service locator to provide the reference (using Ninject), there's no issue. My configuration (dumbed down for simplicity): public partial class Default : PageBase // which is Ninject.Web.PageBase { [Inject] public IClubRepository Repository { get

How to handle master page button event in content page?

做~自己de王妃 提交于 2020-01-01 09:24:12
问题 There's more than question and article about the same exact question but I have a couple more related questions and was hoping to get some answers. I've heard of two approaches to find the button and add the handler or use an interface (Check both approaches from here) .. Which one do you suggest ? If you could please illustrate the 'Interface' option with some code and where to class the interface file cause it's not readable in the page when I try to inherit it! 回答1: Second aproach is IMO

Invalid value for encryptedTicket parameter

删除回忆录丶 提交于 2020-01-01 08:54:27
问题 I recently modified the login for my companies eComm site to have a "Keep me logged in" feature. The primary change was to make the forms authentication cookie persistent for these users. After the change was released I started seeing this exeception in my logs: Invalid value for 'encryptedTicket' parameter at System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket) The problem seems to be user agent specific. The only user agents the error has been recorded for are: Mozilla/5

IE is not submitting dynamically added form elements

我们两清 提交于 2020-01-01 08:49:56
问题 I wrote some JavaScript to allow editing a list of items within an HTML form, including adding and removing items. Got it working in Firefox. When trying it in Internet Explorer, I found that any added items were not being submitted with the form. Long story short... lots of simplification, debugging, figured out what line is triggering IE to ignore the new form input. So the behavior problem is solved. But now I must ask: Why? Is this an IE bug? Here is the simplified code: <html> <head>

how to add new field to mechanize form (ruby/mechanize)

时光毁灭记忆、已成空白 提交于 2020-01-01 08:36:06
问题 there is a public class method to add field to mechanize form I tried .. #login_form.field.new('auth_login','Login') #login_form.field.new('auth_login','Login') and both gives me an error undefined method "new" for #<WWW::Mechanize::Form::Field:0x3683cbc> (NoMethodError) I tried login_form.field.new('auth_login','Login') which gives me an error mechanize-0.9.3/lib/www/mechanize/page.rb:13 n `meta': undefined method `search' for nil:NilClass (NoMethodError) but at the time I submit the form.

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

假如想象 提交于 2020-01-01 07:09:11
问题 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 enabled WCF service in an asp.net webform application? 回答1: At first, if you want to implement the server side of jQuery Ajax calls, you can do this with either

What's a good way to set the Item or DataSource attribute of a FieldRenderer?

依然范特西╮ 提交于 2020-01-01 06:43:06
问题 The scenario is that I have a lot of FieldRenderers. These should output data from various places, some from item X and others from item Y. And should be outputting properties from item Z. Assuming I have a public property ItemX that I want to output a property from, any of the following would be OK. But I get no output by any of them: <sc:FieldRenderer runat="server" FieldName="Logo" DataSource="<%# ItemX %>" /> <sc:FieldRenderer runat="server" FieldName="Logo" DataSource="<%= ItemX.Paths

Avoiding invalid viewstate when deploying on a load balanced website without downtime

☆樱花仙子☆ 提交于 2020-01-01 06:28:00
问题 Here is the scenario: We have 3 web servers A, B, C. We want to release a new version of the application without taking the application down (e.g. not using the "Down for maintenance page"). Server A goes live with latest code. Server B gets taken off-line. Users on Server B get routed to A and C. Page1.aspx was updated with new control. Anyone that came from Server B to Server A while on this page will get a viewstate error when they perform an action on this page. This is what we want to