Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts

Monday, March 26, 2012

Windows 2000 issue(s) with ModalPopupExtender ?

Hi,

I Have a webform containing a ModalPopupExtender, and I've just seen that the associated panel (the one that is displayed as a popup by the extender) is always visible on the page if I'm testing the page under Win2K, but this problem does not appear under Win XP (except a little and unwanted flashing).

Moreover, the panel is not displayed by the extender, it's acting as if the extender did not exist and the panel was always displayed as a simple panel on the page instead of beeing shown/hidden when required.

Win2K doest not like AJAX ?

Hi,

According to my knowledge, it should work on both win2000 & win xp. Please check the generated html to see if the source for ajax control toolkit is injected.

Like this:

Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ModalPopupBehavior, {"OkControlID":"Button2","PopupControlID":"Panel1","PopupDragHandleControlID":"Panel2","X":500,"Y":500,"dynamicServicePath":"/MyAJAXSampleSite/AjaxToolKit/ModalPopupExtender.aspx","id":"mpe"}, null, null, $get("Button1"));
});
  

Saturday, March 24, 2012

Wizard Control, Ajax and the Enter key

I've been through quite a few posts talking about problems with the Enter key in these forums, but no-one describing exactly what I'm experiencing, so please forgive me if I've missed the answer.

I've narrowed it down to a simple repeatable scenario in a VB ASP.NET application. Create a new form, add a Scriptmanager, an UpdatePanel and a Wizard control. Put a single textbox on the first step of the wizard control. This is the crucial bit: in the code-behind Page_Load event, put TextBox1.focus(). View the new form in the browser, type any text in the textbox (focus should already be set) and hit the Enter Key. It crashes with

this._postbackSettings.async is null or not an object

Any ideas anyone? If I don't set the focus in the codebehind, but click on the textbox and then enter text, it's ok.

_Ade.

Hi

I am afraid we cannot find out the exact root cause without further information captured when the problem occurs.

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.

Thank you.


Sorry I didn't reply earlier but I've been away for a couple of weeks.

If you do exactly what I said in the original post, doesn't that reproduce the problem? It does for me.

I can send you sample code if you like, but I'm not sure how to go about it it. The only line of code I've actually *written* is "Textbox1.focus", the rest is form creation, dragging and dropping!

_Ade

Works in debug, not in production (localhost)

I just put together my first Atlas page just to test out a couple components. I've just got a 4-pane accordion control and one collapsible pane control. Both work flawlessly when in debug mode using the built-in web server in VS 2005. But when I try to load the page using just localhost (not deployed, just the same page I am editing in debug) the page loads fine, no errors, it's just that the accordion has the first pane expanded and when I click on the other pane headers nothing happens. The collapsible pane is expanded and doesn't do anything (collapse) when I click on the header div for that. Basically, the page loads but none of the special Atlas functionality is there... I added an .axd mapping to the webapp in IIS, but that didn't fix it. Anything else I can try?

Thanks!

eddie

Hmmm... Still can't get this to work. It's too bad, I'd like to be able to use Atlas stuff in my current projects - doesn't anyone have ANY idea about what might be causing this? I'd be happy to try anything you can think of, just don't know what to do at this point...

Thanks!

eddie


hello.

start by checking the configuration of the application you've configured in IIS. it must be set to asp.net 2.0.


Hi Luis,

Thank you for responding, I was beginning to think I wouldn't get any help with this. I do appreciate it...

I checked and the webapp is set to use ASP.NET 2.0, as are all of the webapps I have on my system right now. It looks like the javascript stuff isn't working, but I get no js errors so I have no idea where to begin debugging this...

Anything else I can try?

Thanks again!

eddie


A little more info I've discovered:

I loaded the site in Firefox, since I have a really nice Javascript debugger in that browser, and I get the following error on EVERY Atlas page, including the AtlasSampleWebsite webapp:

WebForm_InitCallback is not defined

This is the same problem discussed inthis thread, but was never resolved. I haven't been able to find a mention of it anywhere else, but I'm stumped. This is just running on my local IIS instance, so I KNOW the webapps are configured to use asp.net 2.0 (in fact, it's 2.0.5027) but none of the Atlas components I'm using work and this is the only error I'm getting. Anyone know why this function wouldn't be included?

Thanks!

eddie

http://forums.asp.net/thread/1309775.aspx


hello again.

if you can, please do the following:

* open fiddler

* open your page on a browser

* you should see several entries in fiddler. see what's going on with the webresource.axd?... handler request. can you see the jsfiles that should be sent from the server? if you can't then there's something wrong with your configuration. in the past, i've seen this happen due to a.) incorrect version of asp.net (in this case, it's correctly configured) b.) having put an asp.net 2.0 app inside another folder which is configured as a 1.1 asp.net app and c.) are using any anti-viruses or similar programs? I think i've heard someone mention that they couldn't get the js file returned by the webresource.axd handler because those requests (axd extensions) were being blocked by those kind of apps...


Hmmm... could be "c"... I know we have a pretty strict proxy here. They even use Surf Control. I'd be shocked if that was it, but the other two you mentioned aren't the cause in this case.

In Fiddler I get a 404 error for WebResource.axd:

TERSE SUMMARY:GET http://localhost/AtlasSampleWebSite/WebResource.axd?d=qdMG4SiwmEiK1Z5jwwY0sQ2&t=632901232309638044
404 Object Not Found

FULL SUMMARY: # Result Protocol Host URL Body Caching Content-Type User-defined
67 404 HTTP localhost /AtlasSampleWebSite/WebResource.axd?d=qdMG4SiwmEiK1Z5jwwY0sQ2&t=632901232309638044 4,040 text/html

Seems strange that I would get a 404 - usually when the proxy is involved you get a access denied, not a file not found... I guess I'll try uninstalling Atlas and reinstallng from scratch to see if that fixes it...

Eddie


hello.

well, in my experience, if you're getting a 404, that means that the extension is blocked or the app is not using asp.net 2.0. btw, webresource.axd is introduced by asp.net 2.0 (not atlas), so you shouldn't need to reinstall atlas.


Yeah, that didn't help at all. Well, let me ask you this: if I can run the sample website from VS 2005, wouldn't that indicate that the axd entension is not being blocked, but rather there's something not configured properly in my IIS or webapp configuration? I can browse other atlas sites, so it's not like our proxy is blocking axd files. I would think I have something configured incorrectly somewhere, just don't know where else to look...

eddie


hello.

well, if you're using the internal server that comes with vs, then it doesn't count because it serves everythign (even those extensions that aren't configured and that normally would result in error). btw, there's been several posts about similar errors...maybe one of the posts has the correct answer...


Yeah, I finally found the answer inthis post. What a relief... This was driving me nuts. Just turning off the "Verify that file exists" for axd files fixed all my problems.

Thanks for trying to help, I do appreciate it!

eddie


hello.

cool!

btw, have you any idea on how that option got checked?


No, no idea, but I'll be looking for it from now on when I get similar errors!

Wrapper control for Slider Extender and Properties

I've written a control and that inherits from Panel and ITextControl. In CreateChildControls I create a table containing a text box and label, then I create the slider extender and properties pointing to the appropriate controls. The control loads properly (visually), but when I click the slider I get a series of javascript errors (Invalid Argument). If anyone has any suggestions they would be helpful.

Hi,

could you post the code that instantiates the slider extender?


/// <summary>
/// This web control class renders a Centralpoint console textbox.
/// </summary>
[ValidationProperty("Text")]
public class ConsoleSlider : Panel, ITextControl
{
private TextBox tbxSlider = null;
private Label lblTarget = null;
private SliderExtender seExtender = null;
private SliderProperties seProperties = null;

public ConsoleSlider() : base()
{
}

/// <summary>
/// This method is overridden to create the child controls of the console editor.
/// </summary>
protected override void CreateChildControls()
{
base.CreateChildControls();

HtmlTable table = new HtmlTable();
this.Controls.Add(table);

HtmlTableRow row = new HtmlTableRow();
table.Rows.Add(row);

HtmlTableCell left = new HtmlTableCell();
row.Cells.Add(left);

HtmlTableCell right = new HtmlTableCell();
row.Cells.Add(right);

tbxSlider = new TextBox();
tbxSlider.ID = this.ID + "_Slider";
left.Controls.Add(tbxSlider);

lblTarget = new Label();
lblTarget.ID = this.ID + "_Target";
right.Controls.Add(lblTarget);

seExtender = new SliderExtender();
seExtender.ID = this.ID + "_Extender";

seProperties = new SliderProperties();
seProperties.ID = this.ID + "_Properties";
seProperties.Minimum = 0;
seProperties.Maximum = 100;
seProperties.Steps = 1;
seProperties.Length = 300;
seProperties.EnableHandleAnimation = true;
seProperties.Orientation = SliderOrientation.Horizontal;

seProperties.TargetControlID = tbxSlider.ID;
seProperties.BoundControlID = lblTarget.ClientID;
seExtender.TargetProperties.Add(seProperties);

this.Controls.Add(seExtender);
}

/// <summary>
/// Gets or sets the control text.
/// </summary>
public string Text
{
get { this.EnsureChildControls(); return lblTarget.Text; }
set { this.EnsureChildControls(); lblTarget.Text = value; }
}
}


Hi,

mkerchenski:

seProperties.Steps = 1;

the problem is in the above statement, since it has no sense to set 1 step (it means 1 possible value, so there would be no need for a slider).

However, this is a "pathological" case that causes a bug since the slider extender is not able to handle this situation at the moment. I'll make sure to fix this for the next release.

Since the number of steps is the number of possible values, try to set steps > 1 and let me know if it solves the problem.

You can found a related threadhere.


I've tried a few different values for the Steps property and it doesn't seem to make any difference at all. If you disable script debugging (in IE) the control doesn't slide, and if you enable script debugging you get the error described initially. In the firefox javascript console I get the following errors:
Error: Found unclosed string '"'. Selector expected. Ruleset ignored due to bad selector.
Error: Unexpected end of file while searching for closing } of invalid rule set.
I'm not entirely sure they're related, but they're not there when the slider is not present.

Wednesday, March 21, 2012

Wrong URL for Webservice

Hello

I've a Problem with Webservice Calls and/or Scripttags (not sure)
In the default.aspx I've the following Script declaration:

<asp:ScriptManager ID="scriptManager" runat="server" ScriptMode="debug">
<services>
<asp:servicereference path="~/webservices/myWebservice.asmx" />
<services>
<asp:ScriptManager /
Some times the Service is called with this URL: http://www.mySite.com/webservices/myWebservice.asmx/webservices.myWebservice
The extra "/webservices.myWebservice" is wrong and the Page could not be found.

I'm sure the wrong URL is generated from Javascript (in one of the JS-Files from the Framework) when executing the functions in myWebservice or from the generated HTML-Code from the Default.aspx Page (something like <script language="javascript" src="http://pics.10026.com/?src=http://www.mySite.com/webservices/myWebservice.asmx/webservices.myWebservice />)

Any Ideas how to solve this error? Are there any Updates for the AJAX-Framework?

Your webservice is only like thishttp://www.mySite.com/webservices/myWebservice.asmx

there is no need for webservices.myWebservice /

try it


This is the normal way a webservice method is called. There is nothing wrong in it.

The method name is appended to the webservice url

For example, if you are calling a method called method1 on webservice.asmx, the url will look like

http://.../webservice.asmx/method1


But why do I get errors like the following:

Ausnahmeinformationen:
Ausnahmetyp: InvalidOperationException
Ausnahmemeldung:Request format is unrecognized for URL unexpectedly ending in '/webservices.myWebservice'.

Anforderungsinformationen:
Anforderungs-URL:http://www.mySite.ch/webservices/myWebservice.asmx/webservices.myWebservice
Anforderungspfad: /webservices/myWebservice.asmx/webservices.myWebservice

Threadinformationen:
Thread-ID: 1
Stapelüberwachung: bei System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
bei System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
bei System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
bei System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
bei System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

If I try to call the webservice directly, I get the same error in Browser.


Check if you have this in the web.config. I have seen this to cause this error

<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>


Thank you for the tipp. That code is not in the web.conf. I'll try if it helps.


I would guess that your web.config is missing these entries:

<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpHandlers>

xmlHttp ajax issues

Hi all, totally baffled by this one!

I've got a bit of code:

xmlHttp.onreadystatechange=caravanSearchStateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
That fetches some html that's just been printed by an ASP page, and prints it to a div.

There's some code afterwards:

if (document.getElementById('hideHeaders').value == '1') {document.getElementById('resultsHeader').className = ' none';}else {document.getElementById('resultsHeader').className = 'floatleft paddingtop15';}
That checks a hidden HTML field for a 1 or a 0. If it's a 1, it hides a
div. If it's a 0, it shows a div. By default in the html, the field is
set to 0.

Trouble is, the if statement is delayed. If I want to hide that div, I
have to wait for the condition to get a 1 twice. Vice-versa for the 0.

However, if I put an alert saying "hello world!" between the two code snippets I gave you, it works!

It's almost as though the HTML is being written too late for the javascript to validate the if statement.

Trouble is, if I put a sleep function I found between those bits of code, it doesn't work.

What the hell is the problem here?

Any help's appreciated because I'm stuck!

Cheers,

Karl.

Hi,

The same problem is discussed athttp://forums.asp.net/p/1134520/1813795.aspx#1813795 &http://forums.asp.net/p/1134520/1813803.aspx#1813803

If yourHTML fieldis still not be shown,it is noneffective action at once to set the value of thefield.

The similar code in that post:

<script language="javascript" type="text/javascript">
// <!CDATA[

function Button1_onclick() {
// This works

document.getElementById('div1').style.display = "block";
document.getElementById('div1').scrollLeft = 100;


// But this doesn't work

//document.getElementById('div1').scrollLeft = 100;
//document.getElementById('div1').style.display = "block";
}

// ]]>
</script>

Best Regards


Thanks for taking a look at that for me; I've since found a solution and have written a small blog about it so that people are aware.

If you have any questions, reply to this post and I'll have a go at answering them.Smile

http://codingrage.blogspot.com/2007/09/xmlhttprequest-object.html

Cheers,

Karl.