Showing posts with label popup. Show all posts
Showing posts with label popup. Show all posts

Wednesday, March 28, 2012

Extender "Tasks" popup in VS2005

Hello,

the latest update for the controlkit shows a "Tasks" popup for many extenders in VS2005. For example the NumericUpDownExtender shows "Add GetNet NumericUpDown page method" in that popup.

When i select such an item i get a message that no codefile can befound and no method is added.

Is that a known problem, is my installation broken or is that not supposed to add a method to my current code behind? (maybe i need to setup a webservice to place the method there?)

Thanks in advance,

Ralf

Does your .ASPX page have a corresponding .ASPX.CS file associated with it? That's the default, but if you changed it, then that could be causing this problem, perhaps. Mind trying it on a new page that has a code-behind file to check?


Right - if you don't have a code behind file, that message is by design. Unfortunately there wasn't a good way to determine if the codebehind file is present without actually trying to show it.


My page has a codebehind file but ist is not aspx.cs, it is aspx.vb cause i am using VB at the moment. Could that be the cause? I have never tried it with a C# file.


No, it doesn't have to be c#.

Only requirement is that the code is in a separated code file(.cs or .vb).


That is strange. On the comuter at home i have the same effect. Maybe i will try to re-install the toolkit. Or do you have another idea what could cause that?


An additional info: That message is generated at two positions in the extenders source with the same message. I have modified those messages to see where the error is generated: It is generated when the variable "fileCodeModel" should be assigned. In my case this variable is "null" so the message is shown.

Monday, March 26, 2012

Execute javascript doesnt work for popup calendar in AJAX

Hi I create a popup calendar and put the following code for clicking on calendar:

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
PopupControlExtender1.Commit(Calendar1.SelectedDate.ToShortDateString())
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "setCursor", "alert(777);", True)
End Sub

Page.ClientScript.RegisterClientScriptBlock will cause javascript executed auto when I clicking on popup calendar. It works for ATLAS. But after I moved it to AJAX, it doesn't work. no response for this javascrpt.

Help please.

With ASP.NET AJAX Beta, you need to move to ScriptManager.RegisterClientScriptBlock instead of Page.ClientScript.RegisterClientScriptBlock.

Thanks. David.

But for my case, ScriptManager is put in master page. And the following code is put inside a user control (.ascx) and loaded dynamically.

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
PopupControlExtender1.Commit(Calendar1.SelectedDate.ToShortDateString())
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "setCursor", "alert(777);", True)
End Sub

How to get ScriptManager object in user control?


I changed the code as:

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
PopupControlExtender1.Commit(Calendar1.SelectedDate.ToShortDateString())
Dim sm As Microsoft.Web.UI.ScriptManager
sm = Page.Master.FindControl("MasterScriptManager")
sm.RegisterClientScriptBlock(Me.Page, Me.GetType(), "setFocus", "alert(777);", True)
End Sub

it still doesn't work. Help please.



The Control parameter to RegisterClientScriptBlock (the first param) needs to specify a control that's inside the UpdatePanel that's being updated when the script block is to be updated. I suspect that Me.Page in your example does not satisfy that requirement, so please try a control that does.
Thank you so much, David.

Saturday, March 24, 2012

Exception in WebResource.axd when PostBack occurs in Firefox

I attempted to add an ATLAS UpdatePanel to a page that can cause an additional page to popup for some user input. When the popup is closed the data entered is, via JavaScript, posted into controls within the UpdatePanel in the calling page via "window.opener..." calls and then a postback is performed in the calling page via a "window.opener.__doPostBack()" call. This works fine in IE but, with Firefox 1.5.0.6 it fails with the following appearing in the Firefox JavaScript console:

Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost/TaxBrowser/WebResource.axd?d=UtGnGti3th-E3k4H6R_105-ZnoTFL0xfqNYWKYczTD1WL_MlZnWikLeZY4VJgy1PFU2wuwGL8eNKwcH3DdmeLa2lMRfeto2rgkZK9pto_QA1&t=632870129240000000 :: anonymous :: line 4140" data: no]
Source File: http://localhost/TaxBrowser/WebResource.axd?d=UtGnGti3th-E3k4H6R_105-ZnoTFL0xfqNYWKYczTD1WL_MlZnWikLeZY4VJgy1PFU2wuwGL8eNKwcH3DdmeLa2lMRfeto2rgkZK9pto_QA1&t=632870129240000000
Line: 4140Same problem...

I'll cry with you...Crying

Hi,

It's an old post, but I have the same problem.

Did you find an explanation ? What did you do to avoid that error ?

Thank's.

Gilles


It's not so old... The explanation... I send a e-mail to one of the Atlas developers so we could know something... if they know this, if it will be fixed in next release, blablabla... Nobody answered...

To avoid the error... i remove the atlas update panel on that page...
I had a similar problem on a page where I added some updatePanels dynamically. I managed to fix the problem by placing the __doPostBack() call inside of a window.setTimeout, as seenhere

Hi

I get the same error with v1.0. And I tried the setTimeout workaround with no success.


I resolved my problem with the setTimeout solution...

Thx man, my problem lied in that the script script did a window.close() directly after __doPostBack...

function doPostBack(e) { window.opener.__doPostBack(\'" + _owner + "\'); window.close(); }
setTimeout('doPostBack()', 0);

...the solution was...

function doPostBack(e) { window.opener.__doPostBack(\'" + _owner + "\'); setTimeout('window.close()', 500); }
setTimeout('doPostBack()', 0);

EventValidation error msg!

one of the Atlas control popup me something that i need to implement an event agrument or something!! ?? tha happen on a click of a ListBox control.

i am verry confuse here !

"Invalide postback or callback argument. Event validation is enabled using <page enableEventValidation=true> in configuration or in the page. For security purposes, this features verifies taht arguments to postback or callback events origiante from the server control that originally rendered them. If the data is valid and expected, use the ClickScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation."

What im suppose to do with that now?

I fix it !!

this is what i did.. i had a UpadatePanel inside a UpdatePanel.. and thats what was causing a script Popup msg !!