Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Wednesday, March 28, 2012

Why ScriptManager in MasterPage is not enough to the toolkitExtender control?

This is the error I get when look on a page and drop the User control that include the ajaxTooltip from any type.

Any suggestion?

The Error

Do you use ScriptMangerProxy?you need to use ScriptManager/ ScriptManagerProxy both for master page.

Where to add the ScriptManager and where to add the ScriptManagerProxy to get a clear design time project developing?

To explain the controls, pages, masters I have, here are they:

1. A master page that include a ScriptManager (I try to include a ScriptManagerProxy also).

2. A page that inherit the MasterPage and have a User Control in it by design time(drag and drop).

3. A User Control that have a modalPopupExtender in it, that work properly.

My only problem that other developers use my User Control in them Pages and the User Control(that added to the page) raise a:

Error Rendering Control

An unhandled exception has occurred.

The control with ID 'MpdalPopupExtender1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

What can I add to the Page, Master or may be web.config?

Monday, March 26, 2012

Windows Integrated Authentication prompting for password, Ajax calls are fully qualifying

Alright, here's my very strange story: I have an ASP.NET 2.0 webapp that utilizes Ajax, for some reason even if I type in "http://ServerName/DirectoryName" it will prompt for a password and it will show "Connect to ServerName.DomainName.com" instead of just "Connect To ServerName". If I choose not to authenticate it will still load the page, but none of the Ajax stuff will load, and on any ajax asynch callbacks it will prompt me to authenticate again. Also, I have manually added the fully qualified server url to my Local Intranet zone and am still getting prompted, and I have tried (just for troubleshooting) to set the Authentication settings for my Internet zone to always send username and password information, but it still prompts me for a username and password! Any help would be greatly appreciated, my biggest question iswhy are my Ajax callbacks using the fully qualified url instead of the shorter one I actually typed in?

Thanks!

Mark Ransom

So I've been hacking through this for weeks now (on and off) and as soon as I post my question to this forum I figure out what's wrong. Basically in Internet Explorer under Advanced Settings there's an option that says "Enable Integrated Windows Authentication", which you would think would need to be checked for this type of authentication to work correctly. You'd think so, and you'd be wrong (at least in my situation) because unchecking that box and restarting IE allowed my users to log directly into my app and all my Ajax calls work without prompting for authentication. This may or may not be of use to anyone else, but it took me a lot of head banging (against a wall) to figure out this backwards fix.

Thanks

Mark

Saturday, March 24, 2012

Wizard and text/xml-script question

I am using a wizard control.

At the bottom of the page I have this:

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<control id="divSample" visibilityMode="Collapse"/>
</components>
</page>
</script>

I get an error saying that divSample does not exist - but there is a div named divSample on this page.

Can you provide the complete repro?

It's sensitive data - so I created a mock up of what is occurring:

Note - because the control is on 'step 2' it doesn't see the control.

<

asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server"><atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True"></atlas:ScriptManager><asp:WizardID="Wizard1"runat="server"ActiveStepIndex="0"><WizardSteps><asp:WizardSteprunat="server"Title="Step 1"> Welcome, click next to continue...</asp:WizardStep><asp:WizardSteprunat="server"Title="Step 2"><inputid="Text1"type="text"/><inputid="Button1"type="button"value="button"/></asp:WizardStep></WizardSteps></asp:Wizard><scripttype="text/javascript">function pageLoad()

{

$(

'Text1').control.set_visible(false);

}

function Button1_Click()

{

$(

'Text1').control.set_visible(true);

$(

'Text1').control.set_text('Hello World');

}

</script><scripttype="text/xml-script">

<page xmlns:script=

"http://schemas.microsoft.com/xml-script/2005">

<components>

<textBox id=

"Text1" />

<checkBox id=

"Button1" click="Button1_Click"/>

</components>

</page>

</script>

</

asp:Content>

Bumping for a follow up please.

Thank you


checking back in - thank you

Good day.

Checking back - any clues? Is this a bug?

I'd greatly appreciate some response - using xml-script in a wizard seems to be a senario that would be common?

I'll keep checking back everyday :)


I haven't played with this but I'll bet if you look closely at the generated HTML you'll see that the wizard doesn't generate HTML for Step 2 when you're on Step 1. The XML Script doesn't know that, so it goes looking for TextBox1 which, isn't there.

As far as how to deal with this...

What happens if you move the XMLScript inside of the Wizard two step?

What happens if you move the step contents into a UserControl?

The toolkit may be able to help you here since you can locate your extenders (they generate XML script) in the same naming scope as the extendee.


I will give that a try and report back - I appreciate the response.

It worked moving the xml-script to the wizard step.

Thanks for thinking outside of the box for me :)

Wednesday, March 21, 2012

XHTML 1.1 Firefox and Opera problem

I installed AJAX Beta2 and used the CTP template to create a new web site. Which creates default.aspx page, with the doc type of:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
I have a table with images. I run the page in IE7 looks perfect. I ran in FF and Opera the cells height are 5 to 10 px to big. After pulling my hair for about 2 hours. I notice the doctype.
I set it to this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
And the table is correct (works in IE as well).
Should an AJAX site doctype be XHTML 1.1? Does it matter? Why did this break firefox on something so simple as a table?
Thanks
Rick 
AJAX should support site doctype XHTML 1.1 in the release version. I aslo find the similar issue to yours.The Ajax control size?is?somewhat?different?
in?different?browers?such?as?IE,FireFox,Opera,Safari.

Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability.
The Ajax technique uses a combination of:
XHTML (or HTML) and CSS, for marking up and styling information.
The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented.
The XMLHttpRequest object is used to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server, and in other implementations, dynamically added <script> tags may be used.
XML is sometimes used as the format for transferring data between the server and client, although any format will work, including preformatted HTML, plain text, JSON and even EBML. These files may be created dynamically by some form of server-side scripting.

XML and Webserivces

Hi All,

I have created a webservice that returns XML data to be processed by the client.

The returned XML contains a complex type that I created, as well as having a number of nested objects on which I have used the XMLARRAY / XMLARRAYITEM.

Fragment of test XML shown below...

<?xmlversion="1.0"encoding="utf-8"?>

<Testxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns="http://tempuri.org">

<test1>201</test1>

<test2>Blah Blah</test2>

<test3>3</test3>

<test4>51</test4>

<TestTest>

<Inner>

<inner1>300</inner1>

<inner2>TEXT</inner2>

<inner3>TEXT</inner3>

<inner4>TEXT</inner4>

<inner5>TEXT</inner5>

<inner6>TEXT</inner6>

<inner7>TEXT</inner7>

<inner8>TEXT</inner8>

<inner9>TEXT</inner9>

<inner10>TEXT</inner10>

</Inner>

<Inner>

<inner1>301</inner1>

<inner2>TEXT</inner2>

<inner3>TEXT</inner3>

<inner4>TEXT</inner4>

<inner5>TEXT</inner5>

<inner6>TEXT</inner6>

<inner7>TEXT</inner7>

<inner8>TEXT</inner8>

<inner9>TEXT</inner9>

<inner10>TEXT</inner10>

</Inner> </TestTest>

</Test>

Now when I use the test harness the XML is generated exactly as I require.

Also I can reference the returned data on the client, for example by using arg.test1 would return '201'.

My probelms/question are these...

1> How do I access the inner array items. For example how would I access elements under TestTest?

2> How do I convert the returned data from the webservice into valid xml on the client? Every time I try and do this I get the error 'XML document must have a top level element'.

I cant understand why it says it is not valid as every other application I have has no problem with the XML that is generated,

Can anyone point me in the right direction as I cant see where the problem is.

Thanks in advance

Problem sortedSmile

Once I found out about the service using JSON by default it was very straightforward.

I looked at the JSON formatted data that was sent with the response. From there it was obvious how to call the array items.

For example arg.Level1[1].Level2Value

Didn't know much about JSON before this but it is a great format (compared to XML) to use when you want to handle stuff on the client in javascript. Even handles custom objects with ease.

Hope this helps somebody