Showing posts with label watermark. Show all posts
Showing posts with label watermark. Show all posts

Monday, March 26, 2012

VSHTMLGenericElement minor issue

Not a major issue but is very easy to produce. For example, if you add a textbox watermark extender and link it to a textbox then delete the extender. The textbox will only be displayed as a "VSHTMLGenericElement" without any properties. The fix is to save your page. Then close and reopen the ASPX page you are working on. Then the textbox will be labeled as a textbox again.

Like I said not a major issue but seems like something doesn't get reset after the delete.

Yes.This is not a major issue for web application development.You should save current web files when you make some changes to them.Otherwise maybe you will get some issues for not saving them.

Saturday, March 24, 2012

Watermark and Popup Calendar issue

David, I download the lastest toolkit, and try the following code in aspx page. It is OK. But when I put it into a user control. It won't work!

The error is caused by code when clicked on popup calender:
var mydate = $("TextBox1").mydate;
The error message is Object is required

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" CodeFile="test2.aspx.vb" Inherits="test2" %>
<%@dotnet.itags.org. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<div>
<script type="text/javascript" language="javascript">
function commitScript1() {

var mydate = $("TextBox1").mydate;
if("" == mydate) {
mydate = "";
}
$object("TextBoxWatermarkBehavior_TextBox1").set_Text(mydate);
}
</script>
<asp:TextBox ID="TextBox1" runat="server" Width="150"></asp:TextBox>
<asp:Panel ID="Panel4" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel6" runat="server" Mode="Conditional" RenderMode="Block">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar3" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar3_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel>
<atlasToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender3" runat="server">
<atlasToolkit:TextBoxWatermarkProperties TargetControlID="TextBox1" WatermarkCssClass="watermarked"
WatermarkText="<DD/MM/YYYY>" ID="TextBoxWatermarkBehavior" />
</atlasToolkit:TextBoxWatermarkExtender>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender3" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="TextBox1" PopupControlID="Panel4"
Position="Bottom" ID="PopControlBehavior1" CommitProperty="mydate" CommitScript="commitScript1()" />
</atlasToolkit:PopupControlExtender> </div>
</form>
</body>
</html
CodeFile:
Partial Class test2
Inherits System.Web.UI.Page
Protected Sub Calendar3_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
PopupControlExtender3.Commit(Calendar3.SelectedDate.ToShortDateString())
Calendar3.SelectedDate = Nothing
End Sub
End ClassI believe this thread addresses the issue you're seeing (hard-coded ID changed by inclusion in a different naming container):http://forums.asp.net/thread/1368445.aspx

Watermark and popup cal inside update panel

Hi David Anson, want to know if the problem for watermark and popup cal have been sloved.
Thanks.

Not sure I know what issue you mean, but maybe the following blog posting helps?

http://blogs.msdn.com/delay/archive/2006/08/15/701848.aspx


Thanks, David. I try the code with AtlasControlToolkit-1064. It reports error
object does not support the property or method

the code for this error is:
$object("TextBoxWatermarkBehavior_TextBox1").set_text(favoriteColor);.

I try the apporach for my case as with textbox and popup calendar.
Code:
<script>
function commitScript() {
var mydate = $("TextBox1").mydate;
if("" == favoriteColor) {
favoriteColor = "";
}
$object("TextBoxWatermarkBehavior_TextBox1").set_text(mydate);
}
</script
<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" RenderMode="Inline">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="txtBatchDateTextBox" PopupControlID="Panel1"
Position="Bottom" ID="PopControlBehavior1" CommitProperty ="batchDate" CommitScript ="commitScript()"/>
</atlasToolkit:PopupControlExtender>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel
<atlasToolkit:TextBoxWatermarkProperties ID="TextBoxWatermarkBehavior" TargetControlID="TextBox1"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" /
<asp:TextBox ID="TextBox1" runat="server" CssClass="TextBox" Width="152px"></asp:TextBox></td
The I got error:
Object Required

The code for this error is:
var mydate = $("TextBox1").mydate;

So questtions are:
Where to get the 60731 release of the Toolkit?
Only this release support custom expando property for targetControlID?
Sorry, the code is:

<script>
function commitScript() {
var mydate = $("TextBox1").mydate;
if("" == mydate) {
mydate = "";
}
$object("TextBoxWatermarkBehavior_TextBox1").set_text(mydate);
}
</script
<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" RenderMode="Inline">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlPropertiesTargetControlID="txtBatchDateTextBox" PopupControlID="Panel1"
Position="Bottom" ID="PopControlBehavior1" CommitProperty ="mydate"CommitScript ="commitScript()"/>
</atlasToolkit:PopupControlExtender>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel
<atlasToolkit:TextBoxWatermarkProperties ID="TextBoxWatermarkBehavior" TargetControlID="TextBox1"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" /
<asp:TextBox ID="TextBox1" runat="server" CssClass="TextBox" Width="152px"></asp:TextBox></td>
As I note in the blog post, the example is forToolkit release 60731.
Hi David, Thanks for your message. I download the release 60731 and try it for watermark and popcalendar, it is greate okay. But I have another prblem.

In my page, I use many other atlas toolkit controls. It works fine when I use AtlasControlToolkit-1064. But with the release 60731, it cause a lot of assertion errors. The following code cause assertion errors for ConfirmButton and errorMessage user control.

Any new release include 67031 and 1064 fixes?

<%@. Register src="http://pics.10026.com/?src=errormessage.ascx" TagName="errormessage" TagPrefix="uc2" %>
...
<atlasToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server">
<atlasToolkit:ConfirmButtonProperties TargetControlID="btnDelete" ConfirmText="Are you sure you want to delete?" />
</atlasToolkit:ConfirmButtonExtender>
<uc2:errormessage ID="ErrorMessage1" runat="server" />
More info about ConfirmButton:

For the ConfirmButton, its target control is a button. This button is visible or invisible dynamically. When It is invoisible, then there is a assertion error.
This visible attirbute is set in asp code.

With release 1064, it's okay. With release 60731, it report assertion error.

<atlasToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server">
<atlasToolkit:ConfirmButtonProperties TargetControlID="btnDelete"ConfirmText="Are you sure you want to delete?" />
</atlasToolkit:ConfirmButtonExtender>

Please post a simple page demonstrating the assertion you hit. Thanks!

WaterMark and CodeBehind

Is it possible to create a watermark control programmatically in code behind? If so can some one provide me with an example?

Thanks,

Kris

Hi Kris,

I think you should check out the first part ofFAQ Item #13.

Thanks,
Ted

Watermark and Atlas Client Side Code issue

If I connect a textbox to a watermark control and write client side code like
obj = new Sys.UI.TextBox($('<%=textbox1.ClientID%>'));

it will report Assertion Failed error even if I set ID property for watermark control.

Myabe it is a bug of Atlas.

You're missing a getElementByID. The following works for me:

function foo() {
obj = new Sys.UI.TextBox(document.getElementById('<%= TextBox1.ClientID %>'));
alert(obj);
}
foo();


Hi David, Thanks for your help.
After changing
obj = new Sys.UI.TextBox('<%= TextBox1.ClientID %>');
to
obj = new Sys.UI.TextBox(document.getElementById('<%= TextBox1.ClientID %>'));

I still get same Assertion Failed error.

With my case, this textbox1 is inside an UpdatePanel. In this Updatepanel, I have a button with some ASP.NET code. when Clicking on this button, it only cause partial rendering.

The javascript here only get a string from a popup window. After the code
obj = new Sys.UI.TextBox('<%= TextBox1.ClientID %>');
is executed, and then click on the button inside the Updatepanel, the error came out.

But if code
obj = new Sys.UI.TextBox('<%= TextBox1.ClientID %>');
never executed, everything is OK.

I think the issue here is that the wrapper for hte textbox has already been created, that's why you're getting the assert (for future issues, please paste in the test of the assertion as well, it's usually helpful).

try this code instead:

obj = $object('<%= TextBox1.ClientID %>');


Is there any way to disable the Watermark? I'm getting an assertion error following a postback when I've set the Watermark's target textbox's visible property to false. The error message is:

Assertion Failed: Could not find an HTML element with ID "ctl00_CH_NewFeedTextBox" for control of type "Sys.UI.TextBox".

My code is just a click handler that is setting the visible property of the textbox to false. I'd be happy to set the Enabled property of the Watermark to false as well... if it had such a property.


When you set the Visible property to false, the control isn't rendered at all to the client. Thus, there is no ctl00_CH_NewFeedTextBox control in your client-side page. try NewFeedTextVox.style.display="none" to hide it. This will make it render to the page, but not be visible in the browser.
Hi sburke_msft, If I change the code to
obj = $object('<%= TextBox1.ClientID %>');
then it will report error obj is null.

Here question is I want to use Atlas code and make things simply. If I do not use Atlas code here, just use javascript directly, no this problem.
It means watermark combine orginal javascript, no this problem.

I certainly *could* do that and get past this error, but the point is that the extenders are supposed to add functionality to other controls without requiring me to change how I'm using those controls. Since it is perfectly normal for developers to set the Visible property to false for TextBox controls (and since this is more efficient in terms of rendering time and bandwidth, etc.), the better solution would be to fix the Extender so that it can detect whether the Control it is associated with is Visible, and if not, disable itself. Or, barring that, expose an Enabled property that I can manually set to false when I disable/invisible the control it is targeting.


Agreed. However to be overly blunt, before a fix comes out, you have only ( as far as I know, correct me if wrong ) 2 options: write your own extender, or use the display property.

This has come up several times. As pointed out here, Visible=false means that the control isn't rendered, so there's no way the client side code can handle it.

We've talked about possible solutions, but none of them are automagic and still reasonable:

1) We could flip the visible bit and add display:none via the extender - this could expose security issues by rendering code that wasn't intended to be

2) We could throw an exception - this means you still need to make this change to your HTML

3) We could do nothing - this makes it pretty hard to debug and people waste time trying to figure out why X isn't working.

So at the end of the day, yes, you need to make a markup change here. Our goal with extenders is to allow you to do as much as possible without modifying the original page but there are many, many scenarios when this just simply isn't possible.

Hope that helps.


In my scenario, the request I would have is that the extender expose an Enabled property (or Visible, but since most of them aren't really visible to begin with, Enabled is more intuitive). If I *know* that I'm writing some code that is going to take the target of the extender away, then that gives me the developer to option of turning off the extender in that same chunk of code. Meanwhile, everything else works as before.

I know I'm going to have to write code for this situation to work out. That's ok - that's not my point. What I'm going for is the best implementation for the Extender controls.

The question is, would I rather

A) Write some CSS code to hide my textbox when I have years of experience, best practices, and thousands of lines of code showing me that to do this I set Visible to False.

or

B) Modify the control that I've just added to the page, the one that I'm already having to touch anyway, the one that is bombing out, and the one that has as one of its core advantages the lack of necessity to touch its target control.

My vote is B. The code for this should be simple -- wrap the control's inner workings in a big if(this.Enabled) statement.

Thanks - I hope that clearly makes my point/recommendation.


I guess my underlying question, which I'll make explicit here, is:

Whynot have an Enabled property on Extender controls to enable/disable their behavior?


Actually this has been solved - I forgot that we did make a change here. Make sure you have a new Toolkit build.

If the target control isn't Visible, we simply don't emit the hookup, so nothing happens. Once it becomes visible, we'll generate the hookup and it'll start working.

Watermark + Textbox Issue

I have a web form with a text box with an associated watermarktextbox extender and a button. The goal is to have the user input a name into the the textbox and then use that value when the button is clicked as parameter to a new web page. This works if i remove the watermarktextbox extender. Any assistance would be appreciated.


Do you want a watermark? What exactly do you want to do? Are you receiving errors?


Sorry for the vague original post. Yes, the goal is to have a watermarked textbox. The user enters data into the textbox and I want to use that data as a parameter to a redirection to a new webpage. The problem is that when I use the watermarked textbox the textbox text is not captured (i.e., my parameter is empty). If I use a standard textbox, I'm able to retrieve the textbox text and use it as I intend. I receive no errors I just get an empty value. I'm guessing I need to change the way I get the value of the textbox (client-side script?) but I have no idea how to do this.

Thanks.


OK. Post the script that your using.


Hi,

It's hard to tell without knowing how do you pass value? Are you using queryString? Or PostBackURL?

Please be more specific, a simple repro is preferred.

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!

Watermark extender interferes with trigger

I'm playing around with a demo page where I have a number of extenderson the same page. There appears to be an incompatibility currently ifyou have a watermark extender on the same page as the always visibleextender. I'm basically duplicating the 2 samples, just putting themon the same page. If I have a watermark extender on the page and tryto change the position of the always visible clock, the first postbackworks (sometimes) and after that the update panel does not trigger apostback when a different selection is made in the position dropdown.

Iwas able to reproduce the behavior with a very simple page containingthe code for the watermark and the code for the always visible extendertaken directly from the samples. happens in IE 6 and Firefox both. When I remove the watermark extender from the page, the trigger firessuccessfully every time the dropdown selected index changes as expected.

CurtisTed was looking at an issue very much like this yesterday. The UpdatePanel was behaving in a way that was arguably a bug. I think he worked around it by putting the TBW in the same UpdatePanel. I'll let him share the details (he's sick today).
I am having a similar issue with the watermark extender. In my case, I have a watermark textbox in one panel and an atlas update panel that contains a gridview with edit enabled. When I do editing in the gridview, I can see the watermark textbox somehow gets involved, which I have no idea why.

watermark extender and javascript?

Hi, i have a textbox on the page. When the user clicks on a username in the list to the right i use this javascript to insert their username into the textbox.

function

setTextBoxText(text)
{
var textbox = window.document.getElementById("<%=touser.ClientID%>");
textbox.value ='';
textbox.value = text;
textbox.focus();
}

This works perfectly.

Then i tried to add a TextboxWatermarkExtender and now it does not work anymore, the initial text in the textbox (set by the watermark extender) gets erased, but the username does not show up, it just turns blank and focus is set on the textbox. Is there anyway to fix that?

Patrick

any idea?

I tested this out yesterday and found out that when you use WaterMarked on your textbox, all of the changes to the textbox through javascript will be written to watermarked's layer.

e.g. you have a textbox with onchange or onfocus command to call a javascript function; and the textbox also has a watermarked "Enter Name Here"

Your JavaScript function will insert the user's name into the textbox.

document.getElementById('" & Me.textbox1.ClientID & "').value = 'John Smith';

Problem: What happen is, "Enter Name Here" will be replaced with "John Smith", and the textbox is still empty.


Question, is this a bug or is it as design?

Watermark Extender and Calendar extender do not work together?

Hi,

I'm wondering if anyone has come up with a solution for this problem. I have a textbox with a Watermark Extender attached to it. I also have a calendar extender attached to that same textbox.

When the page loads the watermark is there as it should. When I click on the textbox the watermark disappears and the calendar launches. So far so good. It seems as though when I click on a calendar date it flashes the date in the textbox then goes back to the watermark.

Are these two controls not able to work together?

Thank you

Vear

We have a bug tracking changes in textbox watermark so that it plays well with other extenders like calendar, masked edit and validators. This should be fixed when that issue is resolved.

Thanks kirtid,

I look forward to the update. I thought I was perhaps doing something wrong.

Vear

watermark disappears after partial postback on another update panel

I have two update panels on page. One of them has an watermark toolkit control which just displays a piece of text in a textbox.

When the page loads the watermark is visible. But if there is a partial postback on the other updatepanel then the watermark disappears.

I am on beta 2 of ajax, and the most recent version of the toolkit.

Is this a known issue, a bug, or are there workarounds?

This scenario should work (and does in at least some circumstances) - please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

Watermark issue

Hi all,

I just installed Atlas and tried to make a text box with watermark. I select new Atlas website, add a textbox and a TextBoxWatermarkExtender. When I go to properties of the textbox and click the + before TextBoxWatermarkExtender nothing happenes. The + disapears and I don't get the css and text option. I use Visual Studio 2005 and have no IIS installed. Someone has had this issue before?

Regards,

Stijn

Nobody had this before? This seems to be a bug...
The problem and its resolution are discussed in this thread:http://forums.asp.net/thread/1359451.aspx

Watermark issue

Case: 2 textboxes connect to popup calendar and watermark.

If there are more than one watermark ccontrol in one user control, there is problem as following:

If you input data for textbox1 using popup calendar, it will clean data in textbox2.
If you input data for textbox2 using popup calendar, it will clean data in textbox1.

But if you type the data in textbox, no this problem.

<atlasToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server">
<atlasToolkit:TextBoxWatermarkProperties ID="WaterMark1" TargetControlID="textbox1"
WatermarkText="<Type Batch Name Here>" WatermarkCssClass="watermarked" />
<atlasToolkit:TextBoxWatermarkProperties ID="WaterMark2" TargetControlID="textbox2"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" />
</atlasToolkit:TextBoxWatermarkExtender>Could you please post a simple, complete sample page that demonstrates the problem?
Sample code here:

<%@. Control Language="VB" AutoEventWireup="false" CodeFile="Edit.ascx.vb" Inherits="Common_Edit" %>
<%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %
<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" RenderMode="Inline">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="textbox1" PopupControlID="Panel1"
Position="Bottom" />
</atlasToolkit:PopupControlExtender>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar2" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar2_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender2" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="textbox2" PopupControlID="Panel2"
Position="Bottom" />
</atlasToolkit:PopupControlExtender>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel
<atlasToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server">
<atlasToolkit:TextBoxWatermarkProperties ID="WaterMark1" TargetControlID="textbox1"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" />
<atlasToolkit:TextBoxWatermarkProperties ID="WaterMark2" TargetControlID="textbox2"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" />
</atlasToolkit:TextBoxWatermarkExtender
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<atlas:UpdatePanel ID="EditUpdatePanel" RenderMode="Inline" Mode="Conditional" runat="Server">
<ContentTemplate>
<table id="Table11" cellspacing="0" cellpadding="0" border="0"
style="width: 752px">
<tr>
<td>
</td>
<td align="right">
Batch Date:</td>
<td>
<asp:TextBox ID="textbox1" runat="server" CssClass="TextBox" Width="152px"></asp:TextBox></td>
<td align="right">
Deposit Date:</td>
<td>
<asp:TextBox ID="textbox2" runat="server" CssClass="TextBox" Width="152px"></asp:TextBox></td>
</tr>
</table>
</ContentTemplate>
</atlas:UpdatePanel>
</td>
</tr>
</table
This also sounds like the problem I found yesterday with 3 textboxes in a DetailsView InsertItemTemplate. One is connected to a calendar popup, another a plain textbox, and the third is my custom auto complete extender. Clicking in the textbox with the popup calendar clears the watermark in the other 2 textboxes.
Kent, the problem you're hitting seems to be because the PopupControl and TextBoxWatermark that are both pointed to the same TextBox are conflicting. If you remove the TBW, the scenario seems to work fine. I don't currently have a good suggestion for making the two controls work together due to the way that UpdatePanels get involved here. Hope this helps.

Watermark in a Wizard control

Has anyone been able to use a watermarktextbox inside a wizard control step? It shows up and works fine, but if I navigate to a different step, any subsequent button click causes a javascript error.

-MT

If it's because of the issue it sounds like, this should be fixed in the new 60731 release.

Watermark for Dropdown List.

is there a watermark capability for dropdown list?

using the textboxwatermarkextender does not work quite well with a dropdown.

by adding items into the dropdown, this will disable the watermark. and watermark text do not show up in the dropdown text area.

Have a look at using TextBoxWatermark's set_Text method as outlined here in an old sample:http://blogs.msdn.com/delay/archive/2006/08/15/701848.aspx

Watermark text

I created a practice atlas website, put a textbox on the form, dragged the script manager and watermark control to the form. Went to the properties of the textbox and the watermark referance was there with a plus sign. Clicked on the + sign and nothing was there, I could not insert any text. What am I missing? Thank you.I got it working locally but receive this error on the remote server.

Unknown server tag 'atlas:ScriptManager'.
It seems like maybe the remote server's not seeing the Atlas DLL as registered? Maybe check that there's an @.Register for it or a corresponding entry for it in the web.config on that machine.

Watermarks and Validation ... How to disable?

Since it appears to me that the watermarks and validation issue will not be resolved anytime soon, can somebody please help me to clear the watermark text from my textboxes? I don't want to remove the watermarks completely because I'm using styles that identify required fields.

I would like to be able to iterate through all the textboxes on a page and just set the watermark text to an empty string.

Thank you very much!

Hi Jax67,

You should be able to iterate through the collection of all objects inSys.Application._createdComponents to check forTextBoxWatermarkBehaviorinstances and then callset_WatermarkText on each of them.

Thanks,
Ted