Showing posts with label error. Show all posts
Showing posts with label error. 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.

List of error code for args.get_response().get_statusCode()

I am getting error from ajax scripmanager 12031 when my session expires.

Now i need the List of all error codes and there description that we can get from args.get_response().get_statusCode()

I have used following code for tackiling my problem

<script language="javascript" type="text/javascript">
function load()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}

function EndRequestHandler(sender, args)
{
if (args.get_response().get_statusCode() == '12031' || args.get_response().get_statusCode() == '12030')
{
args.set_errorHandled(true);
window.location = "../Default.aspx?Error=PleaseLogin";
}

if ((args.get_response().get_statusCode() == '12007') || (args.get_response().get_statusCode() == '12029'))
{
alert('Please make sure you are connected to internet');
args.set_errorHandled(true);
}
}
</script>

<body onload="load()"> ...

hello.

i'm not following you...if it's an exception that hhapens on the server side you can always handle the asyncpostback error on the server side and get all the info about the exception...


Ok

But problem is that my session time out occur then this error come.

There are also some other error.

What i need is that if there is any list where i could get the details of these get_statusCode()


hello.

well, it really depends.

if the exception is an httpexception, the code is simply the httpcode of that exception. if i'm not mistaken, this exception will wrap unmanaged code errors. in that case, then you should check for the existing "windows" error codes. in fact, the number you mention belongs to the wininet error code range:

http://support.microsoft.com/kb/193625


Thanks Luis.IT really helped clearing what is hapening behind the scene

Monday, March 26, 2012

ListBox error with UpdatePanel

Using a listbox in an update panel with visible= false and AutoPostBack=true causes an error in the foloiwng code below. If I remove either the AutoPostBack and instead use a button to PostBack it works fine or if I remove the Visible it works fine. My workaround is to set the style of the listbox to display:none instead of using Visible.

I'm using the June CTP

<formid="form1"runat="server">
<atlas:ScriptManagerID="scriptManager"runat="server"EnablePartialRendering="true"/>
<div>
<atlas:UpdatePanelID="upListBox"runat="server">
<ContentTemplate>
<asp:ButtonID="Button1"runat="server"Text="Button"OnClick="AddListItems"/>
<asp:ListBoxID="ListBox1"runat="server"OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"Visible="false"AutoPostBack="true">
<asp:ListItemText="one"/>
<asp:ListItemText="two"/>
<asp:ListItemText="three"/>
</asp:ListBox>
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form>

CODEBEHIND

publicpartialclassDefault2 : System.Web.UI.Page
{
protectedvoid ListBox1_SelectedIndexChanged(object sender,EventArgs e)
{
ListBox1.Visible =false;
}

protectedvoid AddListItems(object sender,EventArgs e)
{
ListBox1.Visible =true;
}
}

Hi,

there's an issue with the UpdatePanel and the __doPostBack function that prevents it to be injected on the page if it is required by a control inside an UpdatePanel.

The solution is to force the server to drop the __doPostBack function. Add this statement in the Page_Load method:

Page.ClientScript.GetPostBackEventReference(this, String.Empty);

ListSearchExtender

I trying to implement this on a page and get the following java error.

AjaxControlToolkit.Resources.ListSearch_DefaultPrompt is null or not an object

this is the code

<cc1:listsearchextenderid="ListSearchExtender1"runat="server"targetcontrolid="ddlmylist"PromptText="Type to search"PromptCssClass="ListSearchExtenderPrompt"PromptPosition="Top"></cc1:listsearchextender>

any ideas?

I've not seen this one before -- could you try hitting Shift-Refresh to be sure that you are getting all the latest JavaScript scripts into the browser. If it still doesn't work could you try creating a new test web site and seeing if that also fails? If it does could you possibly zip it up and send it to me?

Thanks,

Damian (ListSearch contributor)

ListSearchExtender error - System.InvalidOperationException: Extender controls may not be

I created a custom web control (ListSearchControl) using the ListBox and ListSearchExtender control. I added this control to another custom control which is dynamically added to a page. The page ahs a ScriptManager tag before any other controls and inside Form tag. The control works fine on page laod, but gives an error on post back - "System.InvalidOperationException: Extender controls may not be registered after PreRender".

I tried using the same custom control((ListSearchControl) adding it to the page directly and it works fine even on postback.

Is there any way to get out of the error in the first case, or is there a known problem with using Control toolkit extenders being added dynamically on the page?

Hi,

Please try the workaround in this thread : http://forums.asp.net/t/1160803.aspx

Nai-Dong Jin - MSFT:

Hi,

From your description, it seems that while you are usingASP.NET AJAX Toolkit with your controls, you'll get a message whichsays "Extender controls may not be registered after PreRender", right?

For this kind of issue, one workaround is to call the baseOnPreRender method before declaring your controls while overriding theOnPreRender method on the page where you had the new extender control.See the following code snippet:

protected override void OnPreRender(EventArgs e)
{
// add base.OnPreRender(e); at the beginning of the method.
base.OnPreRender(e);

// codes to handle with your controls.
...


}

Also, there's a good sample on how to create an ASP.NET AJAX Toolkit Extender Control to Extend an standard control. See,
http://weblogs.asp.net/dwahlin/archive/2007/08/08/creating-an-asp-net-ajax-toolkit-extender-control.aspx

Saturday, March 24, 2012

Literal nested in UpdatePanel error: "Object reference not set to an instance of an object

I am trying to set the content of a literal which is nested inside an UpdatePanel. But when I try to reference the Literal control, I get this message: "Object reference not set to an instance of an object." This despite the fact that the name shows in Intellisense. Actually, not entirely true. It sometimes isn't showing in Intellisense, for reasons I can't fathom. But I'm not getting a compilation error, so I assume it does recognise the name, but for some reason the object is null. Here's the code:

 <asp:UpdatePanel runat="server" ID="UpdatePanel1" EnableViewState ="true" Visible="true" RenderMode="Block" UpdateMode="Conditional"> <asp:ContentTemplate> <div style="width:350px; height:400px" class="newscontent"> <asp:Literal runat="server" ID="litContent"></asp:Literal> </div> </asp:ContentTemplate> </asp:UpdatePanel>

C#:

protected void Refresh(Object Sender, RepeaterCommandEventArgs e) {if (e.CommandName=="GetContent") {int id = Convert.ToInt32((e.CommandArgument)); ObjectModel.News item =new ObjectModel.News(id); litContent.Text = item.Content; litContent.Text += DisplayDocuments(id); UpdatePanel1.Update(); } }
The Refresh function is triggered by the user clicking on a LinkButton in a repeater, but this is irrelevant to the problem, since I get the same error message if I put a simple line of code in the page load function to set the text property on the the literal.

just yesterday got same problem with accordion control and textbox

spend about 3 hours here how it goes :UpdatePanel1 onpage load or on page init try this code

///////////////////////////////////////////////////////////////////////////

Literal litContent=newLiteral();

litContent= UpdatePanel1.FindControl ("litContent") asLiteral;

////////////////////////////////////////////////////


Sol90046:

just yesterday got same problem with accordion control and textbox

spend about 3 hours here how it goes :UpdatePanel1 onpage load or on page init try this code

///////////////////////////////////////////////////////////////////////////

Literal litContent=newLiteral();

litContent= UpdatePanel1.FindControl ("litContent") asLiteral;

////////////////////////////////////////////////////

Thank you! This worked as far as eliminating my error message went. But even though the code now appears to be doing what it is told, i.e., I can step through it in debug mode and the text property of the Literal is being set to the correct content, the update panel is not displaying the results. It also appears to be doing a full page refresh rather than a partial one. I do have a scriptmanager on the page with EnablePartialRendering set to true.

Wednesday, March 21, 2012

loading page and click in any button

I am facing this problem lot , when page is downloading content and in between this user click on any link then we got error page.

and this error details insert in the database

System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
at framework_GacStore_OrderList.GetGACOrderList()
at framework_GacStore_OrderList.Page_Load(Object sender, EventArgs e)


Would you mind posting the code?


Hi pawan_mca03

I am afraid we cannot find out the exact root cause without further information .So I suggest that you'd better share your source code here. If your problem has been resolved , Sharing your work will be greatly appreciated.