Showing posts with label required. Show all posts
Showing posts with label required. Show all posts

Monday, March 26, 2012

Visibility problem with ajax control

hi,

I have a textbox and required field validator control.when the page is 1st loaded the Textbox is invisible and after clicking a button it becomes visible but

the problem is that the validator control is not working though the text box is visible now? why any idea pls?

Hi,

Can you post sample code to illustratete problem? I cannot get the same problem just by placing textbox and required validator in update panel and makeing TextBox invisible initially.

-yuriy


If you are using Validators inside UpdatePanel, then it is not compatible with it

http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

You can download compatible validators control from here

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx


hi,

I have used the usual asp validators.Now I have add the tag mapping required in web.config file and add reference to validation.dll.But when I run the program it shows error in my user controls which are in another folder with a custom namespace.any idea pls? the pages are not showing error but the user controls are showing error.By the By the Pages where these user controls are imported are also in a folder.

pls reply...


I have put the error messags given in my User Controls below:

pls see this and reply quickly............

Error 150 Could not load file or assembly 'Validators, Version=1.0.0.0' or one of its dependencies. The system cannot find the file specified. (D:\SSDTracker\Tracker\web.config line 92) D:\SSDTracker\Tracker\User Controls\CompetencyDatabase\CompetencySectionUI.ascx 32


Hi,

I think the error message explained the issue clear.Make sure Validators.dll is in the right folder and the version of it is right. Make sure you made the right setting in the config file.

Good luck!

vswebsite.interop now required?

I downloaded the latest release today, and dropped it in as a replacement for the older version of my project. When I deployed this on our production webserver, I got errors about not being able to find vswebsite.interop. I don't know what this is, but from a couple of quick searches, I would guess that it's something to do with providing designer support in Visual Studio. My question is why has this been added as a dependancy of the control toolkit, and if it is intentional, how would I go about installing this on a production webserver without installing visual studio?

From what I can see this is something to do with web project support in visual studio.

Richard

I'm having the same issue. I've tried uploading the bare bones version of an AJAXEnabledWebSite to a hosting account and I've also tried uploading to a server. Both of which gave me the same error. However when loading any other VS built website those ran fine... Please if you get anywhere with that error let me konw.

-CJ

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load file or assembly 'VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 32: <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>Line 33: <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>Line 34: <add assembly="VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>Line 35: </compilation>Line 36: <httpHandlers>


Source File:D:\Inetpub\wwwroot\ajaxenabledwebsite1\web.config Line:34

Assembly Load Trace: The following information can be helpful to determine why the assembly 'VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210


FWIW, I found that you can just remove that line from the web.config when deploying to a production server and everything seems to be ok. Not sure why it was put in in the first place, because whether it is there or not doesn't seem to make a difference.


When I take that line of code out of the web.config file and upload this is the new error i get: any other ideas?

-CJ

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.IO.FileNotFoundException: Could not load file or assembly 'VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Assembly Load Trace: The following information can be helpful to determine why the assembly 'VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


When I take that line of code out of the web.config file and upload this is the new error i get: any other ideas?

-CJ

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.IO.FileNotFoundException: Could not load file or assembly 'VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Assembly Load Trace: The following information can be helpful to determine why the assembly 'VsWebSite.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


If I remove the line AFTER I deploy to production then it works fine. The problem is, every time I publish the site it puts it back in, so you can't just remove it from your web.config and expect it to work... This is definitely an issue that needs addressing...


I get the error, too. It's a major issue and needs to be addressed ASAP.


okay so what i did that seemed to solve the issue was I found VsWebSite.Interop.dll on my machine and uploaded that into the bin folder. then I leave that line of code and it runs. what a pain tho.

Good workaound though not a good solution. We're working on this, stay tuned.


It's probably Visual Studio that's adding that line (typically whenever you do a build). The 10606 Toolkit has an new dependency on VsWebSite.Interop.dll, but that file's needed *only during development* (it's for interacting with the designer, I believe). So it's fine to go to production without that line in web.config, but I can see how it'd be annoying to have it added all the time. I've pinged Ted/Shawn since they're more familiar with the details of this than I.


I had the same problem...

I solved this doing:

1.- Open .\AjaxControlToolkit\AjaxControlToolkit.csproj

2.- Expand the References,Click on "VsWebSite.Interop" and set "Local Copy?" [Sorry, But I'm Using the Spanish VS version :$] to TRUE.

3.-Make the DLLs

(Now In my Bin\Release folder I have 2 Dlls. AjaxControlToolkit.dll and vswebsite.interop.dll [and the "cultures folders" if was in "Release"] )


After that, I Added the reference to the new AjaxControlToolkit.dll, and the Web Works fine..Surprise

EDIT: In a 2nd test, I'd need copy the vswebsite.interop.dll to the bin folder...
After this 2nd test, I saw that Before do that Steps, If I remove that line before compile the web, The line appears again after Compiled ... Now, This don't occur)

____________________________

-- Sorry For My English Mistakes... :( --

------------------- This, When I add the AjaxControlToolkit reference, The vswebsite.interop.dll is added to the Bin Folder too..


I'm having this issue as well, except removing the line from the web.config file on my server does not seem to work. I get the generic "Runtime Error" message after doing that, informing me to turn CustomErrors mode to Off, although it is already off in my web.config file. Where is the vswebsite.interop.dll file located?


This assembly isn't needed at runtime - the problem you're probably seeing is that the deploy step is sticking the reference back into the web.config.

We're working on a fix for this. In the meantime, make sure the web.config that's on the server doesn't have this reference.


its in some odd place in the VS 2005 folder in program files... just do a search for it.


According tohttp://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=10994, this issue has been closed as part of release 10615. But, I don't understand the whole codeplex thing and what this really means.

Saturday, March 24, 2012

Watermark Extender Validation error

I have a textbox with an ajax watermark extender attached to it. As well as a required feild validator. One button on my page is "CauseValidation = true". Before i applyed the watermark extender the validation check worked perfectly, but now the validation check doesnt work as i think it see`s the watermarktext as text in the textbox, is there any way around this? si!

Hi blink18jew,

Would you mind posting your simple source code here?


sure its like this :

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TestBox" ErrorMessage="ERROR"></asp:RequiredFieldValidator>
<asp:TextBox ID="TestBox" runat="server"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="TestBox" WatermarkText="Watermarked..." WatermarkCssClass="water" runat="server">
</ajaxToolkit:TextBoxWatermarkExtender>

the watermark seems to ruin the validation checks...si!


Hi blink18jew,

I'm afraid that I cannot reproduce your problem.Here is my test sampe based on yours. It works fine locally.

Aspx:

<%@. Page Language="VB" %><!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Water Mark</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TestBox" ErrorMessage="ERROR"></asp:RequiredFieldValidator> <asp:TextBox ID="TestBox" runat="server" CausesValidation="true"></asp:TextBox> <ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="TestBox" WatermarkText="Watermarked..." WatermarkCssClass="water" runat="server"> </ajaxToolkit:TextBoxWatermarkExtender> <asp:Button ID="Button1" runat="server" Text="Button" /> </form></body></html>

So would you give us more details including source code or error information? If you can help us reproducing your problem step by step, it will be greatly appreciated.

By the way, did you use your Validator in a UpdatePanel? If yes, maybe you can benefit from this thread: http://forums.asp.net/t/1066821.aspx

Hope it helps.


no worries it was only to get it looking a bit more professional im just not guna use it, but thanks for your time! si!


Hi blink18jew,

Would you do a test with my sample code to find out the exact root cause for this problem ? If we can find the solution, our community members will benefit from our work then.Thanks, Surprise


Tongue Tied it worked... lol, i duno what was going on cos i tryed my olde code and that still didnt work... haha, oh well, ill mark it as answer! thanks.

Watermark extender type function on a dropdown?

Hi there,

I have 5 textboxes all using the watermark extender to tell the user that these fields are required and has some colour formatting. I would also like to do the same type of thing to a dropdown but it doesn't work, can anyone suggest a method I can use?

Thank you for your time

Here's just one suggestion:

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default4.aspx.vb" Inherits="Default4" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><%@. Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function ddlChange(ddl) { if (ddl.selectedIndex == 0) { ddl.style.backgroundColor = 'Yellow'; ddl.options[0].innerText = 'Please select...'; } else { ddl.style.backgroundColor = ''; ddl.options[0].innerText = ''; } } </script></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:DropDownList ID="DropDownList1" runat="server" style="background-color:Yellow;" onchange="ddlChange(this)"> <asp:ListItem Value="">Please select...</asp:ListItem> <asp:ListItem>Option A</asp:ListItem> <asp:ListItem>Option B</asp:ListItem> <asp:ListItem>Option C</asp:ListItem> </asp:DropDownList> </div> </form></body></html>

Thats cool thank you for that! one question, can css be used in place of hardcoding the color?

Thanks again


Pretty simply really, use the same javascript example as above

Create a new Required style for the dropdown e.g background-color:red; have that as the dropdown list's default css then using this piece of javascript be able to swap between the 2 based on Item value

function ddlChange(ddl)

{
if (ddl.selectedIndex == 0)
{
ddl.className ='RequiredCSS'
}
else
{
ddl.className ='SelectedCSS';
}
}

Hope this helps you out.


awesome thank you

Boy, diverdan, I do all the hard typing and you get all the credit!

Just kidding.

Happy Holidays, all...


Sorry!!!! I thought I had clicked the both of you!

Thank you for your help! have a great holiday!

Wednesday, March 21, 2012

Web Parts and Atlas with Beta 1

Could someone please help me with the steps required to get asynchronous drag-and-drop of Web Parts using Atlas Beta 1?

I have my own web part manager that inherits fromWebPartManager. Do I need to explicitly make it inherit from the Atlas web part manager instead? The online pre-Beta 1 tutorials on this topic (which I never got to work after several days of trying) said to add a <tagMapping> for the Atlas WebPartManager and WebPartZone. Is this still required?

I'm also using master pages and want the ScriptManager and WebPartManager to both live on the master page. Is this OK? Would there need to be an update panel in the master page since the whole content area will need an asynch refresh with web parts in the picture?

This topic seems like it would be a common question to me, so I hope someone will explain the "approved way" of combining the two.

Thank you,

Terry

I haven't read yet a successful experience with Webparts and beta1, that's why I am waiting for a future release, so I can migrate from the July CTP.


It would be nice if someone from Microsoft could respond.

I'm replying once again to move this issue to the top of the forum.

Can't someone on the Atlas team help me with this? I've seen other posts on the same topic, so I know I'm not the only one that can't this to work.

Web Server Controls - Basic Requirements To Work with AJAX.NET

Is thereany documentation showing what is required to equip a server-side WebControl to work with AJAX.NET?

I have some VERY simple WebControls that fire "Click" events. One of them consistantly causes the entire page to refresh, while the other doesn't. But they are both doing the same thing. For some reason, one seems tonot work with AJAX.NET, while the other does. Both of them are wrapped inside an UpdatePanel and ContentTemplate - but behave differently under AJAX.NET. Mysterious.

I can't tell if the examples showing ScriptControlDescriptor.AddEvent are relevent for what I'm doing or not. This seems to be related to very specific client side javascript voodoo - I just want to have a generic control that can fire events that will postback to the code-behind (like a normal ASP.NET button, for example - I can drop one of these on a page, use the event, and it just works - but how to do this properly with a custom WebControl - RELIABLY?).

If there is a plain-jane, simple example of a WebControl and the proper way to have it fire events (__doPostBack) without causing the entire page to refresh, that would be VERY helpful.

Thanks.

There's lots of examples of how to do this outside the webcontrol, so to do it inside a webcontrol all you really have to do is embed the javascript in the assembly and make sure that it ends with the if(Sys && Sys.Application) Sys.Application.notifyScriptLoaded(); statement. The easiest way to wire up interaction between your C# class and the javascript is by following the pattern described in the tutorials on custom extenders. children of ScriptControl follow the same basic pattern.

I've looked at the examples. There are too many things illustrated just aren't exlained. Sorry. I just don't have time to read the "Gone With the Wind" to get an answer to a simple question.

Do I have to write special javascript beyond the standard "_doPostBack" to get a postback executed without causing a page update? Why does it work for an asp:Button without doing anything out of the ordinary? Is some kind of magic support wired into ASP.NET for the standard .NET controls?

SIMPLE QUESTION (YES/NO):

Can I write a WebControl that fires events - like I would for a NON-AJAX application - and have it work under AJAX.NET without refreshing the entire page?

I thought that any postbacks generated inside an UpdatePanel/ContentTemplate would be AUTOMATICALLY handled by AJAX.NET. This is what it says in the documentation. Is this true or no?

This is just a YES/NO question.

Thanks (frustrated - about to punt on AJAX.NET and just work with web callbacks...)