I m facing a weird problem here, none of my asp controls is working in Chrome, i'm unable to access event the text box don' t know why this arises??
Can some one help me regarding this?
Directive:
<%# Page Language="VB" Debug="true" EnableViewState="true" CompilationMode="Always" AutoEventWireup="false" CodeFile="Enquiry.aspx.vb" Inherits="Enquiry" %>
This is my textbox coding:
<asp:TextBox ID="txtContactAddress" CssClass="TextArea" ToolTip="Enter Contact Address" runat="server" Width="380px" Height="75px" TextMode="MultiLine" ValidationGroup="Enquiry"></asp:TextBox>
I am using HTML 5 tags
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
I have included above doctypes..!!
The controls are working in IE 11 perfectly, i haven't tested it in anyother IE version, but it is not working in chrome, the control appears like an image in the chrome browser
I'm Using Visual-Studio-2013
Web.config:
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
</configuration>
EDIT:
I have got the answer..!! :) Hurray, but it is weird..! I was having the controls inside a section tag whose css had position:relative and z-index:600; I removed the position:relative and it is woking fine..! Dont know why the Position:relative disabled the Asp.net controls??
Any solutions are welcome..!!
Related
A user control that was working is no longer being picked up in the ASPX file.
ASPX File
<%# Register TagPrefix="Uc1" TagName="ContactForm" Src="~/Controls/VFEmailForm.ascx" %>
<uc1:VFEmailForm ID="VFEmailForm" runat="server" />
It was working but now isn't. A green line appears under the uc1:VFEmailForm and when you type Uc intellisense doesn't show Uc1. It is as though the register statement does not work - well it obviously doesn't. This was all working prior to upgrading to Visual Studio 2015.
I've shown part of my web.config file as ancient posts have suggested this may be the cause.
Web.config
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
</namespaces>
<controls>
<add tagPrefix="webopt" assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" />
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
If there is a guru out there who can fix this I would appreciate it.
I had the same problem when building under x64. I switched to x86, rebuilt the project and VS 2015 worked as expected.
I was also in your situation a bit time ago.
1 .Try using the same tag name in both lines :
As in your case
<%# Register TagPrefix="uc1" TagName="ContactForm" Src="~/Controls/VFEmailForm.ascx" %>
<uc1:ContactForm ID="VFEmailForm" runat="server" />
If it helps then ok, otherwise after making this change , try restarting the visual studio.
This procedure helped me out.
I use Visual studio 2017, and faced a similar problem: Having green, wavy lines under the tagName instead the whole line, i.e., <Uc1:***ContactForm*** ...>. As part of this, I was getting this error:
Element ContactForm is not a known element.
A solution posted by #mitoutsnd on ASP.NET solved the problem by suggesting that I use:
Build > Rebuild Solution
This solved my problem.
For some weird reason when I enter such characters in text fields and press submit button I getting blank page loaded and I don't see any errors appear.
Include requestValidationMode in your web.config file.
<system.web>
...
<httpRuntime requestValidationMode="2.0" />
</system.web>
Also you can set ValidateRequest to false in your page directive.
<%# Page ... ValidateRequest="false" %>
We are upgrading our project from .Net2.0 to .net4.5.1.
The aspx page contains iframe tag as follows,
<iframe id="doc_preview" runat="server" src="" style="DISPLAY:inline; VISIBILITY:hidden"></iframe>
while building the project im getting the build error like "the type system.web.ui.htmlcontrols.htmliframe is not defined"
how can i resolve this?
Change the iframe to:
<asp:HtmlIframe id="doc_preview" runat="server" />
Rather than adding runat="server" to your iframe.
If it still throws issues then you'll want to add this to your web.config to make sure htmlcontrols are reference:
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.HtmlControls" assembly="System.Web"/>
</controls>
I'm creating a client insert form, in this form has a <asp:HiddenField/> named Id for save selected client id, but when I try submit form, it is on Page enableEventValidation="true" error, when I rename this HiddenField for any other Id, it's work
<asp:HiddenField runat="server" ID="Id" />
My form can submit success when I set enableEventValidation="false", but maybe I will need it in future
How to can I resolve this problem? keep HiddenField named Id
PrintScreen:
You've pretty much answered your own question. The only way to make this work is set enableEventValidation="false" or rename your HiddenField
Renaming it would be the best solution here, for security reasons
If you're are using framework 4.0 then entry in web.config ()
<configuration>
<system.web>
<pages validateRequest="false" />
</system.web>
</configuration>
If you're using framework 4.5 then entry in web.config (requestValidationMode="2.0")
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" requestValidationMode="2.0"/>
</system.web>
Link
This might not be the solution for your problem, but i was having same problem and solved it by checking for postback before binding data.
(!IsPostBack)
{
binddata(); //this was my gridview binding function
}
This error also occurs when there is another form on the page that does not contain runat = server. Please check if there is another form on the master page or the current page.
The majority of all other issues ive read about the AJAX Toolkit not working is related to some form of error that populates. I do not have an error I can reference! Which makes this bug a little harder to understand. I have a feeling I am missing ONE step. Ive gone through all the documentation and it shows that I am doing everything correctly.
The Issue:
I am trying to use a calendar extender on a textbox (which I have read that I no longer need to but that is aside the point). When I go to click on said textbox to make sure the toolkit is working, no calendar pops up!
The Double-Check: To check to see if it is the calendar itself (again, read that it was no longer needed) I added a confirm button extender to test the toolkit. It doesn't work either.
What have I done so far? I have: installed/reinstalled using NuGet the lastest version of the Ajax Control Toolkit (7.1213), commented out the registry in web.config and added to top of page (and visa versa), restarted VS2012 with every uninstall/reinstall, tried pulling syntax straight from the toolbox (which was taken from ajaxcontroltoolkit.dll) instead of hand-typing.
The Code:
web.config (added by NuGet on installation)
...
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />
</dependentAssembly>
</assemblyBinding>
</runtime>
...
page1.aspx
...
<%--patient ID panel--%>
<asp:Panel ID="pat_id_pnl" runat="server">
<div align="center">
<asp:Label runat="server" Text="SSN/MRN:" />
<asp:TextBox ID="ssn_mrn_txt" runat="server" style="margin-left:5px; margin-right:15px;"/>
<asp:Label runat="server" Text="Date of Appt:" />
<asp:TextBox ID="date_appt_txt" runat="server" style="margin-left:5px; margin-right:15px;"/>
<%--add calendar to date_appt_txt--%>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="date_appt_txt" Format="MM/dd/yyyy" />
<asp:Button ID="search_btn" runat="server" Text="Search" />
<%--Test confirm button extender--%>
<ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Are you sure you want to click this?" TargetControlID="search_btn"></ajaxToolkit:ConfirmButtonExtender>
</div>
</asp:Panel>
....
The line I was referring to earlier when I said "commented out the registry in web.config and added to top of page" I meant I commented this out of the web.config:
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
and added this to the top of the page before the first content place holder:
<%# Register tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" %>
Any help is greatly appreciated! Thanks.
So I figured a few things out after more searching.
To see an error with the ajax control toolkit, debug in internet explorer. Once I stopped debugging in chrome, I caught an error that said:
...AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts...
I had to remove Microsoft.Scriptmanager.MSAjax.dll from the bin folder of the project
That fixed my issue! Hope that it helps.