webforms

Can WebForms and MVC live in a single project?

僤鯓⒐⒋嵵緔 提交于 2019-12-30 03:17:07
问题 I'd rather be doing MVC as the regular WebForms development eats my soul. However, I've been given a fairly sizable WebForms project to add a bunch of features to. Is there anyway for WebForms and ASP.NET MVC to coexist in single project or even jointly handle the website? I know I am asking for a hack. 回答1: Here goes... Make sure your project is targeting .NET 3.5 Add references (and make sure they copy to local) the big 3 assemblies for MVC (System.Web.Mvc, .Abstractions, .Routing) Add a

What CSS is used by browsers for styling invalid <input type=“email”>s?

元气小坏坏 提交于 2019-12-29 06:54:05
问题 OK, so in HTML5 browsers you can have: <input class="txt-box" type="email" name="email" rel="required" /> When the email is not in the proper format it puts a red box around it. My question is: what is the CSS that determines that style? 回答1: Depends on the browser. This should cover your bases: input:invalid, input:-moz-ui-invalid { border:0; outline:none; box-shadow:none; -moz-box-shadow:none; -webkit-box-shadow:none; } Test out the effect in a compliant browser: input[type="email"] {

What CSS is used by browsers for styling invalid <input type=“email”>s?

本秂侑毒 提交于 2019-12-29 06:54:05
问题 OK, so in HTML5 browsers you can have: <input class="txt-box" type="email" name="email" rel="required" /> When the email is not in the proper format it puts a red box around it. My question is: what is the CSS that determines that style? 回答1: Depends on the browser. This should cover your bases: input:invalid, input:-moz-ui-invalid { border:0; outline:none; box-shadow:none; -moz-box-shadow:none; -webkit-box-shadow:none; } Test out the effect in a compliant browser: input[type="email"] {

ASP.NET Forms Authentication prevents loading javascript on Login.aspx

独自空忆成欢 提交于 2019-12-29 06:24:08
问题 I am experiencing problems with Forms Authentication. When I try to load my Login.aspx page neither javascript nor stylesheets do not load. Here is part of my web.config file <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="30" name=".ASPXAUTH" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="Main.aspx" cookieless="UseDeviceProfile" /> </authentication> <authorization> <deny users="?" /> </authorization> Help me, please, to understand what's happening. 回答1:

adding URL parameters to a form PHP HTML

最后都变了- 提交于 2019-12-29 01:38:11
问题 Is it okay or correct to put a url get parameter in a form action? <form method='get' action='index.php?do=search'> <input name='_search' type='text' value='What are you looking for?'> <button type='submit'> Search </button> </form> When I submit the form the URL is changed to: index.php?_search=What are you looking for? (I've stripped %20) I'd prefer the URL to read index.php?do=search&_search=What are you looking for? Would it be best to add a hidden field into the form <input type='hidden'

asp.net 4.5 Web Forms Unobtrusive Validation jQuery Issue

前提是你 提交于 2019-12-28 13:56:49
问题 I've been checking out some of the new features for Web Forms in 4.5, and I have run into a road block with unobtrusive validation. Unobtrusive validation in Web Forms 4.5 is dependent on jQuery, and when it is enabled will result in a jQuery script reference inside of the server form in the page body. This sounds great, and I love the concept. It works great in the demos I have looked at, and the reduction/cleanup in code is a beautiful thing. I run into issues, however, when I enable this

How do I mock/fake the session object in ASP.Net Web forms?

时间秒杀一切 提交于 2019-12-28 12:32:49
问题 Is there a way to mock/fake the session object in ASP.Net Web forms when creating unit tests? I am currently storing user details in a session variable which is accessed by my business logic. When testing my business logic in isolation, the session is not available. This seems to indicate a bad design (though I'm not sure). Should the business logic layer be accessing session variables in the first place? If so, then how would I go about swapping the user details with a fake object for

Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators?

送分小仙女□ 提交于 2019-12-28 10:06:12
问题 Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For instance use a asp:RequiredFieldValidator leave the server side code alone but implement your own client notification using jQuery to highlight the field or background color for example. 回答1: The standard CustomValidator has a ClientValidationFunction property for that: <asp:CustomValidator ControlToValidate="Text1" ClientValidationFunction="onValidate" /> <script type='text/javascript'>

submit disabled fields

和自甴很熟 提交于 2019-12-28 04:02:05
问题 I know the defined behavior for web forms is to not submit disabled fields... but that's not the definition I want. I want to use ajax to post the form and I want it to get all fields, even if they are disabled. I don't want to build a workaround where I make the field "look disabled"... or have to hack it where I enable the fields -> post -> disable. is it possible to make ajaxSubmit() or serialize() grab the disabled fields as it's moving through the DOM and grabbing values? or is there

Using jQuery for AJAX with ASP.NET Webforms

删除回忆录丶 提交于 2019-12-27 11:11:34
问题 Anyone know of a link to a good article/tutorial for getting started using jQuery for AJAX calls rather than ASP.NET AJAX? I'm trying to avoid using UpdatePanels entirely in this app, which I haven't been able to accomplish in the past. 回答1: The most complete article I've ever found about this topic http://www.codeproject.com/KB/ajax/AjaxAndAspNET.aspx It avoids update panel, script manager and viewstate. 回答2: Here are few links: A Look Into JQuery API http://gridviewguy.com/Articles/407_A