Showing posts with label sys. Show all posts
Showing posts with label sys. Show all posts

Wednesday, March 28, 2012

Line 5909 Javascript Error

Error Message:

Line:5909
Char:12
Error: Sys.ArgumnetUndefinedException:Value cannot be undefined. Parameter name:id

Code:

I write an mask customer validator control And use this control in ajax updatepanel control. It will show javascript error.

Below is my code:

maskedVad.ClientValidationFunction = this._CallbackFailFunction;
vce4Mask = new ValidatorCallbackExtender();
vce4Mask.TargetControlID = maskedVad.ID;
vce4Mask.HighlightCssClass = this._HighlightCssClass;
vce4Mask.CallbackFailFunction = this._CallbackFailFunction;
vce4Mask.CallbackControlID = this.ID;
Controls.Add(vce4Mask);

This is apparently a bug in the Ajax RTM that will be fixed. In the meantime you should check out this link for a solution:
http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx


I replaced validators.js file and added the tagmapping in web.config. but the bug still existed. Can someone give me more suggestions?


Hi Wallance,

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

Best Regards,

Jonathan


I do a custom extendtextbox webcontrol.

TextBox txt = new TextBox()

req = new RequiredFieldValidator();
req.ControlToValidate = this.ID;
req.ID = this.ID + "_req";
req.Display = ValidatorDisplay.None;
string sRoot = HttpContext.Current.Request.ApplicationPath;
req.ErrorMessage = this.RequiredErrorMsg;
req.EnableClientScript = (this.ClientScript.ToLower() != "false");
Controls.Add(req);

vce4Required = new ValidatorCallbackExtender();
vce4Required.TargetControlID = req.ID;
vce4Required.HighlightCssClass = this._HighlightCssClass;
vce4Required.CallbackFailFunction = this._CallbackFailFunction;
vce4Required.CallbackControlID = this.ID;

See the aspx

<asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
<contenttemplate>

<asp:Table runat="server" id="appInfoTable">
</asp:Table>

</contenttemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnadd" EventName="Click" />
</Triggers>


</asp:UpdatePanel>

addbtn_click

protected void CreateRows(int Rowcount)
{
int i = 0;
for (i = 0; i < Rowcount; i++)
{
TableRow tr = new TableRow();

TableCell tc = new TableCell();
extendtextbox txt = CreateTextBox(i);
tc.Controls.Add(txt);

tr.Cells.Add(tc);
appInfoTable.Rows.Add(tr);
}
}

private extendtextbox CreateTextBox(int loop)
{
extendtextbox txtbox = new extendtextbox ();
txtbox.Validate = "required";

txtbox.ID = "mytextbox" + loop.ToString();
txtbox.Label = "acc_accountInfoForm_label_loginInfo";
txtbox.RequiredErrorMsg = "only for test";
txtbox.Type = extendtextbox .Text;
return txtbox;
}

Because the code is very long. Include one webcontrol and one page.

Thank you very much.


Hi Wallance,

Please add break point at "req = new RequiredFieldValidator(); req.ControlToValidate = this.ID;" and debug it step-by-step since the error propmt is "Sys.ArgumnetUndefinedException:Value cannot be undefined. Parameter name:id". Thanks.

Best Regards,

Jonathan.

Monday, March 26, 2012

ListView / ItemView

Hi,

I wonder what happened to these controls.
If I take a look at thedocumentation I don't see them nor the Sys.UI.Data namespace where I believe they could be found in. Did that namespace and the underlying "controls" dissapear in favour of something else?

Also I heard at TechEd 2006 Barcelona that xml-script is likely to dissapear. Anyone knows what's going on about these?

Grz, Kris.

hello.

the las ttime i've looked, they were in the future bits, in the Sys.Preview.UI.Data namespace. xml-script is still there too, with lots of improvements when compared with the previous versions. i hope that, with time, they do add these features to the core bits...

So that's probably why I didn't find any documentation about it. Too bad. And yes I hope some of the CTP stuff gets into the Extensions pack as well.

Actually, which reflection tool do you use to take a peek into those namespaces?

Grz, Kris.


hello.

well, if you're speaking about the client side, then i don't use any. i just opne the js file a read it when i need something...

Hi,

you could check thisJavascript Class Browser byEilon Lipton. You should be able to browse also the types in the Futures CTP.


hello guys!

well, but you really don't want to loose the thrill of going through lines and lines of javscript, right?

Luis Abreu:

well, but you really don't want to loose the thrill of going through lines and lines of javscript, right?

No, I don't mind but first I need to get a better grasp of the Microsoft AJAX specific code. Yesterday I already did make a mistake with the $addHandler instead of add_EventName for which I apparently made the mistake to think that I should be using $addHandler. So first the basic steps before I can run. Thanks for all the help guys, really appreciate it.

Grz, Kris.


hello.

well, currently i think that there are one or two problems with the $addHandler (for instance, it doesn't work when you try to handle and event form a control maintained in another frame). however, i do believe that you should be using it in order to get browser independence error handling.