Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Wednesday, March 28, 2012

Page.IsCallback equivalent

What is the Atlas equivalent to the value returned by Page.IsCallback?

As I understand it, since the call is just an intercepted postback, Page.IsPostBack will be True on an Atlas callback. I don't think there is a way to tell if you're dealing with a "True" PostBack or a callback, but I also don't think the event could be called more than one way, so if you need to check later on in your code how you got to where you are, set a member variable in the event handler.


ScriptManager.GetCurrent(Page).IsInPartialRenderingMode

Thanks folks. I had noticedIsInPartialRenderingMode and found it seems to do the job. I do need a definitive answer as it affects how I create my products. Can anyone of the Atlas team chime in?


hello.

as you can see, i'm not in the atlas team. however, i'd like to confirm Rama's answer. btw, currently, a partial postaback is identified by a header called delta which has its value set to true during a partial postback. during the init event, the scriptmanager control looks for that header, and when it has the value true, it initializes the _inPartialRenderingMode field which is used to "feed" the result of the IsInPartialRenderingMode property.

Monday, March 26, 2012

PageNavigator!

<div id="pageNavigator">
<input type="button" id="firstPageButton" value="<<" />
<input type="button" id="previousPageButton" value="<" />
<span id="pageIndexLabel"></span>
<span id="pageCountLabel"></span>
<input type="button" id="nextPageButton" value=">" />
<input type="button" id="lastPageButton" value=">>" />
</div>

I need to use image buttons for navigation and that works fine, but my question is how can I make certain image to change the src (to a disabled image) when it reaches either the very first page or very last page!

Please advice!

Hi,

supposed you've declared an image like:

<img id="myImage" src="http://pics.10026.com/?src=enabledImage.gif" alt="" />

then you can do it using pure Javascript:

if(firstPageReached || lastPageReached) {
document.getElementById('myImage').src = 'disabledImage.gif';
}

or Atlas:

var myImage = new Sys.UI.Control($('myImage'));
myImage.initialize();

if(firstPageReached || lastPageReached) {
myImage.set_imageURL('disabledImage.gif');
}

all understood, but how can I attach the event that it has reached the end of page or last of page?
Hi,

this really depends on how you have designed your PageNavigator (are you using server controls? Did you implement a client control?). If you need some info about how to raise events in the Atlas framework, please checkthis article.

below you will find my xml script. Please help me if you can!

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<listView id="CustomersResults" itemTemplateParentElementId="CustomersResults_itemTemplateParent" >
<layoutTemplate>
<template layoutElement="CustomersResults_layoutTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="CustomersResults_itemTemplate">
<label id="CustomersResults_Name">
<bindings>
<binding dataPath="Name" property="text" />
</bindings>
</label>
<label id="CustomersResults_CustomerId">
<bindings>
<binding dataPath="CustomerId" property="text" />
</bindings>
</label>
<label id="CustomersResults_Description">
<bindings>
<binding dataPath="Description" property="text" />
</bindings>
</label>
<image id="CustomersResultsImageThumbPath">
<bindings>
<binding dataPath="CustomerID" property="imageURL" transform="DoAdditionalImageHandling" />
<binding dataPath="CustomerName" property="alternateText" />
</bindings>
<behaviors>
<hoverBehavior hover="ImageHandler" />
</behaviors>
</image>
</template>
</itemTemplate>
<bindings>
<binding dataContext="CustomersResultsview" dataPath="filteredData" property="data" />
</bindings>
</listView>
<dataView id="CustomersResultsview" pageSize="6">
</dataView>

<dataNavigator id="CustomersResultspageNavigator" dataView="CustomersResultsview"/>
<button id="CustomersResultspreviousPageButton" parent="CustomersResultspageNavigator" command="previousPage">
<bindings>
<binding property="enabled" dataPath="hasPreviousPage"/>
</bindings>
</button>
<label id="CustomersResultspageIndexLabel" parent="CustomersResultspageNavigator">
<bindings>
<binding property="text" dataPath="pageIndex" transform="Add"/>
</bindings>
</label>
<label id="CustomersResultspageCountLabel" parent="CustomersResultspageNavigator">
<bindings>
<binding property="text" dataPath="pageCount"/>
</bindings>
</label>
<button id="CustomersResultsnextPageButton" parent="CustomersResultspageNavigator" command="nextPAGE">
<bindings>
<binding property="enabled" dataPath="hasNextPage"/>
</bindings>
</button>
<button id="CustomersResultsfirstPageButton" parent="CustomersResultspageNavigator" command="FIRSTPage">
</button>
<button id="CustomersResultslastPageButton" parent="CustomersResultspageNavigator" command="lastpage">
</button>
</components>
<references>
</references>
</page>
</script>

PageMethos Output parameters

Can i do something like this:?

[WenMethod]
public void Do(int x,out int y)
{
y = 3;
}

and get the 'y' value in my JavaScript?

I've never tried it with that syntax, but I have done:

[WebMethod]

public string Do(int x)

{ return 3;

}


hello.

well, if i recall correctly, output parameter aren't supported yet...

Saturday, March 24, 2012

PageRequestManagerServerErrorException with 500 error code

In javascript I'm setting the value property of a button within an update panel before calling click() on the button to refresh the update panel. (I need to refresh an update panel and pass extra data on the callback, and no one on this forum has yet described a better way of doing it than this.)

This was all working in tests that I did last week, but I'm now getting the following error message box in IE:

"Sys.WebForms.PageRequestManagerServerErrorException: An unkown error ocurred while processing the request on the server. The status code returned from the server was: 500"

Any ideas?

I have the same error but on a couple of dropdown which update one another's datesource with updatePanels.

If i change the value of the first dropdown for several times, always the third tine gives this error.

I found on a post the setting TRACE off resolves but not for me.

Any ideas ?

Just try to change frequently some controls which use updatepanels (for other controls) and see what's happen.

Thank's

Sorin


I found also that If I have more than 3 UpdatePanels in a Page I get this error after 3 callbacks.

If I have on page Trace="false"and "EnableEventValidation="true"

I get this error:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Thank's again


I've also tried setting the value of a hidden field and a hidden textbox and both raise the same error.

I cannot even paste data into a textbox and then do a postback without getting this error.

I'm also EXTREMELY TIRED OF MICROSOFT IGNORING ALL OF MY POSTS!!!!!!!!!!! Angry