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

Saturday, March 24, 2012

How clientscript member Authentication last the whole browse session than a page

I use asp.net ajax client method to do member Authentication

Sys.Services.AuthenticationService.login(username.value,password.value, true ,null,null,null,null,"User Context");

It successed in current page. but when I redirecit to another page, the Authentication dissapeard

How clientscript member Authentication last the whole browse session

I found I have wrong setting in my config files

Wednesday, March 21, 2012

How can I update a detailsview from a gridview in Atlas?

Hi, I have a gridview and a detailsview. The gridview takes a value from a textbox and retrieves rows. It has been atlas enabled and works fine. Now I want to take a value from the gridview and populate the detailsview. I have an asp:commandfield in my gridview for select, but everytime I click it is causes a postback. I don't want a postback (that's the whole reason for atlas). I don't believe I doing this correctly, my design. Also, all my detailsview "stuff" is in an updatepanel for atlas.

Any help is appreciated on how I can populate a detailsview based upon a gridview in atlas. Thanks.

Isn't this a common practice in non-atlas applications? Clicking a row in a gridview and populating a detailsview or formsview?

You need to set the Datakey on the gridview to the ID field of your datatable (hopefully you have one). Then set the datasource on the details view and configure the input parameter to be a control and pickup the Datakey from your gridview. This is a standard master detail setup, you can find good documentation on this in the VS 2005 documentation.(ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vwdcon/html/e3ab20ae-44c3-43f0-91f3-0f95fff47b48.htm).

I'm guessing the Atlas part of this is the fact your page is doing postbacks. So you need to put an updatepanel around the gridview and another around the detailsview? Then put a trigger on the detailsview updatepanel to point at the griview and the "SelectedIndexChanged" event.

Hope this helps


I am doubtful that the server side UpdatePanel control will provide what you are looking for. However, Atlas provides two client side controls ListView and ItemView which are exactly designed for your scenario.


Xiyuan Shen:

I am doubtful that the server side UpdatePanel control will provide what you are looking for. However, Atlas provides two client side controls ListView and ItemView which are exactly designed for your scenario.

Thank you. I will try it. But this does kind of get rid of my nice drag and drop abilities doesnt it?


you can bind a dragDropList behavior to the ListView and a dataSourceDropTarget to the ItemView to achive the DND

Xiyuan Shen:

you can bind a dragDropList behavior to the ListView and a dataSourceDropTarget to the ItemView to achive the DND

Sorry, I should have been clearer. I was referring to the drag and drop controls of Visual Studio 2005. I paid $800 for it. I don't like not being able to use it like the other controls. Hopefully, there will be a way to add drag and drop Atlas controls in the IDE's toolbox one day.


Checkout Scott Guthrie's video athttp://atlas.asp.net/Default.aspx?tabid=47

It's an excellent tutorial on getting started with Atlas. It combines GridView and Details View, with some filtering. You can also download for offline viewing.


petehbourne:

Checkout Scott Guthrie's video athttp://atlas.asp.net/Default.aspx?tabid=47

It's an excellent tutorial on getting started with Atlas. It combines GridView and Details View, with some filtering. You can also download for offline viewing.

I have watched it, but could not see where he selected a value in the gridview and populated a detailsview. He did it the other way around it looks like.


Hopehttp://forums.asp.net/thread/1247115.aspx can provide you some help

How can I tell Scriptmanager to look for a specific form id value?

I'm getting a javascript error. I think it's because the Scriptmanager is looking for 'form1' which isn't the value of the form id on the page. The form id value is 'form1_1458'

I did a view source on the browser and I see this line:

Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));
 

I need the ScriptManager to look for 'form1_1458' How can I force the scriptmanager to do to this?

It queries the ClientID on Page's Form property internally. What does Form.ClientID on your page return, if you try to output that?


i should have mentioned that this .aspx page is hosted within a portal environment (BEA aqualogic). The portal seems to append the _1458 to form1 which in the end makes it form1_1458.

let me see what Form.ClientID outputs.

how can I pass a value to a javascript function on image clickBehavior atlas?

Hi Guys, I have the image template below and on imageURL I bind theDBImageName that comes from database via webservices objects. I also call a function DoAdditionalHandling because I need to construct the actual image URL. Now I need to define a click event which I am using theclickBehavior . How can I pass to the function a value that comes from database, let's say how can I passDBImageName field that is being bound to imageURL. Please advice!

<image id=

"ImageThumbPath">

<bindings>

<binding dataPath=

"DBImageName" property="imageURL" transform="DoAdditionalHandling" />

<binding dataPath=

"DBImageALT" property="alternateText" />

</bindings>

<behaviors>

<clickBehavior click=

"ImageClickHandler" />

</behaviors>

</image>

From your event handler, use the sender's dataContext to get the value, like so:

function imageClickHandler(sender, eventArgs){ var DBImageName = sender.get_dataContext().DBImageName;}

I just posted a working exmaple of this to my blog:http://smarx.com/posts/how-to-pass-a-value-to-a-javascript-event-handler.aspx.


Steve,

I asked you also the other day. Can you help me with<atlas:InitialDatarunat="server"id="InitialData1" >

I need to know how to specify the method name and the parameters to method. The example you showed me does not specify it, but it seems like it has its default methods because the web service on that example inherits froma dataservice. Please help me and give me more details if you can. I appreacite your help.


If I understand your question correctly, you want to specify what method to call on the web service (like using "loadMethod=..." on a dataSource in xml-script). Looking at theclass browser documentation for InitialData, it doesn't look like that's possible. :-(

Yes, the example works because it inherits from DataService and provides one method with the attribute [DataObjectMethod(DataObjectMethodType.Select)], so the right thing happens by default.


so any work around? Please advice.

Nothing that I'm aware of (but others please chime in if you have an answer).

I think you'll have to just not use <atlas: InitialData /> and just use your dataSource with autoLoad="true". InitialData is just there to improve performance a little by allowing you to send the data down with the initial page load instead of requiring a second roundtrip to the server.

I'll ping the product team and see if a LoadMethod parameter will be added to InitialData in the future.


is it anyway to specify the method call and parameters ondataSource with autoLoad="true? Please advice Steve!


Yes, just use the "serviceURL=..." and "loadMethod=..." properties on your <dataSource /> xml-script tag. I believe you can just specify <parameters foo="bar" baz="blah" ... /> inside your <dataSource /> to pass parameters.

If you need to databind those parameters, use <binding dataPath="..." property="parameters" propertyKey="foo" />.


not sure how. do u have the syntax of the datasource parameters? how can then I bind it to a dataview?

More explicitly, here's the syntax:

<dataSource id="myDataSource" serviceURL="myservice.asmx" loadMethod="myLoadMethod">
<parameters param1="foo" param2="bar" />
</dataSource>

(Assuming you have myLoadMethod(string param1, string param2); in your web service.)

Databinding your dataView doesn't need to change at all. It's still:

<dataView id="myDataView">
<bindings>
<binding dataContext="myDataSource" dataPath="data" property="data" />
</bindings>
</dataView>

I believe you already had this working in your code from theother thread.


I did that exactly and got a javascript error invalid xml mark up script. On the other example, I have it simply by clicking in a buton. But my other task is when page loads, the data has to be displayed.

I'll look into getting you a full working example.

To follow up on what I said earlier "I'll ping the product team and see if a LoadMethod parameter will be added to InitialData in the future," I checked with the product team, and it sounds like InitialData will have all the functionality of dataSource (so that includes specifying the method to call on the web service and any parameters), but they're not sure of the timeframe.


Thank you! Please email me atnesfrank@.yahoo.com

Steve,

Here is what I am doing but I get invalid xml mark up script. may be the syntax for parameters is diffrent? Please advice!

<dataSource id=

"dataSource1" autoLoad="true" serviceURL="~/AtlasTestService.asmx" loadMethod="GetTestData">

<parameters Code=

"cu0001" paramboolean="true" />

</datasource>


It's probably because your closing tag doesn't match your opening tag. Try changing "datasource" to the correct capitalization: "dataSource".