Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Wednesday, March 28, 2012

Why JSON?

Say, please, what was the main reason to use JSON object serializing in Atlas instead of SOAP? Easy deserializing? Or light weight? Or something else?

And will Atlas support SOAP in the future?

Thanks.

Pavel,

Easy deserializing is indeed a big part of it. The ability to just call JavaScript's 'eval' instead of having to reconstruct an object graph from an XML DOM makes JSON much easier to you. JSON is also a more concise format.

It is conceivable that Atlas will support SOAP in the future.

David


Thanks for quick answer.

Why this code does not work when its button is inside the AJAX “UpdatePanel” control ?

protectedvoid DownlFile_Click(object sender,EventArgs e)

{

string web_path ="./ items/part1.pdf";

string path = Server.MapPath(web_path);

FileStream MyFileStream =

newFileStream(path,FileMode.Open);

long FileSize;

FileSize = MyFileStream.Length;

byte[] Buffer =newbyte[(int)FileSize];

MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);

MyFileStream.Close();

Response.ContentType ="application/pdf";

Response.AddHeader

("content-disposition","attachment; filename=part1.pdf");

Response.BinaryWrite(Buffer);

}

Hi paradise_wolf,

You can't use Response.Write in a AsyncPostback trigger event of an UpdatePanel. You need move the button outside the UpdatePanel or register it as Postback trigger.

Hope this helps,


Hispvlong

I am not sure if "RegisterAsyncPostBackControl" registers the button asPostback triggeras you suggested to do. I am getting this error message:

"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '%PDF-1.3%□□3389 0'."

Below is the relevant ASP.NET web form code and the added C# code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

protectedvoid Page_Load(object sender,EventArgs e)

{

ScriptManager1.RegisterAsyncPostBackControl(DownlFile);

..

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<asp:UpdatePanelID="ITEMS_LIST_EREADER_PANEL" runat="server"

UpdateMode="Conditional">

<ContentTemplate>

..

<asp:ButtonID="EreaderBtn"runat="server"Text="Next"

OnClick="EreaderBtn_Click"/>

..

</ContentTemplate>

</asp:UpdatePanel>

<asp:UpdatePanelID="DOWNLOAD_PANEL"UpdateMode="Conditional"

runat="server">

<ContentTemplate>

..

<tableID="DownloadDialogTb"visible="false"runat="server">

<tr>

<tdalign="center">

<asp:ButtonID="DownlFile"runat="server"Text="Download"

OnClick="DownlFile_Click"/>

</td>

</tr>

</table>

..

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlId="EreaderBtn"

EventName="Click"/>

</Triggers>

</asp:UpdatePanel>


Hi paradise_wolf,

You should use RegisterPostBackControl method to register a control as Postback trigger.

Hope this helps,


Thank you very much,spvlong . Big Smile

hi,

I am also getting same problem while generating PDF? i could not solver even after registring as postback trigger control. It gives me the same error.

If you have solved it, plz suggest the solution for the same.

thanks

Varsha


http://forums.asp.net/1662626/ShowThread.aspx#1662626

Monday, March 26, 2012

window.debug.isDebug is null or not an object

I have user control which contains UpdatePanel. For UpdatePanel I have tried to put UpdatePanelAnimationExtender, but there's coming javascipt error which says "window.debug.isDebug is null or not an object". Without UpdatePanelAnimationExtender UpdatePanel is working great. I'm using ASP.NET 2.0 and latest AJAX Framework and ControlToolkit. What could be wrong?

Thanks
juster

You likely have old scripts from an AJAX CTP or Beta cached on your web server or on your browser. Reset IIS and make sure you do a CTRL-F5 on your browser.

window.debug has no properties since upgrade from RC to RTM

Hi!

Since I upgraded from AJAX RC to AJAX RTM I get following erros:

'window.debug.isDebug' is null or not an object -> IE7
window.debug has no properties -> Firefox
if (!window.debug.isDebug) { ...ScriptResource.axd (line 107)

What can be wrong?

Thanks for your help

Martin

The problem is fixed now. It seems that the control toolkit was not up to date within the project although I used "Rebuild Solution" and followed the release notes.

window.opener.document.TextBoxRateLockDate is null or not an object

My ASP.Net page has a calendar picker link with an onclick event as shown below:

<a href="http://links.10026.com/?link=javascript:;" onclick="calendarPicker('TextBoxRateLockDate');" title="Pick Date from Calendar"><img src="http://pics.10026.com/?src=../../../../App_Images/simplecalendar/calendar.gif" border="0" /></a>

The above link is inside of a MultiView control, which is inside an UpdatePanel control. The link pops-up the date picker calendar just fine but when I select a date , I get the following error:

Microsoft Jscript runtime error:
'window.opener.document.TextBoxRateLockDate' is null or not an object

How can I resolve this issue?

Hi,

This is a pure javascript issue.

I'd suggest using document.getElementById() method to find the textbox. Usually like this: window.opener.document.getElementById("TextBoxRateLockDate")

Hope this helps.

Saturday, March 24, 2012

Wizard with Update Panel

I have a Wizard control with inupdatepanel . I am trying to create dynamic wizard steps in pagepre_init event, but it is giving me an error " object reference not setto an instance of an object" . without updatepanel it's workingproperly.

Thanks in Advance

Do you have a fileupload control in the wizard? If so,see this thread.

hello.

please post a simple page that reproduces this problem.

Wednesday, March 21, 2012

Write Xml/Script in Server Side

Hi,

Is there any way to write the Xml/Script other than using the XmlWriter. I mean is there any sever side object model of atlas, which I can utilize to generate these scripts. Can you guys please give an estimated time when the complete documentation is publicly available?

You can write XML Script in one of two ways:

- You can just have static XML-script directly on the ASP.NET page. The script can use ASP.NET databinding expressions, and even repeaters.

- You can use the Atlas ScriptManager control, which provides an object model to help you generate scripts from ASP.NET server controls. For a couple of examples, check out Nikhil's blog post:

http://www.nikhilk.net/AtlasScriptManager.aspx

- If you have a control or extender that needs to write script, you can register with the ScriptManager by calling RegisterControl, and implement the RenderScript method. For an example, see:

http://www.nikhilk.net/AtlasInPlaceEditSampleBehavior.aspx